Selaa lähdekoodia

Use favicon instead of logo in wagtail admin (#650)

Starting with 4.0, sites with navbar settings disabled do not have the
ability to change the light/dark setting, which was being used in the
admin to put a light or dark background on the logo. Determining if the
logo is light or dark is a perpetual problem here. Because if this, the
default was light background, and a white logo is now unreadable.

To simplify it, let's switch to using the favicon. The favicon is much
more suitable for this kind of situation.
Vince Salvino 10 kuukautta sitten
vanhempi
commit
8a597b5607

+ 4 - 12
coderedcms/static/coderedcms/css/crx-admin.css

@@ -27,21 +27,13 @@ textarea.monospace,
 .crx-logo-custom {
   width: auto;
   height: auto;
-  max-height: 80px;
   max-width: 100%;
   display: block;
 }
-.crx-logo-container {
-  box-sizing: border-box;
-  margin: 0 15px;
-}
-.crx-logo-container.navbar-light {
-  background-color: #fff;
-  border-radius: 6px;
-  padding: 0.25em;
-}
-.crx-logo-container.navbar-dark {
-  background-color: transparent;
+
+.sidebar-custom-branding {
+  padding: 20px;
+  margin: 0;
 }
 
 

+ 1 - 2
coderedcms/templates/wagtailadmin/base.html

@@ -1,6 +1,5 @@
 {% extends "wagtailadmin/base.html" %}
 {% load coderedcms_tags wagtailimages_tags wagtailsettings_tags %}
-{% django_setting "CRX_DISABLE_LAYOUT" as disable_layout %}
 
 {% block furniture %}
     {% include "coderedcms/includes/crx_banner.html" %}
@@ -9,4 +8,4 @@
 
 {# NOTE: this must be on a single line, otherwise Django templates will create
   whitespace, and wagtail will think the whitespace is the custom logo! #}
-{% block branding_logo %}{% if not disable_layout and settings.coderedcms.LayoutSettings.logo %}<div class="crx-logo-container {{settings.coderedcms.LayoutSettings.navbar_color_scheme}}">{% image settings.coderedcms.LayoutSettings.logo original format-webp preserve-svg as logo_image %}<img src="{{ logo_image.url }}" class="crx-logo-custom" alt="Dashboard"></div>{% endif %}{% endblock %}
+{% block branding_logo %}{% django_setting "CRX_DISABLE_LAYOUT" as disable_layout %}{% if not disable_layout and settings.coderedcms.LayoutSettings.favicon %}{% image settings.coderedcms.LayoutSettings.favicon original format-webp preserve-svg as logo_image %}<img src="{{ logo_image.url }}" class="crx-logo-custom" alt="Dashboard">{% endif %}{% endblock %}