base_site.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {% extends "admin/base.html" %}
  2. {% load mezzanine_tags i18n staticfiles %}
  3. {% block title %}{{ title }} | Mezzanine{% endblock %}
  4. {% block javascripts %}
  5. <script>
  6. {% url "static_proxy" as static_proxy_url %}
  7. {% url "fb_browse" as fb_browse_url %}
  8. {% url "displayable_links_js" as link_list_url %}
  9. {% url "admin:index" as admin_index_url %}
  10. {% get_current_language as LANGUAGE_CODE %}
  11. window.__home_link = '<a href="{% url "home" %}">{% trans "View site" %}</a>';
  12. window.__csrf_token = '{{ csrf_token }}';
  13. window.__admin_keywords_submit_url = '{% url "admin_keywords_submit" %}';
  14. window.__filebrowser_url = '{{ fb_browse_url }}';
  15. window.__link_list_url = '{{ link_list_url }}';
  16. window.__tinymce_css = '{% static "mezzanine/css/tinymce.css" %}';
  17. window.__admin_url = '{{ admin_index_url }}';
  18. window.__static_proxy = '{{ static_proxy_url }}';
  19. window.__admin_media_prefix__ = '{% static "admin" %}/';
  20. window.__grappelli_installed = {{ settings.GRAPPELLI_INSTALLED|lower }};
  21. window.__admin_menu_collapsed = {{ settings.ADMIN_MENU_COLLAPSED|lower }};
  22. window.__language_code = '{{ LANGUAGE_CODE }}';
  23. </script>
  24. {% if not settings.GRAPPELLI_INSTALLED %}
  25. <script src="{% static "mezzanine/js/"|add:settings.JQUERY_FILENAME %}"></script>
  26. {% endif %}
  27. {{ block.super }}
  28. <script>
  29. jQuery(function($) {
  30. $('.admin-title').click(function() {location = window.__admin_url;});
  31. // This line can be removed after a decent amount of time has passed since
  32. // https://github.com/stephenmcd/grappelli-safe/pull/56/files occurring.
  33. $("#id_sitepermissions-__prefix__-sites").parent().parent().parent().remove();
  34. });
  35. </script>
  36. {% endblock %}
  37. {% block stylesheets %}
  38. {{ block.super }}
  39. <link rel="stylesheet" href="{% static "mezzanine/css/admin/global.css" %}">
  40. <style>
  41. /* These are set in PageAdmin's view methods, and mezzanine.utils.admin.SingletonAdmin */
  42. {% if hide_delete_link or singleton %}.submit-row .deletelink {display:none !important;}{% endif %}
  43. {% if hide_slug_field %}.slug {display:none !important;}{% endif %}
  44. {% if singleton %}.change-view-save-another {display:none !important;}{% endif %}
  45. </style>
  46. {% endblock %}
  47. {% block rtl_styles %}
  48. {{ block.super }}
  49. <link rel="stylesheet" type="text/css" href="{% static "mezzanine/css/admin/rtl.css" %}" />
  50. {% endblock %}
  51. {% block before_content %}
  52. {% if user.is_staff and not is_popup and not request.GET.pop %}
  53. {% admin_dropdown_menu %}
  54. {% endif %}
  55. {% endblock %}
  56. {% block footer %}
  57. {% if form.this_is_the_login_form %}
  58. <script src="{% static "mezzanine/js/admin/login.js" %}"></script>
  59. {% else %}
  60. {% if user.is_staff %}
  61. {% if not is_popup and not request.GET.pop %}
  62. <link rel="stylesheet" href="{% static "mezzanine/chosen/chosen.css" %}">
  63. <script src="{% static "mezzanine/chosen/chosen-0.9.12.jquery.js" %}"></script>
  64. <script src="{% static "mezzanine/js/admin/navigation.js" %}"></script>
  65. {% endif %}
  66. <script src="{% static "mezzanine/js/admin/ajax_csrf.js" %}"></script>
  67. {% if settings.GRAPPELLI_INSTALLED %}
  68. <script src="{% static "mezzanine/js/admin/collapse_backport.js" %}"></script>
  69. {% endif %}
  70. {% endif %}
  71. {% endif %}
  72. {% endblock %}