base.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. {% load i18n static jet_tags %}<!DOCTYPE html>
  2. {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
  3. {% jet_get_current_theme as THEME %}
  4. {% jet_get_current_version as JET_VERSION %}
  5. {% block html %}<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
  6. <head>
  7. <title>{% block title %}{% endblock %}</title>
  8. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
  10. <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
  11. <link rel="stylesheet" type="text/css" href="{% static "jet/css/vendor.css" as url %}{{ url|jet_append_version }}" />
  12. <link rel="stylesheet" type="text/css" href="{% static "jet/css/icons/style.css" as url %}{{ url|jet_append_version }}" />
  13. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/"|add:THEME|add:"/base.css" as url %}{{ url|jet_append_version }}" class="base-stylesheet" />
  14. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/"|add:THEME|add:"/select2.theme.css" as url %}{{ url|jet_append_version }}" class="select2-stylesheet" />
  15. <link rel="stylesheet" type="text/css" href="{% static "jet/css/themes/"|add:THEME|add:"/jquery-ui.theme.css" as url %}{{ url|jet_append_version }}" class="jquery-ui-stylesheet" />
  16. {% block extrastyle %}{% endblock %}
  17. {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
  18. {% jet_get_date_format as date_format %}
  19. {% jet_get_time_format as time_format %}
  20. {% jet_get_datetime_format as datetime_format %}
  21. <script type="text/javascript" charset="utf-8">
  22. var DATE_FORMAT = "{{ date_format }}";
  23. var TIME_FORMAT = "{{ time_format }}";
  24. var DATETIME_FORMAT = "{{ datetime_format }}";
  25. </script>
  26. <script type="text/javascript" src="{% url 'jet:jsi18n' %}"></script>
  27. <script src="{% static "jet/js/build/bundle.min.js" as url %}{{ url|jet_append_version }}"></script>
  28. {% jet_static_translation_urls as translation_urls %}
  29. {% for url in translation_urls %}
  30. <script src="{% static url as url %}{{ url|jet_append_version }}"></script>
  31. {% endfor %}
  32. {% block extrahead %}{% endblock %}
  33. {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
  34. </head>
  35. {% load i18n %}
  36. <body class="{% if request.COOKIES.sidebar_pinned != 'false' %}menu-pinned {% endif %}{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
  37. data-admin-utc-offset="{% now "Z" %}">
  38. <!-- Container -->
  39. <div id="container">
  40. {% if not is_popup %}
  41. <!-- Header -->
  42. <div id="header">
  43. <div id="branding">
  44. <span id="branding-menu" class="sidebar-header-menu-icon icon-menu sidebar-toggle"></span>
  45. <span id="branding-pin" class="sidebar-link-icon icon-pin sidebar-pin"></span>
  46. {% block branding %}{% endblock %}
  47. </div>
  48. {% block usertools %}
  49. {% if user.is_active and user.is_staff or has_permission %}
  50. <div id="user-tools">
  51. {% block welcome-msg %}
  52. {% trans 'Welcome,' %}
  53. <strong>{% firstof user.get_short_name user.get_username %}</strong>.
  54. {% endblock %}
  55. {% block userlinks %}
  56. {% if site_url %}
  57. <a href="{{ site_url }}">{% trans 'View site' %}</a> /
  58. {% endif %}
  59. {% if user.is_active and user.is_staff %}
  60. {% url 'django-admindocs-docroot' as docsroot %}
  61. {% if docsroot %}
  62. <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
  63. {% endif %}
  64. {% endif %}
  65. {% if user.has_usable_password %}
  66. <a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
  67. {% endif %}
  68. <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
  69. {% endblock %}
  70. </div>
  71. {% endif %}
  72. {% endblock %}
  73. </div>
  74. <!-- END Header -->
  75. {% block breadcrumbs %}
  76. <div class="breadcrumbs">
  77. <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
  78. {% if title %} &rsaquo; {{ title }}{% endif %}
  79. </div>
  80. {% endblock %}
  81. {% endif %}
  82. {% block messages %}
  83. {% if messages %}
  84. <ul class="messagelist">{% for message in messages %}
  85. <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
  86. {% endfor %}</ul>
  87. {% endif %}
  88. {% endblock messages %}
  89. <!-- Content -->
  90. <div id="content" class="{% block coltype %}colM{% endblock %}">
  91. {% block pretitle %}{% endblock %}
  92. {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
  93. {% block content %}
  94. {% block object-tools %}{% endblock %}
  95. {{ content }}
  96. {% endblock %}
  97. {% block sidebar %}{% endblock %}
  98. <br class="clear" />
  99. </div>
  100. <!-- END Content -->
  101. {% block footer %}<div id="footer"></div>{% endblock %}
  102. {% jet_delete_confirmation_context as delete_confirmation_context %}
  103. {{ delete_confirmation_context }}
  104. {% jet_change_form_sibling_links_enabled as show_siblings %}
  105. {% if change and show_siblings %}
  106. <div class="changeform-navigation">
  107. {% spaceless %}
  108. {% jet_previous_object as sibling %}
  109. <a{% if sibling.url %} href="{{ sibling.url }}"{% endif %} class="changeform-navigation-button segmented-button left{% if not sibling %} disabled{% endif %}" title="{{ sibling.label }}">
  110. <span class="changeform-navigation-button-icon left icon-arrow-left"></span>
  111. <span class="changeform-navigation-button-label">
  112. {% if sibling %}
  113. {{ sibling.label }}
  114. {% else %}
  115. ---
  116. {% endif %}
  117. </span>
  118. </a>
  119. {% jet_next_object as sibling %}
  120. <a{% if sibling.url %} href="{{ sibling.url }}"{% endif %} class="changeform-navigation-button segmented-button right{% if not sibling %} disabled{% endif %}" title="{{ sibling.label }}">
  121. <span class="changeform-navigation-button-icon right icon-arrow-right"></span>
  122. <span class="changeform-navigation-button-label">
  123. {% if sibling %}
  124. {{ sibling.label }}
  125. {% else %}
  126. ---
  127. {% endif %}
  128. </span>
  129. </a>
  130. {% endspaceless %}
  131. </div>
  132. {% endif %}
  133. {% jet_get_side_menu_compact as SIDE_MENU_COMPACT %}
  134. {% if not is_popup %}
  135. <div class="related-popup-container scrollable">
  136. <a href="#" class="related-popup-back">
  137. <span class="related-popup-back-icon icon-arrow-left"></span>
  138. <span class="related-popup-back-label">{% trans "back" %}</span>
  139. </a>
  140. <span class="icon-refresh loading-indicator"></span>
  141. </div>
  142. <div class="sidebar-header-wrapper sidebar-dependent">
  143. <div class="sidebar-header sidebar-dependent">
  144. <a href="#" class="sidebar-header-menu sidebar-toggle">
  145. <span class="sidebar-header-menu-icon icon-menu"></span>
  146. <span class="sidebar-header-menu-icon icon-cross"></span>
  147. </a>
  148. </div>
  149. </div>
  150. <div class="sidebar sidebar-dependent">
  151. <div class="sidebar-wrapper scrollable">
  152. <div class="sidebar-section">
  153. {% if user.is_active and user.is_staff %}
  154. <a href="{% url 'admin:index' %}" class="sidebar-link icon">
  155. <span class="sidebar-link-label">
  156. <span class="sidebar-link-icon icon-data"></span>
  157. {% trans 'Home' %}
  158. </span>
  159. </a>
  160. {% endif %}
  161. {% if site_url %}
  162. <a href="{{ site_url }}" class="sidebar-link icon">
  163. <span class="sidebar-link-label">
  164. <span class="sidebar-link-icon icon-open-external"></span>
  165. {% trans 'View site' %}
  166. </span>
  167. </a>
  168. {% endif %}
  169. {% url 'django-admindocs-docroot' as docsroot %}
  170. {% if docsroot %}
  171. <a href="{{ docsroot }}" class="sidebar-link icon">
  172. <span class="sidebar-link-label">
  173. <span class="sidebar-link-icon icon-book"></span>
  174. {% trans 'Documentation' %}
  175. </span>
  176. </a>
  177. {% endif %}
  178. {% block nav-global %}{% endblock %}
  179. </div>
  180. {% if user.is_active and user.is_staff %}
  181. {% jet_get_menu as app_list %}
  182. {% if SIDE_MENU_COMPACT %}
  183. {% for app in app_list %}
  184. {% if app.has_perms %}
  185. <div class="sidebar-section">
  186. <div class="sidebar-title">
  187. <a{% if app.url %} href="{{ app.url }}"{% endif %} class="sidebar-title-link"{% if app.url_blank %} target="_blank"{% endif %}>
  188. {{ app.label }}
  189. </a>
  190. </div>
  191. {% for model in app.items %}
  192. {% if model.has_perms %}
  193. <div>
  194. <a{% if model.url %} href="{{ model.url }}"{% endif %} class="sidebar-link"{% if model.url_blank %} target="_blank"{% endif %}>
  195. <span class="sidebar-right">
  196. <span class="sidebar-right-arrow icon-arrow-right"></span>
  197. </span>
  198. <span class="sidebar-link-label">{{ model.label }}</span>
  199. </a>
  200. </div>
  201. {% endif %}
  202. {% endfor %}
  203. </div>
  204. {% endif %}
  205. {% endfor %}
  206. {% else %}
  207. <form action="{% url "jet:toggle_application_pin" %}" method="POST" id="toggle-application-pin-form">
  208. {% csrf_token %}
  209. <input type="hidden" name="app_label">
  210. </form>
  211. <div class="sidebar-section">
  212. <div class="sidebar-title">
  213. <span class="sidebar-right">
  214. <a href="#" class="sidebar-right-edit edit-apps-list"><span class="icon-settings"></span></a>
  215. </span>
  216. {% trans 'Applications' %}
  217. </div>
  218. <div class="apps-list-pinned">
  219. {% for app in app_list %}
  220. {% if app.has_perms and app.pinned %}
  221. <a{% if app.url %} href="{{ app.url }}"{% endif %} class="sidebar-link popup-section-link app-item" data-app-label="{{ app.app_label }}" data-popup-section-class="sidebar-popup-section-{{ app.app_label }}" data-order="{{ forloop.counter }}"{% if app.url_blank %} target="_blank"{% endif %}>
  222. <span class="sidebar-left collapsible">
  223. <span class="sidebar-left-pin icon-star pin-toggle"></span>
  224. <span class="sidebar-left-unpin icon-cross pin-toggle"></span>
  225. </span>
  226. <span class="sidebar-right">
  227. <span class="sidebar-right-arrow icon-arrow-right"></span>
  228. </span>
  229. <span class="sidebar-link-label">
  230. {{ app.label }}
  231. </span>
  232. </a>
  233. {% endif %}
  234. {% endfor %}
  235. </div>
  236. <a href="#" class="sidebar-center-link apps-hide">
  237. <span class="apps-hide-label apps-visible">{% trans "Hide applications" %}</span>
  238. <span class="apps-hide-label apps-hidden">{% trans "Show hidden" %}</span>
  239. </a>
  240. <div class="apps-list">
  241. {% for app in app_list %}
  242. {% if app.has_perms and not app.pinned %}
  243. <a{% if app.url %} href="{{ app.url }}"{% endif %} class="sidebar-link popup-section-link app-item" data-app-label="{{ app.app_label }}" data-popup-section-class="sidebar-popup-section-{{ app.app_label }}" data-order="{{ forloop.counter }}"{% if app.url_blank %} target="_blank"{% endif %}>
  244. <span class="sidebar-left collapsible">
  245. <span class="sidebar-left-pin icon-star pin-toggle"></span>
  246. <span class="sidebar-left-unpin icon-cross pin-toggle"></span>
  247. </span>
  248. <span class="sidebar-right">
  249. <span class="sidebar-right-arrow icon-arrow-right"></span>
  250. </span>
  251. <span class="sidebar-link-label">
  252. {{ app.label }}
  253. </span>
  254. </a>
  255. {% endif %}
  256. {% endfor %}
  257. </div>
  258. </div>
  259. {% endif %}
  260. <div class="sidebar-section last">
  261. <div class="dialog-confirm" id="bookmarks-add-dialog" title="{% trans "Add bookmark" %}">
  262. <form action="{% url "jet:add_bookmark" %}" method="POST" id="bookmarks-add-form">
  263. {% csrf_token %}
  264. <p>{% trans "Title" %}:</p>
  265. <input type="text" name="title" class="fill_width">
  266. <p>{% trans "URL" %}:</p>
  267. <input type="text" name="url" class="fill_width">
  268. </form>
  269. </div>
  270. <form action="{% url "jet:remove_bookmark" %}" method="POST" id="bookmarks-remove-form">
  271. {% csrf_token %}
  272. <input type="hidden" name="id">
  273. </form>
  274. <div class="dialog-confirm" id="bookmarks-remove-dialog" title="{% trans "Delete bookmark" %}">
  275. <p>{% trans "Are you sure want to delete this bookmark?" %}</p>
  276. </div>
  277. <div class="sidebar-title">
  278. <span class="sidebar-right">
  279. <a href="#" class="sidebar-right-plus bookmarks-add" title="{% trans "Add bookmark" %}"{% if title %} data-title="{{ title }}"{% endif %}><span class="icon-add"></span></a>
  280. </span>
  281. {% trans 'bookmarks' %}
  282. </div>
  283. <div class="bookmarks-list">
  284. {% jet_get_bookmarks user as bookmarks %}
  285. {% for bookmark in bookmarks %}
  286. <a href="{{ bookmark.url }}" class="sidebar-link bookmark-item">
  287. <span class="sidebar-right collapsible">
  288. <span class="sidebar-right-remove bookmarks-remove" data-bookmark-id="{{ bookmark.pk }}">{% trans "Remove" %}</span>
  289. </span>
  290. <span class="sidebar-link-label">{{ bookmark.title }}</span>
  291. </a>
  292. {% endfor %}
  293. <a class="sidebar-link bookmark-item clone">
  294. <span class="sidebar-right collapsible">
  295. <span class="sidebar-right-remove bookmarks-remove">{% trans "Remove" %}</span>
  296. </span>
  297. <span class="sidebar-link-label"></span>
  298. </a>
  299. </div>
  300. </div>
  301. {% endif %}
  302. </div>
  303. {% if app_list and not SIDE_MENU_COMPACT %}
  304. <div class="sidebar-popup-container">
  305. <div class="sidebar-popup scrollable">
  306. <a href="#" class="sidebar-close sidebar-back">
  307. <span class="sidebar-close-icon icon-arrow-left"></span>
  308. </a>
  309. {% for app in app_list %}
  310. {% if app.has_perms %}
  311. <div class="sidebar-popup-section sidebar-popup-section-{{ app.app_label }}">
  312. <div class="sidebar-popup-title">
  313. {{ app.label }}
  314. </div>
  315. <input class="sidebar-popup-search" placeholder="{% trans "Search" %}...">
  316. <ul class="sidebar-popup-list">
  317. {% if app.url %}
  318. <li class="sidebar-popup-list-item app-{{ app.app_label }}{{ app.current|yesno:" current," }}">
  319. <a href="{{ app.url }}" class="sidebar-popup-list-item-link">{% trans 'Application page' %}</a>
  320. </li>
  321. {% endif %}
  322. {% for model in app.items %}
  323. {% if model.has_perms %}
  324. <li class="sidebar-popup-list-item{% if model.name %} model-{{ model.name }}{% endif %}{{ model.current|yesno:" current," }}">
  325. <a{% if model.url %} href="{{ model.url }}"{% endif %} class="sidebar-popup-list-item-link"{% if model.url_blank %} target="_blank"{% endif %}>
  326. {{ model.label }}
  327. </a>
  328. </li>
  329. {% endif %}
  330. {% endfor %}
  331. </ul>
  332. </div>
  333. {% endif %}
  334. {% endfor %}
  335. </div>
  336. </div>
  337. {% endif %}
  338. </div>
  339. {% endif %}
  340. {% jet_get_themes as THEMES %}
  341. {% if THEMES %}
  342. <li class="user-tools-contrast-block theme-chooser">
  343. <div class="user-tools-contrast-block-title">{% trans "current theme" %}</div>
  344. <div class="user-tools-theme-link-container">
  345. {% spaceless %}
  346. {% for conf_theme in THEMES %}
  347. {% if conf_theme.theme %}
  348. <a href="#"
  349. class="user-tools-theme-link choose-theme{% if conf_theme.theme == THEME %} selected{% endif %}"
  350. data-theme="{{ conf_theme.theme }}"
  351. data-base-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/base.css" %}?v={{ JET_VERSION }}"
  352. data-select2-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/select2.theme.css" %}?v={{ JET_VERSION }}"
  353. data-jquery-ui-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/jquery-ui.theme.css" %}?v={{ JET_VERSION }}"
  354. {% if conf_theme.title %} title="{{ conf_theme.title }}"{% endif %}
  355. style="background-color: {{ conf_theme.color|default:"white" }};"
  356. ></a>
  357. {% endif %}
  358. {% endfor %}
  359. {% endspaceless %}
  360. </div>
  361. </li>
  362. {% endif %}
  363. </div>
  364. <!-- END Container -->
  365. </body>
  366. </html>{% endblock %}