list.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n %}
  3. {% block page-actions %}
  4. <div class="page-actions">
  5. <a href="{% url 'misago:admin:users:ranks:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New rank" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th style="width: 25%;">{% trans "Rank" %}</th>
  13. <th>{% trans "Title" %}</th>
  14. <th style="width: 120px;">{% trans "Special" %}</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. <th style="width: 1%;">&nbsp;</th>
  21. <th style="width: 1%;">&nbsp;</th>
  22. <th style="width: 1%;">&nbsp;</th>
  23. <th style="width: 1%;">&nbsp;</th>
  24. {% endblock table-header %}
  25. {% block table-row %}
  26. <td class="item-name">
  27. {{ item }}
  28. </td>
  29. <td>
  30. {% if item.title %}
  31. {{ item.title }}
  32. {% else %}
  33. <i class="text-muted">{% trans "No title set" %}</i>
  34. {% endif %}
  35. </td>
  36. <td class="lead text-muted">
  37. {% if item.is_tab %}
  38. <div class="fa fa-list" data-tooltip="top" title="{% trans 'Has page on users list.' %}"></div>
  39. {% endif %}
  40. {% if item.is_default %}
  41. <div class="fa fa-star" data-tooltip="top" title="{% trans 'This is default rank assigned to new members.' %}"></div>
  42. {% endif %}
  43. </td>
  44. {% for action in extra_actions %}
  45. <td class="row-action">
  46. <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 }}">
  47. <span class="{{ action.icon }}"></span>
  48. </a>
  49. </td>
  50. {% endfor %}
  51. <td class="row-action">
  52. <a href="{% url 'misago:admin:users:ranks:users' pk=item.pk %}" class="btn btn-primary" data-tooltip="top" title="{% trans 'Users with rank' %}">
  53. <span class="fa fa-users"></span>
  54. </a>
  55. </td>
  56. <td class="row-action">
  57. {% if not item.is_default %}
  58. <form action="{% url 'misago:admin:users:ranks:default' pk=item.pk %}" method="post">
  59. <button class="btn btn-warning" data-tooltip="top" title="{% trans 'Make default' %}">
  60. {% csrf_token %}
  61. <span class="fa fa-star"></span>
  62. </button>
  63. </form>
  64. {% else %}
  65. &nbsp;
  66. {% endif %}
  67. </td>
  68. <td class="row-action">
  69. {% if not forloop.last %}
  70. <form action="{% url 'misago:admin:users:ranks:down' pk=item.pk %}" method="post">
  71. <button class="btn btn-default" data-tooltip="top" title="{% trans 'Move down' %}">
  72. {% csrf_token %}
  73. <span class="fa fa-chevron-down"></span>
  74. </button>
  75. </form>
  76. {% else %}
  77. &nbsp;
  78. {% endif %}
  79. </td>
  80. <td class="row-action">
  81. {% if not forloop.first %}
  82. <form action="{% url 'misago:admin:users:ranks:up' pk=item.pk %}" method="post">
  83. <button class="btn btn-default" data-tooltip="top" title="{% trans 'Move up' %}">
  84. {% csrf_token %}
  85. <span class="fa fa-chevron-up"></span>
  86. </button>
  87. </form>
  88. {% else %}
  89. &nbsp;
  90. {% endif %}
  91. </td>
  92. <td class="row-action">
  93. <a href="{% url 'misago:admin:users:ranks:edit' pk=item.pk %}" class="btn btn-primary" data-tooltip="top" title="{% trans 'Edit' %}">
  94. <span class="fa fa-pencil"></span>
  95. </a>
  96. </td>
  97. <td class="row-action">
  98. <form action="{% url 'misago:admin:users:ranks:delete' pk=item.pk %}" method="post" class="delete-prompt">
  99. <button class="btn btn-danger" data-tooltip="top" title="{% trans 'Delete' %}">
  100. {% csrf_token %}
  101. <span class="fa fa-times"></span>
  102. </button>
  103. </form>
  104. </td>
  105. {% endblock %}
  106. {% block emptylist %}
  107. <td colspan="{{ 8|add:extra_actions_len }}">
  108. <p>{% trans "No ranks are currently defined." %}</p>
  109. </td>
  110. {% endblock emptylist %}
  111. {% block javascripts %}
  112. <script type="text/javascript">
  113. $(function() {
  114. $('.delete-prompt').submit(function() {
  115. var decision = confirm("{% trans "Are you sure you want to delete this rank?" %}");
  116. return decision;
  117. });
  118. });
  119. </script>
  120. {% endblock %}