list.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n misago_forms %}
  3. {% block page-actions %}
  4. <div class="page-actions">
  5. <a href="{% url 'misago:admin:users:bans:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New ban" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th style="width: 25%;">{% trans "Ban" %}</th>
  13. <th style="width: 160px;">{% trans "Type" %}</th>
  14. <th>{% trans "Expires on" %}</th>
  15. {% for action in extra_actions %}
  16. <th style="width: 1%;">&nbsp;</th>
  17. {% endfor %}
  18. <th style="width: 1%;">&nbsp;</th>
  19. <th style="width: 1%;">&nbsp;</th>
  20. {% endblock table-header %}
  21. {% block table-row %}
  22. <td class="item-name">
  23. {{ item.banned_value }}
  24. </td>
  25. <td>
  26. {{ item.test_name }}
  27. </td>
  28. <td{% if item.is_expired %} class="text-muted"{% endif %}>
  29. {% if item.expires_on %}
  30. <abbr class="moment" data-iso="{{ item.expires_on.isoformat }}" data-format="lll"></abbr>
  31. {% else %}
  32. <em>{% trans "Never" %}</em>
  33. {% endif %}
  34. </td>
  35. {% for action in extra_actions %}
  36. <td class="row-action">
  37. <a href="{% url action.link ban_id=item.id %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %} tooltip-top" title="{{ action.name }}">
  38. <span class="{{ action.icon }}"></span>
  39. </a>
  40. </td>
  41. {% endfor %}
  42. <td class="row-action">
  43. <a href="{% url 'misago:admin:users:bans:edit' ban_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  44. <span class="fa fa-pencil"></span>
  45. </a>
  46. </td>
  47. <td class="row-action">
  48. <form action="{% url 'misago:admin:users:bans:delete' ban_id=item.id %}" method="post" class="delete-prompt">
  49. <button class="btn btn-danger tooltip-top" title="{% trans "Remove" %}">
  50. {% csrf_token %}
  51. <span class="fa fa-times"></span>
  52. </button>
  53. </form>
  54. </td>
  55. {% endblock %}
  56. {% block emptylist %}
  57. <td colspan="{{ 6|add:extra_actions_len }}">
  58. {% if active_filters %}
  59. <p>{% trans "No bans matching search criteria have been found" %}</p>
  60. {% else %}
  61. <p>{% trans "No bans are currently set." %}</p>
  62. {% endif %}
  63. </td>
  64. {% endblock emptylist %}
  65. {% block javascripts %}
  66. {{ block.super }}
  67. <script type="text/javascript">
  68. $(function() {
  69. $('.delete-prompt').submit(function() {
  70. var decision = confirm("{% trans "Are you sure you want to remove this ban?" %}");
  71. return decision;
  72. });
  73. });
  74. </script>
  75. {% endblock %}
  76. {% block modal-title %}
  77. {% trans "Search bans" %}
  78. {% endblock modal-title %}
  79. {% block modal-body %}
  80. <div class="row">
  81. <div class="col-md-6">
  82. {% form_row search_form.check_type %}
  83. </div>
  84. <div class="col-md-6">
  85. {% form_row search_form.value %}
  86. </div>
  87. </div>
  88. <div class="row">
  89. <div class="col-md-12">
  90. {% form_row search_form.state %}
  91. </div>
  92. </div>
  93. {% endblock modal-body %}