Skip to content

Commit

Permalink
Merge pull request #131 from open-zaak/feature/admin-ui
Browse files Browse the repository at this point in the history
Minor tweaks as part of UI update
  • Loading branch information
joeribekker committed Oct 22, 2019
2 parents 33515b1 + 6b8a544 commit 8ecaf65
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 34 deletions.
6 changes: 4 additions & 2 deletions src/openzaak/components/authorizations/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ class SchemaView(_SchemaView):
# API documentation
url(
r"^schema/openapi(?P<format>\.json|\.yaml)$",
SchemaView.without_ui(cache_timeout=None),
SchemaView.without_ui(cache_timeout=settings.SPEC_CACHE_TIMEOUT),
name="schema-json-authorizations",
),
url(
r"^schema/$",
SchemaView.with_ui("redoc", cache_timeout=None),
SchemaView.with_ui(
"redoc", cache_timeout=settings.SPEC_CACHE_TIMEOUT
),
name="schema-redoc-authorizations",
),
# actual API
Expand Down
6 changes: 4 additions & 2 deletions src/openzaak/components/besluiten/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ class SchemaView(_SchemaView):
# API documentation
url(
r"^schema/openapi(?P<format>\.json|\.yaml)$",
SchemaView.without_ui(cache_timeout=None),
SchemaView.without_ui(cache_timeout=settings.SPEC_CACHE_TIMEOUT),
name="schema-json-besluiten",
),
url(
r"^schema/$",
SchemaView.with_ui("redoc", cache_timeout=None),
SchemaView.with_ui(
"redoc", cache_timeout=settings.SPEC_CACHE_TIMEOUT
),
name="schema-redoc-besluiten",
),
# actual API
Expand Down
6 changes: 4 additions & 2 deletions src/openzaak/components/catalogi/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ class SchemaView(_SchemaView):
# API documentation
url(
r"^schema/openapi(?P<format>\.json|\.yaml)$",
SchemaView.without_ui(cache_timeout=None),
SchemaView.without_ui(cache_timeout=settings.SPEC_CACHE_TIMEOUT),
name="schema-json-catalogi",
),
url(
r"^schema/$",
SchemaView.with_ui("redoc", cache_timeout=None),
SchemaView.with_ui(
"redoc", cache_timeout=settings.SPEC_CACHE_TIMEOUT
),
name="schema-redoc-catalogi",
),
# actual API
Expand Down
6 changes: 4 additions & 2 deletions src/openzaak/components/documenten/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ class SchemaView(_SchemaView):
# API documentation
url(
r"^schema/openapi(?P<format>\.json|\.yaml)$",
SchemaView.without_ui(cache_timeout=None),
SchemaView.without_ui(cache_timeout=settings.SPEC_CACHE_TIMEOUT),
name="schema-json-documenten",
),
url(
r"^schema/$",
SchemaView.with_ui("redoc", cache_timeout=None),
SchemaView.with_ui(
"redoc", cache_timeout=settings.SPEC_CACHE_TIMEOUT
),
name="schema-redoc-documenten",
),
# actual API
Expand Down
6 changes: 4 additions & 2 deletions src/openzaak/components/zaken/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ class SchemaView(_SchemaView):
# API documentation
url(
r"^schema/openapi(?P<format>\.json|\.yaml)$",
SchemaView.without_ui(cache_timeout=None),
SchemaView.without_ui(cache_timeout=settings.SPEC_CACHE_TIMEOUT),
name="schema-json-zaken",
),
url(
r"^schema/$",
SchemaView.with_ui("redoc", cache_timeout=None),
SchemaView.with_ui(
"redoc", cache_timeout=settings.SPEC_CACHE_TIMEOUT
),
name="schema-redoc-zaken",
),
# actual API
Expand Down
2 changes: 2 additions & 0 deletions src/openzaak/conf/includes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@
ZRC_API_SPEC = (
f"https://raw.githubusercontent.com/{zrc_repo}/{zrc_commit}/src/openapi.yaml"
)

SPEC_CACHE_TIMEOUT = 60 * 60 * 24 # 24 hours
4 changes: 2 additions & 2 deletions src/openzaak/conf/includes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
# Custom settings
#
PROJECT_NAME = "Open Zaak"
SITE_TITLE = "Open Zaak"
SITE_TITLE = "API dashboard"

ENVIRONMENT = None
ENVIRONMENT_SHOWN_IN_ADMIN = True
Expand Down Expand Up @@ -461,5 +461,5 @@
#
# DJANGO-ADMIN-INDEX
#
ADMIN_INDEX_SHOW_REMAINING_APPS_TO_SUPERUSERS = True
ADMIN_INDEX_SHOW_REMAINING_APPS_TO_SUPERUSERS = False
ADMIN_INDEX_AUTO_CREATE_APP_GROUP = False
2 changes: 1 addition & 1 deletion src/openzaak/conf/includes/local_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from .dev import DATABASES, INSTALLED_APPS
from ..dev import DATABASES, INSTALLED_APPS

INSTALLED_APPS += ["django_extensions"]

