From c73c063949f8a1f086a30e5b5866e13127ff7c94 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 19 May 2021 15:35:14 -0700 Subject: [PATCH] Show announcements on all pages --- bookwyrm/templates/layout.html | 30 +++++++++++++++++++++++++++-- bookwyrm/templates/search/book.html | 4 ++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 3a4fd6c85..6adab96a0 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -1,5 +1,4 @@ -{% load layout %} -{% load i18n %} +{% load layout %}{% load i18n %}{% load humanize %} @@ -182,6 +181,33 @@ +{% if active_announcements.exists %} +
+
+ {% for announcement in active_announcements %} +
+
+
+ {% if announcement.event_date %} + {{ announcement.event_date|naturalday|title }}: + {% endif %} + {{ announcement.preview }} +
+
+ {% 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" %} +
+
+ +
+ {% endfor %} +
+
+{% endif %}
diff --git a/bookwyrm/templates/search/book.html b/bookwyrm/templates/search/book.html index 08e1dad28..ce9072194 100644 --- a/bookwyrm/templates/search/book.html +++ b/bookwyrm/templates/search/book.html @@ -28,9 +28,9 @@
{% 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 %}
{% endif %}