list.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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>
  29. {% if item.expires_on %}
  30. {% if item.is_expired %}
  31. <span class="text-muted tooltip-top" title="{% trans "This ban has expired." %}">
  32. {{ item.expires_on|date }}
  33. <span class="fa fa-exclamation text-danger"></span>
  34. </span>
  35. {% else %}
  36. <span class="tooltip-top" title="{{ item.expires_on|date:"DATETIME_FORMAT" }}">
  37. {{ item.formatted_expiration_date }}
  38. </span>
  39. {% endif %}
  40. {% else %}
  41. <em>{% trans "Never" %}</em>
  42. {% endif %}
  43. </td>
  44. {% for action in extra_actions %}
  45. <td class="row-action">
  46. <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 }}">
  47. <span class="{{ action.icon }}"></span>
  48. </a>
  49. </td>
  50. {% endfor %}
  51. <td class="row-action">
  52. <a href="{% url 'misago:admin:users:bans:edit' ban_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  53. <span class="fa fa-pencil"></span>
  54. </a>
  55. </td>
  56. <td class="row-action">
  57. <form action="{% url 'misago:admin:users:bans:delete' ban_id=item.id %}" method="post" class="delete-prompt">
  58. <button class="btn btn-danger tooltip-top" title="{% trans "Remove" %}">
  59. {% csrf_token %}
  60. <span class="fa fa-times"></span>
  61. </button>
  62. </form>
  63. </td>
  64. {% endblock %}
  65. {% block emptylist %}
  66. <td colspan="{{ 6|add:extra_actions_len }}">
  67. {% if active_filters %}
  68. <p>{% trans "No bans matching search criteria have been found" %}</p>
  69. {% else %}
  70. <p>{% trans "No bans are currently set." %}</p>
  71. {% endif %}
  72. </td>
  73. {% endblock emptylist %}
  74. {% block javascripts %}
  75. {{ block.super }}
  76. <script type="text/javascript">
  77. $(function() {
  78. $('.delete-prompt').submit(function() {
  79. var decision = confirm("{% trans "Are you sure you want to remove this ban?" %}");
  80. return decision;
  81. });
  82. });
  83. </script>
  84. {% endblock %}
  85. {% block modal-title %}
  86. {% trans "Search bans" %}
  87. {% endblock modal-title %}
  88. {% block modal-body %}
  89. <div class="row">
  90. <div class="col-md-6">
  91. {% form_row search_form.check_type %}
  92. </div>
  93. <div class="col-md-6">
  94. {% form_row search_form.value %}
  95. </div>
  96. </div>
  97. <div class="row">
  98. <div class="col-md-12">
  99. {% form_row search_form.state %}
  100. </div>
  101. </div>
  102. {% endblock modal-body %}