Expand Down
8 changes: 4 additions & 4 deletions src/openzaak/sass/admin/admin_overrides.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* Colors */
$color_primary: #2B579A;
$color_primary: #2E8DD0;
$color_primary_dark: #124078;
$color_primary_light: #c4dce8;

$color_secondary: #F3F3F3;
$color_secondary_dark: #C6C6C6;
$color_secondary_light: #fff;

$color_link: #2B579A;
$color_link: #005DD0;
$color_link_hover: #124078;

$color_darkest: #000;
Expand Down Expand Up @@ -218,13 +218,13 @@ div.breadcrumbs {

.dropdown-menu {
/* Override for Environment banner */
top: 49px;
top: 48px;
/* Added to attach body */
border-bottom: 8px solid $color_secondary;
}

.breadcrumbs {
top: 49px !important;
top: 48px !important;
}

/* Integration into color scheme */
Expand Down
34 changes: 17 additions & 17 deletions src/openzaak/static/css/admin/admin_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body {
}

a:link, a:visited {
color: #2B579A;
color: #005DD0;
}

a:focus, a:hover {
Expand All @@ -14,7 +14,7 @@ a:focus, a:hover {

#header {
color: #fff;
background: #2B579A;
background: #2E8DD0;
/* border-bottom: 8px solid $color_secondary; */
position: -webkit-sticky;
position: sticky;
Expand All @@ -36,7 +36,7 @@ a:focus, a:hover {
}

.module h2, .module caption, .inline-group h2 {
background: #2B579A;
background: #2E8DD0;
}

#branding h1 {
Expand All @@ -49,7 +49,7 @@ a:focus, a:hover {

div.breadcrumbs {
background: #F3F3F3;
color: #2B579A;
color: #2E8DD0;
position: -webkit-sticky;
position: sticky;
top: 60px;
Expand All @@ -66,23 +66,23 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {

/* Important is used because Django templates include their own style, after ours */
#changelist-filter a:focus, #changelist-filter a:hover {
color: #2B579A !important;
color: #005DD0 !important;
}

#changelist-filter li.selected a {
color: #2B579A !important;
color: #005DD0 !important;
}

#changelist-filter li.selected a:focus, #changelist-filter li.selected a:hover {
color: #2B579A !important;
color: #2E8DD0 !important;
}

.object-tools a:focus, .object-tools a:hover {
background-color: #333;
}

.button, input[type=submit], input[type=button], .submit-row input, a.button {
background: #2B579A;
background: #2E8DD0;
color: #fff;
/* border: 2px solid $color_dark; */
}
Expand Down Expand Up @@ -110,7 +110,7 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {

/* Many to many selector */
.selector-chosen h2 {
background: #2B579A !important;
background: #2E8DD0 !important;
}

/* Calendar widget */
Expand All @@ -120,15 +120,15 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {
}

.calendar td a:active {
background: #2B579A !important;
background: #2E8DD0 !important;
}

.calendar td a:focus, .calendar td a:hover {
background: #124078 !important;
}

.calendar td.selected a {
background: #2B579A !important;
background: #2E8DD0 !important;
}

.calendarbox h2 {
Expand All @@ -138,7 +138,7 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {

/* Time widget */
.timelist a:active {
background: #2B579A !important;
background: #2E8DD0 !important;
}

.timelist a:focus, .timelist a:hover {
Expand Down Expand Up @@ -199,18 +199,18 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {
*/
.dropdown-menu {
/* Override for Environment banner */
top: 49px;
top: 48px;
/* Added to attach body */
border-bottom: 8px solid #F3F3F3;
}

.breadcrumbs {
top: 49px !important;
top: 48px !important;
}

/* Integration into color scheme */
.dropdown-menu {
background-color: #2B579A;
background-color: #2E8DD0;
}

.dropdown-menu .dropdown-menu__item,
Expand All @@ -224,7 +224,7 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {
.dropdown-menu .dropdown-menu__item:visited.dropdown-menu__item--active {
background-color: #F3F3F3;
text-decoration: none;
color: #2B579A;
color: #2E8DD0;
}

.dropdown-menu .dropdown-menu__item.dropdown-menu__item--active:hover,
Expand All @@ -240,7 +240,7 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {
}

.dropdown-menu .dropdown-menu__drop {
background-color: #2B579A;
background-color: #2E8DD0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
}

Expand Down
15 changes: 15 additions & 0 deletions src/openzaak/templates/admin/base_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ settings.PROJECT_NAME }} beheer</a></h1>
{% endblock %}

{% block welcome-msg %}
{% trans 'Ingelogd als' %}
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
{% endblock %}

{% block userlinks %}
{% if site_url %}
<a href="{{ site_url }}">{{ settings.SITE_TITLE }}</a> /
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
{% endblock %}

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

{% block messages %}
Expand Down
3 changes: 3 additions & 0 deletions src/openzaak/templates/admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends "admin/index.html" %}

{% block content_title %}<h1>Welkom, {{ user.get_full_name|default:user.get_username }}</h1>{% endblock %}

0 comments on commit 8ecaf65

Please sign in to comment.