base_site.html 16 KB

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