From 8e599c5f2ec5865de0a0c8cca85ad33ae468f858 Mon Sep 17 00:00:00 2001 From: SonnyBA Date: Tue, 16 Jul 2024 12:16:45 +0200 Subject: [PATCH] [#21] display version in admin (#112) * [#21] display version in admin --------- Co-authored-by: Sonny Bakker --- requirements/base.txt | 2 +- requirements/ci.txt | 2 +- requirements/dev.txt | 2 +- src/objecttypes/conf/base.py | 2 - src/objecttypes/conf/dev.py | 1 + src/objecttypes/scss/admin/_admin_theme.scss | 38 +++---------------- .../templates/admin/base_site.html | 10 +---- 7 files changed, 12 insertions(+), 45 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 6374f81c..8413704b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -239,7 +239,7 @@ mozilla-django-oidc-db==0.16.0 # via open-api-framework notifications-api-common==0.2.2 # via commonground-api-common -open-api-framework==0.4.2 +open-api-framework==0.5.0 # via -r requirements/base.in orderedmultidict==1.0.1 # via furl diff --git a/requirements/ci.txt b/requirements/ci.txt index c748b48c..7b96e938 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -381,7 +381,7 @@ notifications-api-common==0.2.2 # via # -r requirements/base.txt # commonground-api-common -open-api-framework==0.4.2 +open-api-framework==0.5.0 # via -r requirements/base.txt orderedmultidict==1.0.1 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index 7b546a87..3a666700 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -424,7 +424,7 @@ notifications-api-common==0.2.2 # via # -r requirements/ci.txt # commonground-api-common -open-api-framework==0.4.2 +open-api-framework==0.5.0 # via -r requirements/ci.txt orderedmultidict==1.0.1 # via diff --git a/src/objecttypes/conf/base.py b/src/objecttypes/conf/base.py index a8683f9d..01d126c0 100644 --- a/src/objecttypes/conf/base.py +++ b/src/objecttypes/conf/base.py @@ -10,7 +10,6 @@ # # Application definition - INSTALLED_APPS = INSTALLED_APPS + [ # External applications. "jsonsuit.apps.JSONSuitConfig", @@ -25,7 +24,6 @@ "objecttypes.utils", ] - # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ diff --git a/src/objecttypes/conf/dev.py b/src/objecttypes/conf/dev.py index c69b51cc..5d38a3cb 100644 --- a/src/objecttypes/conf/dev.py +++ b/src/objecttypes/conf/dev.py @@ -9,6 +9,7 @@ "SECRET_KEY", "fgv=c0hz&tl*8*3m3893@m+1pstrvidc9e^5@fpspmg%cy$15d" ) os.environ.setdefault("ENVIRONMENT", "development") +os.environ.setdefault("RELEASE", "dev") os.environ.setdefault("DB_NAME", "objecttypes"), os.environ.setdefault("DB_USER", "objecttypes"), diff --git a/src/objecttypes/scss/admin/_admin_theme.scss b/src/objecttypes/scss/admin/_admin_theme.scss index 0b99f836..50065125 100644 --- a/src/objecttypes/scss/admin/_admin_theme.scss +++ b/src/objecttypes/scss/admin/_admin_theme.scss @@ -36,6 +36,12 @@ DO NOT PUT ANY TARGET APP-SPECIFIC RULES HERE. --object-tools-bg: #888; --object-tools-hover-bg: #{$color_dark}; + + // version styling + --version-fg: var(--body-quiet-color); + + // environment styling + --env-button-fg: #{$color-secondary}; } /* Overrides */ @@ -132,38 +138,6 @@ div.breadcrumbs { background: url("../img/admin/calendar-alt-regular.svg") 0 0/14px 14px no-repeat !important; } -/* Footer */ -.version { - padding: 0 30px; - color: $color-secondary-dark; - font-size: smaller; - - @at-root .login & { - text-align: center; - } -} - -/** - * Environment banner - */ -.env { - display: block; - line-height: 35px; - text-align: center; - font-weight: bold; - text-transform: uppercase; - color: $color-secondary; - background-color: $color-dark; - position: fixed; - top: 0; - height: 35px; - width: 300px; - left: 50%; - margin-left: -150px; - z-index: 1000001; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); -} - /** * Django form field lengths */ diff --git a/src/objecttypes/templates/admin/base_site.html b/src/objecttypes/templates/admin/base_site.html index d8df6af0..ed3ad4d3 100644 --- a/src/objecttypes/templates/admin/base_site.html +++ b/src/objecttypes/templates/admin/base_site.html @@ -1,10 +1,11 @@ -{% extends "admin/base.html" %} +{% extends "open_api_framework/admin/base_site.html" %} {% load i18n static %} {% block title %}{{ title }} | {{ settings.PROJECT_NAME }}{% endblock %} {% block extrastyle %} {{ block.super }} + @@ -34,10 +35,3 @@

{{ settings.PROJECT_NAME }} {% endblock %} {% block nav-global %}{% endblock %} - -{% block messages %} - {% if settings.ENVIRONMENT_SHOWN_IN_ADMIN %} -
{{ settings.ENVIRONMENT }}
- {% endif %} - {{ block.super }} -{% endblock %}