Show announcements on all pages

This commit is contained in:
Mouse Reeve 2021-05-19 15:35:14 -07:00
parent 346d718265
commit c73c063949
2 changed files with 30 additions and 4 deletions

View file

@ -1,5 +1,4 @@
{% load layout %}
{% load i18n %}
{% load layout %}{% load i18n %}{% load humanize %}
<!DOCTYPE html>
<html lang="{% get_lang %}">
<head>
@ -182,6 +181,33 @@
</div>
</nav>
{% if active_announcements.exists %}
<div class="block is-flex-grow-1">
<div class="container">
{% for announcement in active_announcements %}
<div class="notification p-3">
<div class="columns mb-0">
<div class="column">
{% if announcement.event_date %}
<strong>{{ announcement.event_date|naturalday|title }}:</strong>
{% endif %}
{{ announcement.preview }}
</div>
<div class="column is-narrow">
{% trans "Open" as button_text %}
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="announcement" class="is-small" controls_uid=announcement.id icon_with_text="arrow-down" %}
{% trans "Close" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="announcement" class="is-small" controls_uid=announcement.id icon_with_text="arrow-up" %}
</div>
</div>
<div class="box is-shadowless m-0 is-hidden" id="announcement-{{ announcement.id }}">
{{ announcement.content|safe }}
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
<div class="section is-flex-grow-1">
<div class="container">

View file

@ -28,9 +28,9 @@
</div>
<div class="column is-narrow">
{% trans "Open" as button_text %}
{% include 'snippets/toggle/open_button.html' with text=button_text small=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-down" pressed=forloop.first %}
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-down" pressed=forloop.first %}
{% trans "Close" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text small=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-up" pressed=forloop.first %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-up" pressed=forloop.first %}
</div>
</header>
{% endif %}