Skip to content

Commit

Permalink
CMS branding to DBT (#332)
Browse files Browse the repository at this point in the history
Simple branding to DBT logo, fonts and colours
  • Loading branch information
marcelkornblum authored Mar 3, 2023
1 parent aedff43 commit 05a4d93
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 1 deletion.
Binary file added assets/images/dbt-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/dbt-mark-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions assets/stylesheets/wagtailtheme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@font-face {
font-family: "GDS Transport";
font-style: normal;
font-weight: normal;
src: url(/static/webpack_bundles/light-94a07e06a1-v2.woff2) format("woff2"),
url(/static/webpack_bundles/light-f591b13f7d-v2.woff) format("woff");
font-display: fallback;
}
@font-face {
font-family: "GDS Transport";
font-style: normal;
font-weight: bold;
src: url(/static/webpack_bundles/bold-b542beb274-v2.woff2) format("woff2"),
url(/static/webpack_bundles/bold-affa96571d-v2.woff) format("woff");
font-display: fallback;
}

:root {
--w-color-primary: #0b0c0c;
--w-color-primary-200: #232424;
--w-color-secondary: #00703c;
--w-color-secondary-600: #005a30;
--w-color-positive-100: #00703c;
--w-color-warning-100: #ffdd00;
--w-color-warning-50: #fff199;
--w-color-critical-100: #d4351c;
--w-color-critical-50: #ea9a8e;
--w-font-sans: "GDS Transport", arial, sans-serif;
}

.sidebar-custom-branding {
margin: 0 2em 1em 2em;
text-align: left;
}

a.sidebar-custom-branding {
color: #fffc;
}

.sidebar-custom-branding .slim {
display: none;
text-align: left;
}

.sidebar-custom-branding .slim img {
max-width: auto;
}

.sidebar--slim .sidebar-custom-branding {
margin: 0 0 0 0.8em;
}

.sidebar--slim .sidebar-custom-branding span {
display: none;
}

.sidebar--slim .sidebar-custom-branding .wide {
display: none;
}

.sidebar--slim .sidebar-custom-branding .slim {
display: inherit;
}
Binary file added core/static/core/apple-touch-icon-bw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/static/core/favicon-bw-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/static/core/favicon-bw-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions core/templates/wagtailadmin/admin_base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "wagtailadmin/admin_base.html" %}
{% load static %}
{% block branding_title %}DBT Digital Workspace{% endblock %}
{% block branding_favicon %}
<link rel="shortcut icon" href="{% static 'core/favicon-bw-32x32.png' %}" />
<link rel="apple-touch-icon"
href="{% static 'core/apple-touch-icon-bw.png' %}">
{% endblock %}
13 changes: 13 additions & 0 deletions core/templates/wagtailadmin/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "wagtailadmin/base.html" %}
{% load render_bundle webpack_static from webpack_loader %}
{% block branding_logo %}
<img src="{% webpack_static 'dbt-logo-white.png' %}"
srcset="{% webpack_static '[email protected]' %} 2x"
alt="Department for Business & Trade logo"
class="wide">
<span class="wide">Digital Workspace CMS</span>
<img src="{% webpack_static 'dbt-mark-white.png' %}"
alt="Department for Business & Trade logomark"
class="slim">
<span class="slim">CMS</span>
{% endblock branding_logo %}
10 changes: 10 additions & 0 deletions core/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.templatetags.static import static
from django.utils.html import format_html
from wagtail import hooks
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register

from core.models import SiteAlertBanner
Expand All @@ -14,3 +17,10 @@ class SiteAlertBannerAdmin(ModelAdmin):


modeladmin_register(SiteAlertBannerAdmin)


@hooks.register("insert_global_admin_css")
def global_admin_css():
return format_html(
'<link rel="stylesheet" href="{}">', static("stylesheets/wagtailtheme.css")
)
2 changes: 1 addition & 1 deletion selenium_tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_smoke(django_user_model, selenium, live_server):
assert "Home" in selenium.title

wagtail_admin_page = home_page.goto_wagtail_admin_page()
assert "Wagtail" in selenium.title
assert "DBT Digital Workspace" in selenium.title

home_page = wagtail_admin_page.get_home_page()
assert "Home" in selenium.title

0 comments on commit 05a4d93

Please sign in to comment.