Skip to content

Commit

Permalink
event_index: Add buttons to switch event sources
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Mar 26, 2021
1 parent 8f7dbff commit 816cf35
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions mpicms/templates/events/event_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ <h2 class="title is-2">{{ page.title }}</h2>

<div id="calendar"></div>
<br>
<a href="https://it.molgen.mpg.de/cgi-bin/ics/subscription?cal=molgen&subscribe=1" class="button cal-button">{% trans 'Subscribe' %}</a>

<div class="fc-toolbar">
<div class="fc-left">
<a href="https://it.molgen.mpg.de/cgi-bin/ics/subscription?cal=molgen&subscribe=1" class="button cal-button">{% trans 'Subscribe' %}</a>
</div>
<div class="fc-center">
</div>
<div class="fc-right">
<a id="switch_external" class="button" style="background-color: silver; color: black">external events</a>
<a id="switch_internal" class="button" style="background-color: #006c66; color: white">events @MPIMG</a>
</div>
</div>
</div>

{% autoescape off %}
Expand All @@ -32,6 +41,15 @@ <h2 class="title is-2">{{ page.title }}</h2>
}
});

document.getElementById('switch_external').addEventListener("click", function() {
calendar.getEventSources()[0].remove()
calendar.addEventSource(event_source_external)
});
document.getElementById('switch_internal').addEventListener("click", function() {
calendar.getEventSources()[0].remove()
calendar.addEventSource(event_source_internal)
});

calendar.render();
});

Expand Down

0 comments on commit 816cf35

Please sign in to comment.