list.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. {% endblock table-header %}
  19. {% block table-row %}
  20. <td class="lead">
  21. {{ item.name }}
  22. </td>
  23. {% for action in extra_actions %}
  24. <td class="row-action">
  25. <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 }}">
  26. <span class="{{ action.icon }}"></span>
  27. </a>
  28. </td>
  29. {% endfor %}
  30. <td class="row-action">
  31. <a href="{% url 'misago:admin:permissions:users:edit' role_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  32. <span class="fa fa-pencil"></span>
  33. </a>
  34. </td>
  35. <td class="row-action">
  36. <form action="{% url 'misago:admin:permissions:users:delete' role_id=item.id %}" method="post" class="delete-prompt">
  37. <button class="btn btn-danger tooltip-top" title="{% trans "Delete" %}">
  38. {% csrf_token %}
  39. <span class="fa fa-times"></span>
  40. </button>
  41. </form>
  42. </td>
  43. {% endblock %}
  44. {% block emptylist %}
  45. <td colspan="{{ 3|add:extra_actions_len }}">
  46. <p>{% trans "No user roles are currently defined." %}</p>
  47. </td>
  48. {% endblock emptylist %}
  49. {% block javascripts %}
  50. <script type="text/javascript">
  51. $(function() {
  52. $('.delete-prompt').submit(function() {
  53. var decision = confirm("{% trans "Are you sure you want to delete this role?" %}");
  54. return decision;
  55. });
  56. });
  57. </script>
  58. {% endblock %}