base.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. {% load i18n admin_static jet_tags %}
  2. {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}{% format_current_language LANGUAGE_CODE as LANGUAGE_CODE %}{% get_themes as THEMES %}{% get_current_theme as THEME %}{% get_current_jet_version as JET_VERSION %}{% get_side_menu_compact as SIDE_MENU_COMPACT %}
  3. {% block html %}<!DOCTYPE html>
  4. <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
  5. <head>
  6. <title>{% block title %}{% endblock %}</title>
  7. <meta name="copyright" content="geex-arts.com">
  8. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  9. {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
  10. <link href="{% static "jet/vendor/select2/css/select2.min.css" %}" rel="stylesheet" />
  11. <link href="{% static "jet/vendor/jquery-ui/jquery-ui.min.css" %}" rel="stylesheet" />
  12. <link href="{% static "jet/vendor/jquery-ui-timepicker/jquery.ui.timepicker.css" %}" rel="stylesheet" />
  13. <link href="{% static "jet/vendor/perfect-scrollbar/css/perfect-scrollbar.css" %}" rel="stylesheet" />
  14. <link href="{% static "jet/css/icons/style.css" %}?v={{ JET_VERSION }}" rel="stylesheet" />
  15. <link href="{% static "jet/css/themes/"|add:THEME|add:"/base.css" %}?v={{ JET_VERSION }}" rel="stylesheet" class="base-stylesheet" />
  16. <link href="{% static "jet/css/themes/"|add:THEME|add:"/select2.theme.css" %}?v={{ JET_VERSION }}" rel="stylesheet" class="select2-stylesheet" />
  17. <link href="{% static "jet/css/themes/"|add:THEME|add:"/jquery-ui.theme.css" %}?v={{ JET_VERSION }}" rel="stylesheet" class="jquery-ui-stylesheet" />
  18. <!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
  19. {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
  20. {% block extrastyle %}{% endblock %}
  21. <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
  22. <script type="text/javascript">window.__admin_utc_offset__ = "{% filter escapejs %}{% now "Z" %}{% endfilter %}";</script>
  23. <script type="text/javascript" charset="utf-8">
  24. var DATE_FORMAT = "{% get_date_format %}";
  25. var TIME_FORMAT = "{% get_time_format %}";
  26. var DATETIME_FORMAT = "{% get_datetime_format %}";
  27. </script>
  28. <script type="text/javascript" src="{% url 'jet:jsi18n' %}"></script>
  29. <script src="{% static "jet/vendor/jquery/jquery-1.11.3.min.js" %}"></script>
  30. <script src="{% static "jet/vendor/jquery-ui/jquery-ui.min.js" %}"></script>
  31. <script src="{% static "jet/vendor/jquery-ui-timepicker/jquery.ui.timepicker.js" %}"></script>
  32. <script src="{% static "jet/vendor/select2/js/select2.full.min.js" %}"></script>
  33. <script src="{% static "jet/vendor/perfect-scrollbar/js/perfect-scrollbar.min.js" %}"></script>
  34. <script src="{% static "jet/vendor/perfect-scrollbar/js/perfect-scrollbar.jquery.min.js" %}"></script>
  35. <script src="{% static "jet/vendor/jquery-cookie/jquery.cookie-1.4.1.min.js" %}"></script>
  36. {% if LANGUAGE_CODE|slice:":2" != 'en' %}
  37. {% with "jet/vendor/jquery-ui/i18n/datepicker-"|add:LANGUAGE_CODE|add:".js" as url %}
  38. <script src="{% static url %}"></script>
  39. {% endwith %}
  40. {% with "jet/vendor/jquery-ui-timepicker/i18n/jquery.ui.timepicker-"|add:LANGUAGE_CODE|add:".js" as url %}
  41. <script src="{% static url %}"></script>
  42. {% endwith %}
  43. {% with "jet/vendor/select2/js/i18n/"|add:LANGUAGE_CODE|add:".js" as url %}
  44. <script src="{% static url %}"></script>
  45. {% endwith %}
  46. {% endif %}
  47. <script type="text/javascript" charset="utf-8">
  48. var jet = jet || {};
  49. jet.jQuery = jQuery.noConflict(true);
  50. </script>
  51. <script src="{% static "jet/js/main.min.js" %}?v={{ JET_VERSION }}"></script>
  52. <script src="{% static "jet/js/select2.jet.min.js" %}?v={{ JET_VERSION }}"></script>
  53. {% block extrahead %}{% endblock %}
  54. </head>
  55. <body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
  56. {% block body %}
  57. {% if not is_popup %}
  58. <div id="container" class="container">
  59. {% endif %}
  60. <div class="content">
  61. {% if not is_popup %}
  62. {% block header %}
  63. <div id="header" class="top">
  64. <div class="top-right">
  65. {% block top-right %}{% endblock %}
  66. {% block usertools %}
  67. {% if user.is_active and user.is_staff %}
  68. <ul class="top-user-tools" id="user-tools">
  69. <li class="top-user-tools-welcome-msg">
  70. <span class="top-user-tools-welcome-msg-arrow icon-arrow-down"></span>
  71. {% block welcome-msg %}
  72. {% firstof user.get_short_name user.get_username %}
  73. {% endblock %}
  74. </li>
  75. {% if THEMES %}
  76. <li class="top-user-tools-contrast-block">
  77. <div class="top-user-tools-contrast-block-title">{% trans "current theme" %}</div>
  78. <div class="top-user-tools-theme-link-container cf">
  79. {% for conf_theme in THEMES %}
  80. {% if conf_theme.theme %}
  81. <a href="#"
  82. class="top-user-tools-theme-link choose-theme{% if conf_theme.theme == THEME %} selected{% endif %}"
  83. data-theme="{{ conf_theme.theme }}"
  84. data-base-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/base.css" %}?v={{ JET_VERSION }}"
  85. data-select2-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/select2.theme.css" %}?v={{ JET_VERSION }}"
  86. data-jquery-ui-stylesheet="{% static "jet/css/themes/"|add:conf_theme.theme|add:"/jquery-ui.theme.css" %}?v={{ JET_VERSION }}"
  87. {% if conf_theme.title %} title="{{ conf_theme.title }}"{% endif %}
  88. style="background-color: {{ conf_theme.color|default:'white' }};"
  89. ></a>
  90. {% endif %}
  91. {% endfor %}
  92. </div>
  93. </li>
  94. {% endif %}
  95. {% block userlinks %}
  96. {% if user.has_usable_password %}
  97. <li class="top-user-tools-user-link">
  98. <span class="top-user-tools-user-link-icon icon-key"></span> <a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a>
  99. </li>
  100. {% endif %}
  101. <li class="top-user-tools-user-link">
  102. <span class="top-user-tools-user-link-icon icon-exit"></span> <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
  103. </li>
  104. {% endblock %}
  105. </ul>
  106. {% endif %}
  107. {% endblock %}
  108. </div>
  109. <div class="top-breadcrumbs">
  110. {% format_breadcrumbs %}
  111. {% block breadcrumbs %}
  112. <div class="breadcrumbs">
  113. <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
  114. {% if title %} &rsaquo; {{ title }}{% endif %}
  115. </div>
  116. {% endblock %}
  117. {% endformat_breadcrumbs %}
  118. </div>
  119. </div>
  120. {% endblock %}
  121. {% endif %}
  122. {% block messages %}
  123. {% if messages %}
  124. <ul class="messagelist">
  125. {% for message in messages %}
  126. <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
  127. {% endfor %}
  128. </ul>
  129. {% endif %}
  130. {% endblock messages %}
  131. <div class="content-sidebar">
  132. {% block sidebar %}{% endblock %}
  133. </div>
  134. <div id="content" class="cf {% block coltype %}colM{% endblock %}">
  135. {% block pretitle %}{% endblock %}
  136. {% if is_popup %}
  137. {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
  138. {% endif %}
  139. {% block content %}
  140. {% block object-tools %}{% endblock %}
  141. {{ content }}
  142. {% endblock %}
  143. </div>
  144. {% block footer %}<div id="footer"></div>{% endblock %}
  145. </div>
  146. {% if not is_popup %}
  147. <div class="related-popup-container">
  148. <a href="#" class="related-popup-back"><span class="icon-arrow-left"></span> {% trans "back" %}</a>
  149. <span class="icon-refresh loading-indicator"></span>
  150. </div>
  151. <div class="sidebar">
  152. <div class="sidebar-menu-wrapper">
  153. <div id="branding">
  154. {% block branding %}{% endblock %}
  155. </div>
  156. <ul class="sidebar-menu">
  157. <li class="sidebar-menu-item no-horizontal-padding">
  158. <ul class="sidebar-menu-item-list compact">
  159. {% if user.is_active and user.is_staff %}
  160. <li class="sidebar-menu-item-list-item">
  161. <a href="{% url 'admin:index' %}" class="sidebar-menu-item-list-item-link">
  162. <span class="sidebar-menu-item-list-item-icon icon-data"></span> {% trans 'Home' %}
  163. </a>
  164. </li>
  165. {% endif %}
  166. {% if site_url %}
  167. <li class="sidebar-menu-item-list-item">
  168. <a href="{{ site_url }}" class="sidebar-menu-item-list-item-link">
  169. <span class="sidebar-menu-item-list-item-icon icon-open-external"></span> {% trans 'View site' %}
  170. </a>
  171. </li>
  172. {% endif %}
  173. {% url 'django-admindocs-docroot' as docsroot %}
  174. {% if docsroot %}
  175. <li class="sidebar-menu-item-list-item">
  176. <a href="{{ docsroot }}" class="sidebar-menu-item-list-item-link">
  177. <span class="sidebar-menu-item-list-item-icon icon-book"></span> {% trans 'Documentation' %}
  178. </a>
  179. </li>
  180. {% endif %}
  181. {% block nav-global %}{% endblock %}
  182. </ul>
  183. </li>
  184. {% if user.is_active and user.is_staff %}
  185. {% get_menu as app_list %}
  186. {% if app_list.apps or app_list.pinned_apps %}
  187. <form action="{% url "jet:toggle_application_pin" %}" method="POST" id="toggle-application-pin-form">
  188. {% csrf_token %}
  189. <input type="hidden" name="app_label">
  190. </form>
  191. {% if SIDE_MENU_COMPACT %}
  192. {% for app in app_list.all_apps %}
  193. <li class="sidebar-menu-item no-horizontal-padding">
  194. <a href="{{ app.app_url }}" class="sidebar-menu-item-link">
  195. {% if app.name != app.app_label|capfirst|escape %}{{ app.name }}{% else %}{% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}{% endif %}
  196. </a>
  197. <ul class="sidebar-menu-item-list">
  198. {% for model in app.models %}
  199. <li class="sidebar-menu-item-list-item">
  200. {% if model.admin_url %}
  201. <a href="{{ model.admin_url }}" class="sidebar-menu-item-list-item-link">{{ model.name }}</a>
  202. {% else %}
  203. {{ model.name }}
  204. {% endif %}
  205. </li>
  206. {% endfor %}
  207. </ul>
  208. </li>
  209. {% endfor %}
  210. {% else %}
  211. <li class="sidebar-menu-item no-horizontal-padding">
  212. <span class="sidebar-menu-item-title">{% trans 'Applications' %}</span>
  213. <ul class="sidebar-menu-item-list apps-list-pinned">
  214. {% for app in app_list.pinned_apps %}
  215. <li class="sidebar-menu-item-list-item app-item pinned app-{{ app.app_label }}" data-app-label="{{ app.app_label }}">
  216. <a href="{{ app.app_url }}" class="sidebar-menu-item-list-item-link popup-item-link" data-popup-item-id="sidebar-popup-item-{{ app.app_label }}">
  217. <span class="sidebar-menu-item-list-item-arrow icon-arrow-right"></span>
  218. <span class="sidebar-menu-item-list-item-link-pin icon-star pin-toggle"></span>
  219. <span class="sidebar-menu-item-list-item-link-unpin icon-cross pin-toggle"></span>
  220. {% if app.name != app.app_label|capfirst|escape %}{{ app.name }}{% else %}{% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}{% endif %}
  221. </a>
  222. </li>
  223. {% endfor %}
  224. </ul>
  225. <a href="#" class="sidebar-menu-item-action apps-hide"></a>
  226. <ul class="sidebar-menu-item-list apps-list">
  227. {% for app in app_list.apps %}
  228. <li class="sidebar-menu-item-list-item app-item app-{{ app.app_label }}" data-app-label="{{ app.app_label }}">
  229. <a href="{{ app.app_url }}" class="sidebar-menu-item-list-item-link popup-item-link" data-popup-item-id="sidebar-popup-item-{{ app.app_label }}">
  230. <span class="sidebar-menu-item-list-item-arrow icon-arrow-right"></span>
  231. <span class="sidebar-menu-item-list-item-link-pin icon-star pin-toggle"></span>
  232. <span class="sidebar-menu-item-list-item-link-unpin icon-cross pin-toggle"></span>
  233. {% if app.name != app.app_label|capfirst|escape %}{{ app.name }}{% else %}{% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}{% endif %}
  234. </a>
  235. </li>
  236. {% endfor %}
  237. </ul>
  238. </li>
  239. {% endif %}
  240. {% endif %}
  241. <li class="sidebar-menu-item no-horizontal-padding">
  242. <div class="dialog-confirm" id="bookmarks-add-dialog" title="{% trans "Add bookmark" %}">
  243. <form action="{% url "jet:add_bookmark" %}" method="POST" id="bookmarks-add-form">
  244. {% csrf_token %}
  245. <p>{% trans "Title" %}:</p>
  246. <input type="text" name="title" class="fill_width">
  247. <p>{% trans "URL" %}:</p>
  248. <input type="text" name="url" class="fill_width">
  249. </form>
  250. </div>
  251. <form action="{% url "jet:remove_bookmark" %}" method="POST" id="bookmarks-remove-form">
  252. {% csrf_token %}
  253. <input type="hidden" name="id">
  254. </form>
  255. <div class="dialog-confirm" id="bookmarks-remove-dialog" title="{% trans "Delete bookmark" %}">
  256. <p>{% trans "Are you sure want to delete this bookmark?" %}</p>
  257. </div>
  258. <span class="sidebar-menu-item-title">
  259. <a href="#" class="sidebar-menu-item-title-icon bookmarks-add" title="{% trans "Add bookmark" %}"{% if title %} data-title="{{ title }}"{% endif %}><span class="icon-add"></span></a>
  260. {% trans 'bookmarks' %}
  261. </span>
  262. <ul class="sidebar-menu-item-list bookmarks-list">
  263. {% get_bookmarks user as bookmarks %}
  264. {% for bookmark in bookmarks %}
  265. <li class="sidebar-menu-item-list-item">
  266. <a href="{{ bookmark.url }}" class="sidebar-menu-item-list-item-link">
  267. <span class="sidebar-menu-item-list-item-link-remove bookmarks-remove" data-bookmark-id="{{ bookmark.pk }}">{% trans "Remove" %}</span>
  268. {{ bookmark.title }}
  269. </a>
  270. </li>
  271. {% endfor %}
  272. <li class="sidebar-menu-item-list-item empty">
  273. <a href="" class="sidebar-menu-item-list-item-link">
  274. <span class="sidebar-menu-item-list-item-link-remove bookmarks-remove">{% trans "Remove" %}</span>
  275. </a>
  276. </li>
  277. </ul>
  278. </li>
  279. {% endif %}
  280. </ul>
  281. </div>
  282. <div class="sidebar-copyright">powered by DJANGO JET</div>
  283. </div>
  284. {% if not SIDE_MENU_COMPACT %}
  285. {% if app_list %}
  286. <div class="sidebar-popup-container">
  287. <div class="sidebar-popup">
  288. {% for app in app_list.apps|add:app_list.pinned_apps %}
  289. <div class="sidebar-popup-item" id="sidebar-popup-item-{{ app.app_label }}">
  290. <div class="sidebar-popup-title">
  291. {% if app.name != app.app_label|capfirst|escape %}{{ app.name }}{% else %}{% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}{% endif %}
  292. </div>
  293. <input class="sidebar-popup-search" placeholder="Search...">
  294. <ul class="sidebar-popup-list">
  295. <li class="sidebar-popup-list-item app-{{ app.app_label }}{{ app.current|yesno:" current," }}">
  296. <a href="{{ app.app_url }}" class="sidebar-popup-list-item-link">{% trans 'Application page' %}</a>
  297. </li>
  298. {% for model in app.models %}
  299. <li class="sidebar-popup-list-item model-{{ model.object_name|lower }}{{ model.current|yesno:" current," }}">
  300. {% if model.admin_url %}
  301. <a href="{{ model.admin_url }}" class="sidebar-popup-list-item-link">{{ model.name }}</a>
  302. {% else %}
  303. {{ model.name }}
  304. {% endif %}
  305. </li>
  306. {% endfor %}
  307. </ul>
  308. </div>
  309. {% endfor %}
  310. </div>
  311. </div>
  312. {% endif %}
  313. {% endif %}
  314. </div>
  315. {% endif %}
  316. {% endblock %}
  317. </body>
  318. </html>{% endblock %}