base.html 21 KB

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