Skip to content

Commit

Permalink
Merge pull request #412 from maykinmedia/feature/#21-show-version-admin
Browse files Browse the repository at this point in the history
[#21] show version in admin
  • Loading branch information
stevenbal authored Jul 22, 2024
2 parents f8125b5 + 1c14814 commit a5a0a50
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 43 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ notifications-api-common==0.2.2
# via
# -r requirements/base.in
# 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 @@ -369,7 +369,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 @@ -414,7 +414,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
1 change: 1 addition & 0 deletions src/objects/conf/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"SECRET_KEY", "2(@f(-6s_u(5fd&1sg^uvu2s(c-9sapw)1era8q&)g)h@cwxxg"
)
os.environ.setdefault("IS_HTTPS", "no")
os.environ.setdefault("RELEASE", "dev")
os.environ.setdefault("ENVIRONMENT", "development")

os.environ.setdefault("DB_NAME", "objects"),
Expand Down
38 changes: 6 additions & 32 deletions src/objects/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
11 changes: 3 additions & 8 deletions src/objects/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 @@ -35,15 +36,9 @@ <h1 id="site-name"><a href="{% url 'admin:index' %}">{{ settings.PROJECT_NAME }}

{% 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 %}

{% block footer %}
{{ block.super }}

{# Load the custom JS #}
<script src="{% static 'bundles/objects-js.js' %}"></script>
{% endblock %}

0 comments on commit a5a0a50

Please sign in to comment.