list.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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:appearance:themes:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New theme" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th>{% trans "Theme" %}</th>
  13. <th>&nbsp;</th>
  14. <th>&nbsp;</th>
  15. <th>&nbsp;</th>
  16. <th>&nbsp;</th>
  17. <th>&nbsp;</th>
  18. <th>&nbsp;</th>
  19. <th>&nbsp;</th>
  20. {% endblock table-header %}
  21. {% block table-row %}
  22. <td class="item-name">
  23. {% for i in item.level_range %}
  24. &nbsp;&nbsp;&nbsp;&nbsp;
  25. {% endfor %}
  26. {{ item }}
  27. {% if item.version %}
  28. <span class="text-muted">
  29. {{ item.version }}
  30. </span>
  31. {% endif %}
  32. </td>
  33. <td class="item-name">
  34. {% if item.is_active %}
  35. <span class="label label-success pull-right" style="margin: 0px;">
  36. {% trans "Active" %}
  37. </span>
  38. {% else %}
  39. &nbsp;
  40. {% endif %}
  41. </td>
  42. <td class="row-action">
  43. {% if not item.is_default %}
  44. <a href="{% url 'misago:admin:appearance:themes:assets' pk=item.pk %}" class="btn btn-primary tooltip-top" title="{% trans "Assets (CSS, images and fonts)" %}">
  45. <span class="fa fa-pencil-square-o"></span>
  46. </a>
  47. {% else %}
  48. <button class="btn" type="button" disabled>
  49. <span class="fa fa-pencil-square-o"></span>
  50. </button>
  51. {% endif %}
  52. </td>
  53. <td class="row-action">
  54. {% if not item.is_default %}
  55. <a href="{% url 'misago:admin:appearance:themes:edit' pk=item.pk %}" class="btn btn-primary tooltip-top" title="{% trans "Edit information" %}">
  56. <span class="fa fa-pencil"></span>
  57. </a>
  58. {% else %}
  59. <button class="btn" type="button" disabled>
  60. <span class="fa fa-pencil"></span>
  61. </button>
  62. {% endif %}
  63. </td>
  64. <td class="row-action">
  65. <a href="{% url 'misago:admin:appearance:themes:new' %}?parent={{ item.pk }}" class="btn btn-primary tooltip-top" title="{% trans "Create child theme" %}">
  66. <span class="fa fa-file-o"></span>
  67. </a>
  68. </td>
  69. <td class="row-action">
  70. <a href="{% url 'misago:admin:appearance:themes:edit' pk=item.pk %}" class="btn btn-primary tooltip-top" title="{% trans "Copy" %}">
  71. <span class="fa fa-copy"></span>
  72. </a>
  73. </td>
  74. <td class="row-action">
  75. {% if not item.is_active %}
  76. <form action="{% url 'misago:admin:appearance:themes:activate' pk=item.pk %}" method="post">
  77. <button class="btn btn-default tooltip-top" title="{% trans "Activate" %}">
  78. {% csrf_token %}
  79. <span class="fa fa-check-square"></span>
  80. </button>
  81. </form>
  82. {% else %}
  83. <button class="btn" type="button" disabled>
  84. <span class="fa fa-check-square"></span>
  85. </button>
  86. {% endif %}
  87. </td>
  88. <td class="row-action">
  89. {% if not item.is_active and not item.is_default %}
  90. <form action="{% url 'misago:admin:appearance:themes:delete' pk=item.pk %}" method="POST" class="delete-prompt">
  91. {% csrf_token %}
  92. <button class="btn btn-danger tooltip-top" title="{% trans "Delete" %}">
  93. <span class="fa fa-times"></span>
  94. </button>
  95. </form>
  96. {% else %}
  97. <button class="btn" type="button" disabled>
  98. <span class="fa fa-times"></span>
  99. </button>
  100. {% endif %}
  101. </td>
  102. {% endblock %}
  103. {% block javascripts %}
  104. {{ block.super }}
  105. <script type="text/javascript">
  106. $(function() {
  107. $('.delete-prompt').submit(function() {
  108. var decision = confirm("{% trans 'Are you sure you want to delete this theme? Deleting theme will also delete its child themes.' %}");
  109. return decision;
  110. });
  111. });
  112. </script>
  113. {% endblock %}