list.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n %}
  3. {% block page-actions %}
  4. <div class="col-auto page-action">
  5. <a href="{% url 'misago:admin:users:warnings:new' %}" class="btn btn-primary">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New warning level" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th>{% trans "Warning level" %}</th>
  13. <th style="width: 20%">{% trans "Length" %}</th>
  14. <th style="width: 20%;">{% trans "Replying" %}</th>
  15. <th style="width: 20%;">{% trans "Starting threads" %}</th>
  16. {% for action in extra_actions %}
  17. <th style="width: 1%;">&nbsp;</th>
  18. {% endfor %}
  19. <th style="width: 1%;">&nbsp;</th>
  20. <th style="width: 1%;">&nbsp;</th>
  21. <th style="width: 1%;">&nbsp;</th>
  22. <th style="width: 1%;">&nbsp;</th>
  23. {% endblock table-header %}
  24. {% block table-row %}
  25. <td class="item-name">
  26. #{{ forloop.counter }} {{ item }}
  27. </td>
  28. <td>
  29. {% if item.length %}
  30. <abbr data-time-period="{{ item.length }}">
  31. {{ item.length }}
  32. </abbr>
  33. {% else %}
  34. {% trans "Permanent" %}
  35. {% endif %}
  36. </td>
  37. <td>
  38. {% if item.restricts_posting_replies == 0 %}
  39. <div class="text-success">
  40. <span class="fa fa-check-circle"></span>
  41. {% trans "Not restricted" %}
  42. </div>
  43. {% elif item.restricts_posting_replies == 1 %}
  44. <div class="text-warning">
  45. <span class="fa fa-exclamation-circle"></span>
  46. {% trans "Moderated" %}
  47. </div>
  48. {% else %}
  49. <div class="text-danger">
  50. <span class="fa fa-times-circle"></span>
  51. {% trans "Forbidden" %}
  52. </div>
  53. {% endif %}
  54. </td>
  55. <td>
  56. {% if item.restricts_posting_threads == 0 %}
  57. <div class="text-success">
  58. <span class="fa fa-check-circle"></span>
  59. {% trans "Not restricted" %}
  60. </div>
  61. {% elif item.restricts_posting_threads == 1 %}
  62. <div class="text-warning">
  63. <span class="fa fa-exclamation-circle"></span>
  64. {% trans "Moderated" %}
  65. </div>
  66. {% else %}
  67. <div class="text-danger">
  68. <span class="fa fa-times-circle"></span>
  69. {% trans "Forbidden" %}
  70. </div>
  71. {% endif %}
  72. </td>
  73. {% include "misago/admin/generic/list_extra_actions.html" %}
  74. <td>
  75. {% if not forloop.last %}
  76. <form action="{% url 'misago:admin:users:warnings:down' pk=item.pk %}" method="post">
  77. <button class="btn btn-light" data-tooltip="top" title="{% trans 'Move down' %}">
  78. {% csrf_token %}
  79. <span class="fa fa-chevron-down"></span>
  80. </button>
  81. </form>
  82. {% else %}
  83. &nbsp;
  84. {% endif %}
  85. </td>
  86. <td>
  87. {% if not forloop.first %}
  88. <form action="{% url 'misago:admin:users:warnings:up' pk=item.pk %}" method="post">
  89. <button class="btn btn-light" data-tooltip="top" title="{% trans 'Move up' %}">
  90. {% csrf_token %}
  91. <span class="fa fa-chevron-up"></span>
  92. </button>
  93. </form>
  94. {% else %}
  95. &nbsp;
  96. {% endif %}
  97. </td>
  98. <td>
  99. <a href="{% url 'misago:admin:users:warnings:edit' pk=item.pk %}" class="btn btn-primary" data-tooltip="top" title="{% trans 'Edit' %}">
  100. <span class="fa fa-pencil"></span>
  101. </a>
  102. </td>
  103. <td>
  104. <form action="{% url 'misago:admin:users:warnings:delete' pk=item.pk %}" method="post" class="delete-prompt">
  105. <button class="btn btn-danger" data-tooltip="top" title="{% trans 'Delete' %}">
  106. {% csrf_token %}
  107. <span class="fa fa-times"></span>
  108. </button>
  109. </form>
  110. </td>
  111. {% endblock %}
  112. {% block blankslate %}
  113. <td colspan="{{ 8|add:extra_actions_len }}">
  114. {% trans "No warning levels are set." %}
  115. </td>
  116. {% endblock blankslate %}
  117. {% block javascripts %}
  118. <script type="text/javascript">
  119. $(function() {
  120. $('.delete-prompt').submit(function() {
  121. var decision = confirm("{% trans "Are you sure you want to delete this warning level?" %}");
  122. return decision;
  123. });
  124. });
  125. </script>
  126. {% endblock %}