Skip to content

Commit

Permalink
[#21] display version in admin (#112)
Browse files Browse the repository at this point in the history
* [#21] display version in admin

---------

Co-authored-by: Sonny Bakker <sonny@maykinmedia.nl>
  • Loading branch information
SonnyBA and Sonny Bakker authored Jul 16, 2024
1 parent 2911467 commit 8e599c5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 45 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/objecttypes/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#

# Application definition

INSTALLED_APPS = INSTALLED_APPS + [
# External applications.
"jsonsuit.apps.JSONSuitConfig",
Expand All @@ -25,7 +24,6 @@
"objecttypes.utils",
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

Expand Down
1 change: 1 addition & 0 deletions src/objecttypes/conf/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
38 changes: 6 additions & 32 deletions src/objecttypes/scss/admin/_admin_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
*/
Expand Down
10 changes: 2 additions & 8 deletions src/objecttypes/templates/admin/base_site.html
Original file line number Diff line number Diff line change
@@ -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 }}

<link rel="stylesheet" type="text/css" href="{% static 'bundles/admin_overrides.css' %}">

<link rel="icon" type="image/png" href="{% static 'ico/favicon.png' %}">
Expand Down Expand Up @@ -34,10 +35,3 @@ <h1 id="site-name"><a href="{% url 'admin:index' %}">{{ settings.PROJECT_NAME }}
{% endblock %}

{% block nav-global %}{% endblock %}

{% block messages %}
{% if settings.ENVIRONMENT_SHOWN_IN_ADMIN %}
<div class="env env-{{ settings.ENVIRONMENT }}">{{ settings.ENVIRONMENT }}</div>
{% endif %}
{{ block.super }}
{% endblock %}

0 comments on commit 8e599c5

Please sign in to comment.