list.html 2.0 KB

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