diff --git a/src/program/static/js/event_instance_websocket.js b/src/program/static/js/event_instance_websocket.js
index 5d19080c..5cfa2f94 100644
--- a/src/program/static/js/event_instance_websocket.js
+++ b/src/program/static/js/event_instance_websocket.js
@@ -108,6 +108,7 @@ function render() {
parameters = get_parameters();
toggleFilterBoxes(parameters['types'], parameters['locations']);
render_day_menu(parameters['day']);
+ setICSButtonHref(location.search);
if(parameters['day'] != null) {
render_day(parameters['types'], parameters['locations'], parameters['day']);
@@ -473,6 +474,13 @@ function setHistoryState(parts) {
}
history.replaceState({}, '', query);
+ setICSButtonHref(query);
+}
+
+function setICSButtonHref(query) {
+ // Update ICS button as well
+ var ics_button = document.querySelector('#ics-button');
+ ics_button.setAttribute('href', CONFIG['ics_button_href'] + query);
}
function toggleFilterBoxes(types, locations) {
diff --git a/src/program/templates/schedule_base.html b/src/program/templates/schedule_base.html
index f46aa206..a7b3ebd7 100644
--- a/src/program/templates/schedule_base.html
+++ b/src/program/templates/schedule_base.html
@@ -73,7 +73,7 @@
-
+
ICS
diff --git a/src/program/templates/schedule_overview.html b/src/program/templates/schedule_overview.html
index 012f44f6..d5a587b7 100644
--- a/src/program/templates/schedule_overview.html
+++ b/src/program/templates/schedule_overview.html
@@ -14,6 +14,7 @@
init(
{ 'schedule_timeslot_length_minutes': Number('{{ schedule_timeslot_length_minutes }}')
, 'schedule_midnight_offset_hours': Number('{{ schedule_midnight_offset_hours }}')
+ , 'ics_button_href': "{% url 'ics_view' camp_slug=camp.slug %}"
}
);