From 22dcea19ff74871b7200bfc7f976836f436c5342 Mon Sep 17 00:00:00 2001 From: Daniel GarcĂ­a Moreno Date: Tue, 8 Jun 2021 11:33:30 +0200 Subject: Add sidebar and command bar to base template Modify the base template to add the sidebar and command bar, implemented just in the scopes view. This patch also modifies the "actions/mode.html" template to be shown in the scopes page. Any other action that should be inside the scopes should do the same, add the scopes and clients to the template context and use the "scopes.html" as base in those actions. The notification has been also changed to use a toast notification instead of the usual alert to avoid changing the layout on error. --- ogcp/static/css/soleta.css | 8 ++++ ogcp/templates/actions/mode.html | 3 +- ogcp/templates/base.html | 56 +++++++++++++++++-------- ogcp/templates/nav.html | 16 +++++++- ogcp/templates/scopes.html | 88 +++++++++++++++++++--------------------- ogcp/views.py | 48 ++++++++++++---------- 6 files changed, 131 insertions(+), 88 deletions(-) diff --git a/ogcp/static/css/soleta.css b/ogcp/static/css/soleta.css index d748f5b..ca49897 100644 --- a/ogcp/static/css/soleta.css +++ b/ogcp/static/css/soleta.css @@ -6,3 +6,11 @@ html, body { width: 100%; height: 100% !important; } + +#sidebar .list-group-item { + background-color: transparent; +} + +.toast { + margin: 10px; +} diff --git a/ogcp/templates/actions/mode.html b/ogcp/templates/actions/mode.html index 0fd3266..3adce8f 100644 --- a/ogcp/templates/actions/mode.html +++ b/ogcp/templates/actions/mode.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'scopes.html' %} {% import "bootstrap/wtf.html" as wtf %} {% block content %} @@ -20,4 +20,3 @@ extra_classes="m-5") }} {% endblock %} - diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 5fda82a..dca6205 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -17,24 +17,25 @@
{% include 'nav.html' %} {% block nav %}{% endblock %} - {% block flash %} - {% for category, message in get_flashed_messages(with_categories=True) %} - {% if category == 'info' %} -