123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- {% extends "misago/admin/generic/base.html" %}
- {% load i18n %}
- {% block title %}
- {{ active_link.name }} | {{ block.super }}
- {% endblock title%}
- {% block view %}
- <div class="card card-admin-table shadow-sm">
- {% if paginator or order_by or search_form or mass_actions %}
- <div class="card-body">
- <div class="row align-items-center">
- {% if paginator %}
- {% include "misago/admin/generic/paginator.html" %}
- {% endif%}
- {% if order_by or search_form %}
- <div class="col">
- {% if order_by %}
- <div class="btn-group pull-left">
- <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">
- {% trans "Sort:" %} <span class="fa fa-sort-numeric-{{ order.type }}"></span> <strong>{{ order.name }}</strong>
- </button>
- <ul class="dropdown-menu" role="menu">
- <li class="dropdown-title">
- {% trans "Change sorting to:" %}
- </li>
- {% for order in order_by %}
- <li>
- <form method="get">
- <input type="hidden" name="sort" value="{{ order.order_by }}">
- <input type="hidden" name="direction" value="{{ order.type }}">
- {% for name, value in query_filters.items %}
- <input type="hidden" name="{{ name }}" value="{{ value }}">
- {% endfor %}
- <button type="submit">
- <span class="fa fa-sort-numeric-{{ order.type }}"></span>
- {{ order.name }}
- </button>
- </form>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
- {% if search_form %}
- <button class="btn btn-{% if active_filters %}success{% else %}light{% endif %} pull-left" data-toggle="modal" data-target="#filter-modal">
- {% if active_filters %}
- <span class="fa fa-check"></span>
- {% trans "Change search" %}
- {% else %}
- <span class="fa fa-search"></span>
- {% trans "Search list" %}
- {% endif %}
- </button>
- {% if active_filters %}
- <form method="get" class="pull-left">
- <input type="hidden" name="clear_filters" value="1">
- {% for name, value in query_order.items %}
- <input type="hidden" name="{{ name }}" value="{{ value }}">
- {% endfor %}
- <button type="submit" class="btn btn-light">
- <span class="fa fa-times"></span>
- {% trans "Remove search" %}
- </button>
- </form>
- {% endif %}
- {% endif %}
- </div>
- {% endif %}
- {% if mass_actions %}
- <div class="col-auto">
- <div class="btn-group pull-right">
- <form id="mass-action" action="{{ querystring }}" method="post">
- <button type="button" class="btn btn-light dropdown-toggle mass-controller" data-toggle="dropdown">
- <span class="fa fa-gears"></span>
- {% trans "With selected" %}
- </button>
- {% csrf_token %}
- <ul class="dropdown-menu" role="menu">
- {% for action in mass_actions %}
- <li>
- <button type="submit" name="action" value="{{ action.action }}" {% if action.confirmation %}data-confirmation="{{ action.confirmation }}"{% endif %}>
- <span class="{{ action.icon }}"></span>
- {{ action.name }}
- </button>
- </li>
- {% endfor %}
- </ul>
- </form>
- </div><!-- /.btn-group -->
- <button type="button" class="btn btn-light pull-right master-checkbox">
- <span class="fa fa-check"></span>
- </button>
- </div>
- {% endif %}
- </div>
- </div><!-- /.card-body -->
- {% endif %}
- <table class="table">
- <tr>
- {% block table-header %}{% endblock table-header %}
- {% if mass_actions %}
- <th class="width: 1%;"> </th>
- {% endif %}
- </tr>
- {% block table-items %}
- {% for item in items %}
- <tr>
- {% block table-row %}{% endblock table-row %}
- {% if mass_actions %}
- <td class="row-select">
- <label>
- <input type="checkbox" form="mass-action" name="selected_items" value="{{ item.pk }}" {% if item.pk in selected_items %} checked{% endif %}>
- </label>
- </td>
- {% endif %}
- </tr>
- {% empty %}
- <tr class="message-row">
- {% block emptylist %}{% endblock emptylist %}
- </tr>
- {% endfor %}
- {% endblock table-items %}
- </table>
- {% if paginator %}
- <div class="card-body">
- <div class="row align-items-center">
- {% include "misago/admin/generic/paginator.html" %}
- </div>
- </div>
- {% endif %}
- </div><!-- /.card -->
- {% endblock view %}
- {% block content %}
- {{ block.super }}
- {% if search_form %}
- <div class="modal fade" id="filter-modal" tabindex="-1" role="dialog" aria-labelledby="filter-modal-label" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title" id="filter-modal-label">
- {% block modal-title %}{% endblock modal-title %}
- </h4>
- </div>
- <form method="GET">
- <input type="hidden" name="set_filters" value="1">
- {% for name, value in query_order.items %}
- <input type="hidden" name="{{ name }}" value="{{ value }}">
- {% endfor %}
- <div class="modal-body">
- {% block modal-body %}{% endblock modal-body %}
- </div>
- <div class="modal-footer">
- {% block modal-footer %}
- <button type="button" class="btn btn-default" data-dismiss="modal">
- {% trans "Close" %}
- </button>
- <button type="submit" class="btn btn-primary">
- {% trans "Save changes" %}
- </button>
- {% endblock modal-footer %}
- </div>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- {% endblock content%}
- {% block javascripts %}
- {% if mass_actions %}
- <script type="text/javascript">
- $(function() {
- tableMassActions("{{ empty_selection_label }}", "{{ selection_label }}");
- });
- </script>
- {% endif %}
- {% endblock javascripts %}
|