From 3667db8662c1ee2ae058627447c4eda1898621ab Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 16 Jun 2021 10:30:39 +0000 Subject: Add commands view and macros.html Commands view has a scope sidebar with the content block filled with command buttons (poweroff, wol, etc.) This commit leaves scope create/delete/update buttons in the /scopes view, which serves that purpose. To avoid duplicating scope tree creation macro, an external macros.html is created, this template can be imported. Future macros needed can be written in there. --- ogcp/templates/commands.html | 44 +++++++++++++++++++++++++++++++++++++++++ ogcp/templates/macros.html | 19 ++++++++++++++++++ ogcp/templates/nav.html | 2 +- ogcp/templates/scopes.html | 47 +++----------------------------------------- ogcp/views.py | 6 ++++++ 5 files changed, 73 insertions(+), 45 deletions(-) create mode 100644 ogcp/templates/commands.html create mode 100644 ogcp/templates/macros.html (limited to 'ogcp') diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html new file mode 100644 index 0000000..27af1b1 --- /dev/null +++ b/ogcp/templates/commands.html @@ -0,0 +1,44 @@ +{% extends 'base.html' %} +{% import "macros.html" as macros %} + +{% block nav_scopes %}active{% endblock %} + +{% block container %} +
+ +
+ {{ super() }} + +{% endblock %} + +{% block sidebar %} + {{ macros.print_scopes_tree(scopes["scope"]) }} +{% endblock %} + +{% block commands %} + + + + + + + + + + + + +{% endblock %} + diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html new file mode 100644 index 0000000..d9d2997 --- /dev/null +++ b/ogcp/templates/macros.html @@ -0,0 +1,19 @@ +{% macro print_scopes_tree(scopes) -%} + + + +{% endmacro %} + diff --git a/ogcp/templates/nav.html b/ogcp/templates/nav.html index f2ca3b5..dc40207 100644 --- a/ogcp/templates/nav.html +++ b/ogcp/templates/nav.html @@ -14,7 +14,7 @@ {{ _('Scopes') }}