Skip to content

Commit

Permalink
event_index: Make button label translatable
Browse files Browse the repository at this point in the history
Make the label of the button with toggles display of extern events
translatable. Put the two translated strings into template variables,
because one of it is used multiple times in the template.
  • Loading branch information
donald committed Apr 21, 2021
1 parent f7b03b7 commit 13cc582
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mpicms/templates/events/event_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{% load event_tags i18n %}

{% block content %}
{% translate "hide external events" as txt_hide_external_events %}
{% translate "show external events" as txt_show_external_events %}
<div class="section">

<h2 class="title is-2">{{ page.title }}</h2>
Expand All @@ -15,7 +17,7 @@ <h2 class="title is-2">{{ page.title }}</h2>
<div class="fc-center">
</div>
<div class="fc-right">
<a id="switch_external" class="button">hide external events</a>
<a id="switch_external" class="button">{{ txt_hide_external_events }}</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -46,11 +48,11 @@ <h2 class="title is-2">{{ page.title }}</h2>
if (externalEventsShown) {
calendar.getEventSources()[1].remove()
externalEventsShown = 0
this.innerHTML="show external events"
this.innerHTML="{{ txt_show_external_events }}"
} else {
calendar.addEventSource(event_source_external)
externalEventsShown = 1
this.innerHTML="hide external events"
this.innerHTML="{{ txt_hide_external_events }}"
}
});

Expand Down

0 comments on commit 13cc582

Please sign in to comment.