2021-09-08 21:05:08 +00:00
{% extends 'settings/layout.html' %}
2021-05-19 21:55:01 +00:00
{% load i18n %}{% load humanize %}
{% block title %}{% trans "Announcements" %}{% endblock %}
{% block header %}{% trans "Announcements" %}{% endblock %}
{% block edit-button %}
{% trans "Create Announcement" as button_text %}
2021-08-09 01:40:47 +00:00
{% include 'snippets/toggle/open_button.html' with controls_text="create_announcement" icon_with_text="plus" text=button_text focus="create_announcement_header" %}
2021-05-19 21:55:01 +00:00
{% endblock %}
{% block panel %}
2021-05-20 15:56:17 +00:00
< form name = "create-announcement" method = "post" action = "{% url 'settings-announcements' %}" class = "block" >
2021-08-09 01:40:47 +00:00
{% include 'settings/announcement_form.html' with controls_text="create_announcement" %}
2021-05-20 15:56:17 +00:00
< / form >
2021-05-19 21:55:01 +00:00
< table class = "table is-striped" >
< tr >
2021-05-20 16:43:29 +00:00
< th >
{% url 'settings-announcements' as url %}
{% trans "Date added" as text %}
{% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
< / th >
2021-05-19 21:55:01 +00:00
< th >
2021-05-19 22:17:32 +00:00
{% trans "Preview" as text %}
{% include 'snippets/table-sort-header.html' with field="preview" sort=sort text=text %}
2021-05-19 21:55:01 +00:00
< / 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 >
2021-05-20 16:43:29 +00:00
< td > {{ announcement.created_date|naturalday }}< / td >
2021-05-19 22:17:32 +00:00
< td > < a href = "{% url 'settings-announcements' announcement.id %}" > {{ announcement.preview }}< / a > < / td >
2021-05-19 21:55:01 +00:00
< 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 >
2021-05-20 15:09:35 +00:00
{% include 'snippets/pagination.html' with page=announcements path=request.path %}
2021-05-19 21:55:01 +00:00
{% endblock %}