base.html 18 KB

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