Adds admin view for individual announcement

This commit is contained in:
Mouse Reeve
2021-05-20 08:09:35 -07:00
parent c73c063949
commit d64e0c4aa8
11 changed files with 92 additions and 32 deletions

View File

@ -0,0 +1,22 @@
{% load humanize %}{% load i18n %}{% load utilities %}
{% with announcement.id|uuid as uuid %}
<aside 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=uuid 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=uuid icon_with_text="arrow-up" %}
</div>
</div>
<div class="box is-shadowless m-0{% if not pressed %} is-hidden{% endif %}" id="announcement-{{ uuid }}">
{{ announcement.content|safe }}
</div>
</aside>
{% endwith %}

View File

@ -1,8 +1,8 @@
{% load i18n %}
{% load utilities %}
{% if book.authors %}
{% blocktrans with path=book.local_path title=book|title %}<a href="{{ path }}">{{ title }}</a> by {% endblocktrans %}{% include 'snippets/authors.html' with book=book %}
{% blocktrans with path=book.local_path title=book|book_title %}<a href="{{ path }}">{{ title }}</a> by {% endblocktrans %}{% include 'snippets/authors.html' with book=book %}
{% else %}
<a href="{{ book.local_path }}">{{ book|title }}</a>
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
{% endif %}

View File

@ -48,7 +48,7 @@
{% if status.book %}
{% if status.status_type == 'GeneratedNote' or status.status_type == 'Rating' %}
<a href="{{ status.book.local_path }}">{{ status.book|title }}</a>{% if status.status_type == 'Rating' %}: {% include 'snippets/stars.html' with rating=status.rating %}
<a href="{{ status.book.local_path }}">{{ status.book|book_title }}</a>{% if status.status_type == 'Rating' %}: {% include 'snippets/stars.html' with rating=status.rating %}
<span
itemprop="reviewRating"
itemscope
@ -59,7 +59,7 @@
{% if status.book %}
{% if status.status_type == 'GeneratedNote' or status.status_type == 'Rating' %}
<a href="{{ status.book.local_path }}">{{ status.book|title }}</a>{% if status.status_type == 'Rating' %}:
<a href="{{ status.book.local_path }}">{{ status.book|book_title }}</a>{% if status.status_type == 'Rating' %}:
<span
itemprop="reviewRating"
itemscope
@ -78,7 +78,7 @@
{% endif %}
{% elif status.mention_books %}
<a href="{{ status.mention_books.first.local_path }}">
{{ status.mention_books.first.title }}
{{ status.mention_books.first|book_title }}
</a>
{% endif %}
{% include 'snippets/stars.html' with rating=status.rating %}
@ -87,7 +87,7 @@
{% include 'snippets/book_titleby.html' with book=status.book %}
{% endif %}
{% elif status.mention_books %}
<a href="{{ status.mention_books.first.local_path }}">{{ status.mention_books.first|title }}</a>
<a href="{{ status.mention_books.first.local_path }}">{{ status.mention_books.first|book_title }}</a>
{% endif %}
</h3>