Skip to content

Commit

Permalink
tweak calendar formatting and behavior
Browse files Browse the repository at this point in the history
 - calendar height no longer restricted (#41)
 - end time properly display
 - clicking event will open edit page (#28)
  • Loading branch information
Rowbotronics committed Dec 29, 2019
1 parent 43da77c commit 339f671
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,21 @@ def return_data():
else:
spots = 'FULL'

start_date = event.start_date
start_date = event.startDateTime()
end_date = event.endDateTime()

event_list.append({
"Id": event.id,
"title": event.title,
"Name": event.title,
"start": start_date.isoformat(),
"Date": start_date.isoformat(),
"Time": start_date.isoformat(),
"end": end_date.isoformat(),
# "Date": start_date.isoformat(),
# "Time": start_date.isoformat(),
"Description": event.description,
"Register": "http://makeict.wildapricot.org/event-"
+ str(event.id),
"url": '/event/' + str(event.id)
})

return json.dumps(event_list)
11 changes: 10 additions & 1 deletion src/templates/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
defaultDate: dayStr,
editable: false,
eventLimit: true, // allow "more" link when too many events
height: "auto",
eventColor: '#007bff',
navlinks: true,
events: {
url: 'calendardata',
error: function() {
Expand All @@ -45,7 +48,12 @@
},
loading: function(bool) {
$('#loading').toggle(bool);
}
},
// eventClick: function(info) {
// console.log(info)
// alert('Event: ' + info.title);
// }

});
});

Expand Down Expand Up @@ -81,6 +89,7 @@
/*max-width: 900px;*/
/*margin: 40px auto;*/
padding: 0 10px;
height: 100%;
}
</style>
{% endblock head %}
Expand Down

0 comments on commit 339f671

Please sign in to comment.