list.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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:permissions:users:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New role" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th>{% trans "Role" %}</th>
  13. {% for action in extra_actions %}
  14. <th style="width: 1%;">&nbsp;</th>
  15. {% endfor %}
  16. <th style="width: 1%;">&nbsp;</th>
  17. <th style="width: 1%;">&nbsp;</th>
  18. <th style="width: 1%;">&nbsp;</th>
  19. {% endblock table-header %}
  20. {% block table-row %}
  21. <td class="item-name">
  22. {{ item }}
  23. </td>
  24. {% for action in extra_actions %}
  25. <td class="row-action">
  26. <a href="{% url action.link role_id=item.id %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %} tooltip-top" title="{{ action.name }}">
  27. <span class="{{ action.icon }}"></span>
  28. </a>
  29. </td>
  30. {% endfor %}
  31. <td class="row-action">
  32. <a href="{% url 'misago:admin:permissions:users:users' role_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Users with role" %}">
  33. <span class="fa fa-users"></span>
  34. </a>
  35. </td>
  36. <td class="row-action">
  37. <a href="{% url 'misago:admin:permissions:users:edit' role_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  38. <span class="fa fa-pencil"></span>
  39. </a>
  40. </td>
  41. <td class="row-action">
  42. <form action="{% url 'misago:admin:permissions:users:delete' role_id=item.id %}" method="post" class="delete-prompt">
  43. <button class="btn btn-danger tooltip-top" title="{% trans "Delete" %}">
  44. {% csrf_token %}
  45. <span class="fa fa-times"></span>
  46. </button>
  47. </form>
  48. </td>
  49. {% endblock %}
  50. {% block emptylist %}
  51. <td colspan="{{ 4|add:extra_actions_len }}">
  52. <p>{% trans "No user roles are currently defined." %}</p>
  53. </td>
  54. {% endblock emptylist %}
  55. {% block javascripts %}
  56. <script type="text/javascript">
  57. $(function() {
  58. $('.delete-prompt').submit(function() {
  59. var decision = confirm("{% trans "Are you sure you want to delete this role?" %}");
  60. return decision;
  61. });
  62. });
  63. </script>
  64. {% endblock %}