From 285843634162860b1ba19f71834f06f4fca54583 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Fri, 1 Dec 2023 15:55:15 +0100 Subject: src: add menu to manage repos The menu includes a list of the repos of each server. The user can select a server or a repo to make changes. As of now, the only action possible is to add a repo to selected server. The work contained in this commit can be structured in: 1. Add the repos menu: - Add a 'repos' button in the menus bar (base.html). - Add repos.html template to create the management repos menu. - In ogcp.js, add function to store in browser's local storage which elements of the sidebar are uncollapsed. This saves the sidebar state after a page refresh. - Add manage_repos() in views.py 2. Allow to add a repo: - Add template with form to add a repo (repos_details.html) - Create RepoForm(FlaskForm) in action_forms.py - Add repo_add_get() and repo_add_post() in views.py --- ogcp/templates/actions/repos_details.html | 16 +++++++++ ogcp/templates/base.html | 3 ++ ogcp/templates/repos.html | 59 +++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 ogcp/templates/actions/repos_details.html create mode 100644 ogcp/templates/repos.html (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/repos_details.html b/ogcp/templates/actions/repos_details.html new file mode 100644 index 0000000..32b96bf --- /dev/null +++ b/ogcp/templates/actions/repos_details.html @@ -0,0 +1,16 @@ +{% extends 'repos.html' %} +{% import "bootstrap/wtf.html" as wtf %} +{% set btn_back = true %} + +{% block nav_repos %} active{% endblock %} +{% block nav_repos_details %} active{% endblock %} +{% block nav_repos_add %}active{% endblock %} +{% block content %} + +

{{_('Repo details')}}

+ +{{ wtf.quick_form(form, + method='post', + button_map={'create': 'primary'}, + extra_classes="mx-5") }} +{% endblock %} diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index a7e8b94..8ef8f3a 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -37,6 +37,9 @@ + diff --git a/ogcp/templates/repos.html b/ogcp/templates/repos.html new file mode 100644 index 0000000..881057b --- /dev/null +++ b/ogcp/templates/repos.html @@ -0,0 +1,59 @@ +{% extends 'base.html' %} + +{% block nav_repos %}active{% endblock %} + +{% block container %} +
+ +
+ {{ super() }} + +{% endblock %} + +{% block sidebar %} + + +{% endblock %} + +{% block commands %} + + + {% if btn_back %} + + {% endif %} +{% endblock %} -- cgit v1.2.3-18-g5258