From 8bb564b19ff3191fdf3c9a200d88b3d4cda52d2b Mon Sep 17 00:00:00 2001 From: GwynBleidD Date: Mon, 15 Jun 2020 12:44:41 +0200 Subject: [PATCH] Fixed for Django 3.0 and added RWD - On Django 2.1, `admin_static` was deprecated and removed in Django 3.0 in favor of plain `static`. This change is backwards compatible with Django 2.0 and Django 1.11, as it was already just an alias for `static` on those versions of Django. - Added missing admin RWD styles introduced in Django 2.0. This change may introduce some 404 errors on Django 1.11, as those stylesheet files are not present on this Django version. If this is an issue, create `admin/base_site.html` template being an exact copy of original Django `admin/base_site.html` template and add empty `responsive` block into it. - Reverted indentation and HTML tags ending style of customized `admin/base.html` file to match original Django file. This makes spotting any changes of this file in new Django versions easier. --- admin_toolbox/templates/admin/base.html | 142 ++++++++++++------------ 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/admin_toolbox/templates/admin/base.html b/admin_toolbox/templates/admin/base.html index 0ef6056..5e044cc 100644 --- a/admin_toolbox/templates/admin/base.html +++ b/admin_toolbox/templates/admin/base.html @@ -1,19 +1,24 @@ -{% load i18n admin_static admin_toolbox_sidebar admin_toolbox_breadcrumbs %} +{% load i18n static %}{% load admin_toolbox_sidebar admin_toolbox_breadcrumbs %} {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} {% block title %}{% endblock %} - - - - + + + + {% block extrastyle %}{% endblock %} -{% if LANGUAGE_BIDI %}{% endif %} +{% if LANGUAGE_BIDI %}{% endif %} {% block extrahead %}{% endblock %} -{% block blockbots %}{% endblock %} +{% block responsive %} + + + {% if LANGUAGE_BIDI %}{% endif %} +{% endblock %} +{% block blockbots %}{% endblock %} {% load i18n %} @@ -24,74 +29,75 @@
{% if not is_popup %} - -