From 7613cd8017e978e771552467a4e10141e120fccb Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 3 Sep 2024 12:45:49 +0200 Subject: ogcp: add server ip configuration Enable server view in the main toolbar. Hide Add server and Delete server buttons. Add Update server button. Add server/update view to edit the server addresses. --- ogcp/templates/actions/server_update.html | 69 +++++++++++++++++++++++++++++++ ogcp/templates/base.html | 3 ++ ogcp/templates/servers.html | 9 ++-- 3 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 ogcp/templates/actions/server_update.html (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/server_update.html b/ogcp/templates/actions/server_update.html new file mode 100644 index 0000000..ae2513b --- /dev/null +++ b/ogcp/templates/actions/server_update.html @@ -0,0 +1,69 @@ +{% extends 'servers.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% set sidebar_state = 'disabled' %} +{% set btn_back = true %} + +{% block nav_server_add %}active{% endblock %} +{% block content %} + +

{{_('Update server')}}

+ +
+ {{ form.hidden_tag() }} + + {{ form.server_addr() }} + +
+
+ {% for addr in form.addr %} +
+ {{ addr(class="form-control me-2", placeholder=_("Enter IP Address"), required=True) }} + +
+ {% endfor %} +
+ + + {{ form.submit(class="btn btn-success") }} +
+
+ + + +{% endblock %} diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index cd030e8..5d46135 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -40,6 +40,9 @@ {{ _('Repos') }} {% if current_user.admin %} + diff --git a/ogcp/templates/servers.html b/ogcp/templates/servers.html index bc09c4f..d555f71 100644 --- a/ogcp/templates/servers.html +++ b/ogcp/templates/servers.html @@ -17,7 +17,8 @@ {% endfor %} @@ -26,10 +27,8 @@ {% block commands %} {% if current_user.is_authenticated %} - - + {% if btn_back %}