base.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. {% extends "admin/original_base.html" %}
  2. {% load i18n static jet_tags %}
  3. {% block extrastyle %}
  4. {{ block.super }}
  5. {% get_current_jet_version as JET_VERSION %}
  6. <link rel="stylesheet" type="text/css" href="{% static "jet/css/vendor.css" %}?v={{ JET_VERSION }}" />
  7. <link rel="stylesheet" type="text/css" href="{% static "jet/css/icons/style.css" %}?v={{ JET_VERSION }}" />
  8. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/default/base.css" %}?v={{ JET_VERSION }}" />
  9. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/default/jquery-ui.theme.css" %}?v={{ JET_VERSION }}" />
  10. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/default/select2.theme.css" %}?v={{ JET_VERSION }}" />
  11. {% endblock %}
  12. {% block extrahead %}
  13. {{ block.super }}
  14. <script type="text/javascript" charset="utf-8">
  15. var DATE_FORMAT = "{% get_date_format %}";
  16. var TIME_FORMAT = "{% get_time_format %}";
  17. var DATETIME_FORMAT = "{% get_datetime_format %}";
  18. </script>
  19. <script src="{% static "jet/js/build/bundle.min.js" %}"></script>
  20. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
  21. {% endblock %}
  22. {% block footer %}
  23. {{ block.super }}
  24. {% jet_delete_confirmation_context %}
  25. {% jet_change_form_sibling_links_enabled as show_siblings %}
  26. {% if change and show_siblings %}
  27. <div class="changeform-navigation">
  28. {% spaceless %}
  29. {% jet_previous_object_url as url %}
  30. <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button left{% if not url %} disabled{% endif %}">
  31. <span class="changeform-navigation-button icon-arrow-left"></span>
  32. </a>
  33. {% jet_next_object_url as url %}
  34. <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button right{% if not url %} disabled{% endif %}">
  35. <span class="changeform-navigation-button icon-arrow-right"></span>
  36. </a>
  37. {% endspaceless %}
  38. </div>
  39. {% endif %}
  40. {% get_side_menu_compact as SIDE_MENU_COMPACT %}
  41. {% if not is_popup %}
  42. <div class="related-popup-container scrollable">
  43. <a href="#" class="related-popup-back"><span class="related-popup-back-icon icon-arrow-left"></span> <span class="related-popup-back-label">{% trans "back" %}</span></a>
  44. <span class="icon-refresh loading-indicator"></span>
  45. </div>
  46. <div class="sidebar-header sidebar-dependent">
  47. <a href="#" class="sidebar-header-menu sidebar-toggle">
  48. <span class="sidebar-header-menu-icon icon-menu"></span>
  49. </a>
  50. </div>
  51. <div class="sidebar sidebar-dependent">
  52. <div class="sidebar-wrapper scrollable">
  53. <a href="#" class="sidebar-close sidebar-toggle">
  54. <span class="sidebar-close-icon icon-arrow-left"></span>
  55. </a>
  56. <div class="sidebar-section">
  57. {% if user.is_active and user.is_staff %}
  58. <div>
  59. <a href="{% url 'admin:index' %}" class="sidebar-link icon">
  60. <span class="sidebar-link-icon icon-data"></span>
  61. <span class="sidebar-link-label">{% trans 'Home' %}</span>
  62. </a>
  63. </div>
  64. {% endif %}
  65. {% if site_url %}
  66. <div>
  67. <a href="{{ site_url }}" class="sidebar-link icon">
  68. <span class="sidebar-link-icon icon-open-external"></span>
  69. <span class="sidebar-link-label">{% trans 'View site' %}</span>
  70. </a>
  71. </div>
  72. {% endif %}
  73. {% url 'django-admindocs-docroot' as docsroot %}
  74. {% if docsroot %}
  75. <div>
  76. <a href="{{ docsroot }}" class="sidebar-link icon">
  77. <span class="sidebar-link-icon icon-book"></span>
  78. <span class="sidebar-link-label">{% trans 'Documentation' %}</span>
  79. </a>
  80. </div>
  81. {% endif %}
  82. {% block nav-global %}{% endblock %}
  83. </div>
  84. {% if user.is_active and user.is_staff %}
  85. {% get_menu as app_list %}
  86. {% if app_list.apps or app_list.pinned_apps %}
  87. {% if SIDE_MENU_COMPACT %}
  88. {% for app in app_list.all_apps %}
  89. <div class="sidebar-section">
  90. <div class="sidebar-title">
  91. <a href="{{ app.app_url }}" class="sidebar-title-link">
  92. {% if app.name != app.app_label|capfirst|escape %}
  93. {{ app.name }}
  94. {% else %}
  95. {% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}
  96. {% endif %}
  97. </a>
  98. </div>
  99. {% for model in app.models %}
  100. {% if model.admin_url %}
  101. <div>
  102. <a href="{{ model.admin_url }}" class="sidebar-link">
  103. <span class="sidebar-right">
  104. <span class="sidebar-right-arrow icon-arrow-right"></span>
  105. </span>
  106. {{ model.name }}
  107. </a>
  108. </div>
  109. {% endif %}
  110. {% endfor %}
  111. </div>
  112. {% endfor %}
  113. {% else %}
  114. <form action="{% url "jet:toggle_application_pin" %}" method="POST" id="toggle-application-pin-form">
  115. {% csrf_token %}
  116. <input type="hidden" name="app_label">
  117. </form>
  118. <div class="sidebar-section">
  119. <div class="sidebar-title">
  120. <span class="sidebar-right">
  121. <a href="#" class="sidebar-right-edit edit-apps-list"><span class="icon-settings"></span></a>
  122. </span>
  123. {% trans 'Applications' %}
  124. </div>
  125. <div class="apps-list-pinned">
  126. {% for app in app_list.pinned_apps %}
  127. <a href="{{ app.app_url }}" class="sidebar-link popup-section-link app-item" data-app-label="{{ app.app_label }}" data-popup-section-class="sidebar-popup-section-{{ app.app_label }}">
  128. <span class="sidebar-left collapsible">
  129. <span class="sidebar-left-pin icon-star pin-toggle"></span>
  130. <span class="sidebar-left-unpin icon-cross pin-toggle"></span>
  131. </span>
  132. <span class="sidebar-right">
  133. <span class="sidebar-right-arrow icon-arrow-right"></span>
  134. </span>
  135. <span class="sidebar-link-label">
  136. {% if app.name != app.app_label|capfirst|escape %}
  137. {{ app.name }}
  138. {% else %}
  139. {% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}
  140. {% endif %}
  141. </span>
  142. </a>
  143. {% endfor %}
  144. </div>
  145. <a href="#" class="sidebar-center-link apps-hide">
  146. <span class="apps-hide-label apps-visible">{% trans "Hide applications" %}</span>
  147. <span class="apps-hide-label apps-hidden">{% trans "Show hidden" %}</span>
  148. </a>
  149. <div class="apps-list">
  150. {% for app in app_list.apps %}
  151. <a href="{{ app.app_url }}" class="sidebar-link popup-section-link app-item" data-app-label="{{ app.app_label }}" data-popup-section-class="sidebar-popup-section-{{ app.app_label }}">
  152. <span class="sidebar-left collapsible">
  153. <span class="sidebar-left-pin icon-star pin-toggle"></span>
  154. <span class="sidebar-left-unpin icon-cross pin-toggle"></span>
  155. </span>
  156. <span class="sidebar-right">
  157. <span class="sidebar-right-arrow icon-arrow-right"></span>
  158. </span>
  159. <span class="sidebar-link-label">
  160. {% if app.name != app.app_label|capfirst|escape %}
  161. {{ app.name }}
  162. {% else %}
  163. {% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}
  164. {% endif %}
  165. </span>
  166. </a>
  167. {% endfor %}
  168. </div>
  169. </div>
  170. {% endif %}
  171. {% endif %}
  172. <div class="sidebar-section">
  173. <div class="dialog-confirm" id="bookmarks-add-dialog" title="{% trans "Add bookmark" %}">
  174. <form action="{% url "jet:add_bookmark" %}" method="POST" id="bookmarks-add-form">
  175. {% csrf_token %}
  176. <p>{% trans "Title" %}:</p>
  177. <input type="text" name="title" class="fill_width">
  178. <p>{% trans "URL" %}:</p>
  179. <input type="text" name="url" class="fill_width">
  180. </form>
  181. </div>
  182. <form action="{% url "jet:remove_bookmark" %}" method="POST" id="bookmarks-remove-form">
  183. {% csrf_token %}
  184. <input type="hidden" name="id">
  185. </form>
  186. <div class="dialog-confirm" id="bookmarks-remove-dialog" title="{% trans "Delete bookmark" %}">
  187. <p>{% trans "Are you sure want to delete this bookmark?" %}</p>
  188. </div>
  189. <div class="sidebar-title">
  190. <span class="sidebar-right">
  191. <a href="#" class="sidebar-right-plus bookmarks-add" title="{% trans "Add bookmark" %}"{% if title %} data-title="{{ title }}"{% endif %}><span class="icon-add"></span></a>
  192. </span>
  193. {% trans 'bookmarks' %}
  194. </div>
  195. <div class="bookmarks-list">
  196. {% get_bookmarks user as bookmarks %}
  197. {% for bookmark in bookmarks %}
  198. <a href="{{ bookmark.url }}" class="sidebar-link bookmark-item">
  199. <span class="sidebar-right collapsible">
  200. <span class="sidebar-right-remove bookmarks-remove" data-bookmark-id="{{ bookmark.pk }}">{% trans "Remove" %}</span>
  201. </span>
  202. {{ bookmark.title }}
  203. </a>
  204. {% endfor %}
  205. <a class="sidebar-link bookmark-item clone">
  206. <span class="sidebar-right collapsible">
  207. <span class="sidebar-right-remove bookmarks-remove">{% trans "Remove" %}</span>
  208. </span>
  209. </a>
  210. </div>
  211. </div>
  212. {% endif %}
  213. </div>
  214. <div class="sidebar-copyright">powered by DJANGO JET</div>
  215. {% if app_list and not SIDE_MENU_COMPACT %}
  216. <div class="sidebar-popup-container">
  217. <div class="sidebar-popup">
  218. <a href="#" class="sidebar-close popup sidebar-back">
  219. <span class="sidebar-close-icon icon-arrow-left"></span>
  220. </a>
  221. {% for app in app_list.apps|add:app_list.pinned_apps %}
  222. <div class="sidebar-popup-section sidebar-popup-section-{{ app.app_label }}">
  223. <div class="sidebar-popup-title">
  224. {% if app.name != app.app_label|capfirst|escape %}
  225. {{ app.name }}
  226. {% else %}
  227. {% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}
  228. {% endif %}
  229. </div>
  230. <input class="sidebar-popup-search" placeholder="Search...">
  231. <ul class="sidebar-popup-list">
  232. <li class="sidebar-popup-list-item app-{{ app.app_label }}{{ app.current|yesno:" current," }}">
  233. <a href="{{ app.app_url }}" class="sidebar-popup-list-item-link">{% trans 'Application page' %}</a>
  234. </li>
  235. {% for model in app.models %}
  236. <li class="sidebar-popup-list-item model-{{ model.object_name|lower }}{{ model.current|yesno:" current," }}">
  237. {% if model.admin_url %}
  238. <a href="{{ model.admin_url }}" class="sidebar-popup-list-item-link">{{ model.name }}</a>
  239. {% else %}
  240. {{ model.name }}
  241. {% endif %}
  242. </li>
  243. {% endfor %}
  244. </ul>
  245. </div>
  246. {% endfor %}
  247. </div>
  248. </div>
  249. {% endif %}
  250. </div>
  251. {% endif %}
  252. {% endblock %}