123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- {% extends "misago/admin/generic/list.html" %}
- {% load i18n misago_admin_form misago_capture %}
- {% block page-actions %}
- <div class="col-auto page-action">
- <a href="{% url 'misago:admin:users:agreements:new' %}" class="btn btn-primary">
- <span class="fa fa-plus-circle"></span>
- {% trans "New agreement" %}
- </a>
- </div>
- {% endblock %}
- {% block table-header %}
- <th style="width: 1%;"> </th>
- <th>{% trans "Agreement" %}</th>
- <th style="width: 1%;"> </th>
- <th style="width: 180px;">{% trans "Type" %}</th>
- <th style="width: 250px;">{% trans "Created" %}</th>
- <th style="width: 250px;">{% trans "Modified" %}</th>
- <th style="width: 1%;"> </th>
- <th style="width: 1%;"> </th>
- <th style="width: 1%;"> </th>
- {% endblock table-header %}
- {% block table-row %}
- <td class="pr-0">
- {% if item.is_active %}
- <a href="{{ item.get_absolute_url }}" class="btn btn-light btn-sm">
- <span class="fas fa-external-link-alt"></span>
- </a>
- {% endif %}
- </td>
- <td class="pr-0 small">
- <a href="{% url 'misago:admin:users:agreements:edit' pk=item.pk %}" class="item-name">
- {{ item.get_final_title }}
- </a>
- </td>
- <td class="badges-list">
- {% if item.is_active %}
- <span class="badge badge-success">
- {% trans "Active" %}
- </span>
- {% endif %}
- </td>
- <td class="small">
- {{ item.get_type_display }}
- </td>
- <td class="small">
- {% capture trimmed as created_on %}
- <abbr data-timestamp="{{ item.created_on.isoformat }}" data-format="LL"></abbr>
- {% endcapture %}
- {% capture trimmed as created_by %}
- {% if item.created_by %}
- <a href="{{ item.created_by.get_absolute_url }}" class="item-title">{{ item.created_by }}</a>
- {% else %}
- <span class="item-title">{{ item.created_by_name }}</span>
- {% endif %}
- {% endcapture %}
- {% blocktrans trimmed with created_on=created_on|safe created_by=created_by|safe %}
- {{ created_on }} by {{ created_by }}
- {% endblocktrans %}
- </td>
- <td class="small">
- {% if item.last_modified_on %}
- {% capture trimmed as last_modified_on %}
- <abbr data-timestamp="{{ item.last_modified_on.isoformat }}" data-format="LL">
- {{ item.last_modified_on }}
- </abbr>
- {% endcapture %}
- {% capture trimmed as last_modified_by %}
- {% if item.last_modified_by %}
- <a href="{{ item.last_modified_by.get_absolute_url }}" class="item-title">{{ item.last_modified_by }}</a>
- {% else %}
- <span class="item-title">{{ item.last_modified_by }}</span>
- {% endif %}
- {% endcapture %}
- {% blocktrans trimmed with last_modified_on=last_modified_on|safe last_modified_by=last_modified_by|safe %}
- {{ last_modified_on }} by {{ last_modified_by }}
- {% endblocktrans %}
- {% else %}
- <em>{% trans "never" %}</em>
- {% endif %}
- </td>
- <td>
- {% if not item.is_active %}
- <form action="{% url 'misago:admin:users:agreements:set-as-active' pk=item.pk %}" method="post" class="set-as-active-prompt">
- <button class="btn btn-primary" data-tooltip="top" title="{% trans 'Set as active' %}">
- {% csrf_token %}
- <span class="fa fa-check-square"></span>
- </button>
- </form>
- {% else %}
-
- {% endif %}
- </td>
- <td>
- <a href="{% url 'misago:admin:users:agreements:edit' pk=item.pk %}" class="btn btn-light btn-sm">
- {% trans "Edit" %}
- </a>
- </td>
- <td>
- <form action="{% url 'misago:admin:users:agreements:delete' pk=item.pk %}" method="post" class="delete-prompt">
- {% csrf_token %}
- <button class="btn btn-light btn-sm">
- {% trans "Remove" %}
- </button>
- </form>
- </td>
- {% endblock %}
- {% block blankslate %}
- <td colspan="10">
- {% if active_filters %}
- {% trans "No agreements matching criteria exist." %}
- {% else %}
- {% trans "No agreements are set." %}
- {% endif %}
- </td>
- {% endblock blankslate %}
- {% block javascripts %}
- {{ block.super }}
- <script type="text/javascript">
- $(function() {
- $('.set-as-active-prompt').submit(function() {
- var decision = confirm("{% trans 'Are you sure you want to set this agreement as active for its type?' %}");
- return decision;
- });
- $('.delete-prompt').submit(function() {
- var decision = confirm("{% trans 'Are you sure you want to delete this agreement?' %}");
- return decision;
- });
- });
- </script>
- {% endblock %}
- {% block filters-modal-body %}
- <div class="row">
- <div class="col">
- {% form_row filter_form.type %}
- </div>
- </div>
- <div class="row">
- <div class="col">
- {% form_row filter_form.content %}
- </div>
- </div>
- {% endblock filters-modal-body %}
|