Create announcements admin view
This commit is contained in:
parent
d1f2d9812f
commit
515d5bb237
7 changed files with 186 additions and 0 deletions
49
bookwyrm/templates/settings/announcements.html
Normal file
49
bookwyrm/templates/settings/announcements.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
{% extends 'settings/admin_layout.html' %}
|
||||
{% load i18n %}{% load humanize %}
|
||||
{% block title %}{% trans "Announcements" %}{% endblock %}
|
||||
|
||||
{% block header %}{% trans "Announcements" %}{% endblock %}
|
||||
|
||||
{% block edit-button %}
|
||||
{% trans "Create Announcement" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with controls_text="create-announcement" icon_with_text="plus" text=button_text focus="create-announcement-header" %}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="block">
|
||||
{% include 'settings/announcement_form.html' with controls_text="create-announcement" %}
|
||||
</div>
|
||||
|
||||
<table class="table is-striped">
|
||||
<tr>
|
||||
{% url 'settings-announcements' as url %}
|
||||
<th>
|
||||
{% trans "Name" as text %}
|
||||
{% include 'snippets/table-sort-header.html' with field="name" sort=sort text=text %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans "Start date" as text %}
|
||||
{% include 'snippets/table-sort-header.html' with field="start_date" sort=sort text=text %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans "End date" as text %}
|
||||
{% include 'snippets/table-sort-header.html' with field="end_date" sort=sort text=text %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans "Status" as text %}
|
||||
{% include 'snippets/table-sort-header.html' with field="active" sort=sort text=text %}
|
||||
</th>
|
||||
</tr>
|
||||
{% for announcement in announcements %}
|
||||
<tr>
|
||||
<td><a href="{% url 'settings-announcements' announcement.id %}">{{ announcement.name }}</a></td>
|
||||
<td>{{ announcement.start_date|naturaltime|default:'' }}</td>
|
||||
<td>{{ announcement.end_date|naturaltime|default:'' }}</td>
|
||||
<td>{% if announcement.active %}{% trans "active" %}{% else %}{% trans "inactive" %}{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% include 'snippets/pagination.html' with page=servers path=request.path %}
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue