base.html 21 KB

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