2023-05-04 04:42:37 +00:00
|
|
|
{% extends "admin/base_main.html" %}
|
2023-01-13 22:54:21 +00:00
|
|
|
|
|
|
|
{% block subtitle %}Announcements{% endblock %}
|
|
|
|
|
2023-05-04 04:42:37 +00:00
|
|
|
{% block settings_content %}
|
2023-01-13 22:54:21 +00:00
|
|
|
<div class="view-options">
|
|
|
|
<a href="{% url "admin_announcement_create" %}" class="button"><i class="fa-solid fa-plus"></i> Create</a>
|
|
|
|
</div>
|
|
|
|
<table class="items">
|
|
|
|
{% for announcement in page_obj %}
|
|
|
|
<tr>
|
|
|
|
<td class="icon">
|
2023-06-14 17:15:29 +00:00
|
|
|
<a href="{{ announcement.urls.admin_edit }}?page={{ page_obj.number }}" class="overlay"></a>
|
2023-01-13 22:54:21 +00:00
|
|
|
<i class="fa-solid fa-bullhorn"></i>
|
|
|
|
</td>
|
|
|
|
<td class="name">
|
2023-06-14 17:15:29 +00:00
|
|
|
<a href="{{ announcement.urls.admin_edit }}?page={{ page_obj.number }}" class="overlay"></a>
|
2023-01-13 22:54:21 +00:00
|
|
|
{{ announcement.html|truncatewords_html:"10" }}
|
|
|
|
<small>
|
|
|
|
{% if announcement.service_announcement %}{{ domain.service_domain }}{% endif %}
|
|
|
|
</small>
|
2023-01-14 17:32:48 +00:00
|
|
|
</td>
|
2023-01-13 22:54:21 +00:00
|
|
|
<td class="stat">
|
|
|
|
{% if not announcement.published %}
|
|
|
|
Draft
|
|
|
|
{% elif not announcement.after_start %}
|
|
|
|
Awaiting Start
|
|
|
|
{% elif not announcement.before_end %}
|
|
|
|
Past End
|
|
|
|
{% else %}
|
|
|
|
Visible
|
|
|
|
{% endif %}
|
|
|
|
<small>State</small>
|
|
|
|
</td>
|
|
|
|
<td class="actions">
|
|
|
|
{% if not announcement.published %}
|
|
|
|
<a hx-post="{{ announcement.urls.admin_publish }}" title="Publish"><i class="fa-solid fa-bullhorn"></i></a>
|
|
|
|
{% else %}
|
|
|
|
<a hx-post="{{ announcement.urls.admin_unpublish }}" title="Unpublish"><i class="fa-solid fa-rotate-left"></i></a>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{{ announcement.urls.admin_delete }}" title="Delete" class="danger"><i class="fa-solid fa-trash"></i></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% empty %}
|
|
|
|
<tr class="empty"><td>You have no announcements.</td></tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% include "admin/_pagination.html" with nouns="announcement,announcements" %}
|
|
|
|
{% endblock %}
|