diff --git a/requirements/base.in b/requirements/base.in index dcd9e3aa..d103f9d0 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -1,4 +1,4 @@ -open-api-framework +git+https://github.com/maykinmedia/open-api-framework@bd51d3f592b4f1088e2233f98c90c6fd67c60e0c#egg=open_api_framework # Core python libraries glom # data represenation based on spec diff --git a/requirements/base.txt b/requirements/base.txt index 3118ea4d..b91a6d3c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -119,7 +119,9 @@ django-jsonform==2.21.4 # mozilla-django-oidc-db # open-api-framework django-log-outgoing-requests==0.6.1 - # via -r requirements/base.in + # via + # -r requirements/base.in + # open-api-framework django-markup==1.8.1 # via open-api-framework django-ordered-model==3.7.4 @@ -139,7 +141,9 @@ django-rest-framework-condition==0.1.1 django-sendfile2==0.7.0 # via django-privates django-setup-configuration==0.1.0 - # via -r requirements/base.in + # via + # -r requirements/base.in + # open-api-framework django-simple-certmanager==1.4.1 # via zgw-consumers django-solo==2.2.0 @@ -232,7 +236,7 @@ notifications-api-common==0.2.2 # via # -r requirements/base.in # commonground-api-common -open-api-framework==0.2.0 +open-api-framework @ git+https://github.com/maykinmedia/open-api-framework@bd51d3f592b4f1088e2233f98c90c6fd67c60e0c # via -r requirements/base.in orderedmultidict==1.0.1 # via furl diff --git a/requirements/ci.txt b/requirements/ci.txt index 3e5aa95e..5dfdf51f 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -171,7 +171,9 @@ django-jsonform==2.21.4 # mozilla-django-oidc-db # open-api-framework django-log-outgoing-requests==0.6.1 - # via -r requirements/base.txt + # via + # -r requirements/base.txt + # open-api-framework django-markup==1.8.1 # via # -r requirements/base.txt @@ -209,7 +211,9 @@ django-sendfile2==0.7.0 # -r requirements/base.txt # django-privates django-setup-configuration==0.1.0 - # via -r requirements/base.txt + # via + # -r requirements/base.txt + # open-api-framework django-simple-certmanager==1.4.1 # via # -r requirements/base.txt @@ -365,7 +369,7 @@ notifications-api-common==0.2.2 # via # -r requirements/base.txt # commonground-api-common -open-api-framework==0.2.0 +open-api-framework @ git+https://github.com/maykinmedia/open-api-framework@bd51d3f592b4f1088e2233f98c90c6fd67c60e0c # via -r requirements/base.txt orderedmultidict==1.0.1 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index bfded5e3..c7762c0d 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -197,7 +197,9 @@ django-jsonform==2.21.4 # mozilla-django-oidc-db # open-api-framework django-log-outgoing-requests==0.6.1 - # via -r requirements/ci.txt + # via + # -r requirements/ci.txt + # open-api-framework django-markup==1.8.1 # via # -r requirements/ci.txt @@ -235,7 +237,9 @@ django-sendfile2==0.7.0 # -r requirements/ci.txt # django-privates django-setup-configuration==0.1.0 - # via -r requirements/ci.txt + # via + # -r requirements/ci.txt + # open-api-framework django-simple-certmanager==1.4.1 # via # -r requirements/ci.txt @@ -410,7 +414,7 @@ notifications-api-common==0.2.2 # via # -r requirements/ci.txt # commonground-api-common -open-api-framework==0.2.0 +open-api-framework @ git+https://github.com/maykinmedia/open-api-framework@bd51d3f592b4f1088e2233f98c90c6fd67c60e0c # via -r requirements/ci.txt orderedmultidict==1.0.1 # via diff --git a/src/objects/conf/base.py b/src/objects/conf/base.py index f4d93aad..6b86d7af 100644 --- a/src/objects/conf/base.py +++ b/src/objects/conf/base.py @@ -112,6 +112,7 @@ "simple_certmanager", "zgw_consumers", "django_setup_configuration", + "open_api_framework", # Two-factor authentication in the Django admin, enforced. "django_otp", "django_otp.plugins.otp_static", @@ -163,6 +164,7 @@ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "open_api_framework.context_processors.project", "objects.utils.context_processors.settings", ], "loaders": RAW_TEMPLATE_LOADERS, diff --git a/src/objects/scss/admin/_admin_theme.scss b/src/objects/scss/admin/_admin_theme.scss index 218459b9..b52ddbf3 100644 --- a/src/objects/scss/admin/_admin_theme.scss +++ b/src/objects/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: #{$color-secondary-dark}; + + // 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 40px; - 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/objects/templates/admin/base_site.html b/src/objects/templates/admin/base_site.html index e92829e1..c1b8d723 100644 --- a/src/objects/templates/admin/base_site.html +++ b/src/objects/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 }} + @@ -35,23 +36,9 @@

{{ settings.PROJECT_NAME }} {% block nav-global %}{% endblock %} -{% block messages %} - {% if settings.ENVIRONMENT_SHOWN_IN_ADMIN %} -
{{ settings.ENVIRONMENT }}
- {% endif %} - {{ block.super }} -{% endblock %} - {% block footer %} {{ block.super }} - {% url 'admin:login' as admin_login_url %} - {% if request.path != admin_login_url %} -
- {% blocktrans with version=settings.RELEASE %}version {{ version }}{% endblocktrans %} -
- {% endif %} - {# Load the custom JS #} {% endblock %}