list.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. {% for action in extra_actions %}
  74. <td class="row-action">
  75. <a href="{% url action.link pk=item.pk %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %}" data-tooltip="top" title="{{ action.name }}">
  76. <span class="{{ action.icon }}"></span>
  77. </a>
  78. </td>
  79. {% endfor %}
  80. <td class="row-action">
  81. {% if not forloop.last %}
  82. <form action="{% url 'misago:admin:users:warnings:down' pk=item.pk %}" method="post">
  83. <button class="btn btn-default" data-tooltip="top" title="{% trans 'Move down' %}">
  84. {% csrf_token %}
  85. <span class="fa fa-chevron-down"></span>
  86. </button>
  87. </form>
  88. {% else %}
  89. &nbsp;
  90. {% endif %}
  91. </td>
  92. <td class="row-action">
  93. {% if not forloop.first %}
  94. <form action="{% url 'misago:admin:users:warnings:up' pk=item.pk %}" method="post">
  95. <button class="btn btn-default" data-tooltip="top" title="{% trans 'Move up' %}">
  96. {% csrf_token %}
  97. <span class="fa fa-chevron-up"></span>
  98. </button>
  99. </form>
  100. {% else %}
  101. &nbsp;
  102. {% endif %}
  103. </td>
  104. <td class="row-action">
  105. <a href="{% url 'misago:admin:users:warnings:edit' pk=item.pk %}" class="btn btn-primary" data-tooltip="top" title="{% trans 'Edit' %}">
  106. <span class="fa fa-pencil"></span>
  107. </a>
  108. </td>
  109. <td class="row-action">
  110. <form action="{% url 'misago:admin:users:warnings:delete' pk=item.pk %}" method="post" class="delete-prompt">
  111. <button class="btn btn-danger" data-tooltip="top" title="{% trans 'Delete' %}">
  112. {% csrf_token %}
  113. <span class="fa fa-times"></span>
  114. </button>
  115. </form>
  116. </td>
  117. {% endblock %}
  118. {% block emptylist %}
  119. <td colspan="{{ 8|add:extra_actions_len }}">
  120. <p>{% trans "No warning levels are currently defined." %}</p>
  121. </td>
  122. {% endblock emptylist %}
  123. {% block javascripts %}
  124. <script type="text/javascript">
  125. $(function() {
  126. $('.delete-prompt').submit(function() {
  127. var decision = confirm("{% trans "Are you sure you want to delete this warning level?" %}");
  128. return decision;
  129. });
  130. });
  131. </script>
  132. {% endblock %}