From f76c0ed24d6eb45f60e211fa8eb8d2f13714aa46 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Tue, 5 Dec 2023 11:48:09 +0100 Subject: views: change repo add view to follow convention combine repo_add_get and repo_add_post into one, action_repo_add. This is to follow convention across all the views and to clarify that it is an action. rename repos_details template to repos_add. Now it is clear the purpose of each action template; there is one for each: add, delete and update --- ogcp/templates/actions/repos_add.html | 17 +++++++++ ogcp/templates/actions/repos_details.html | 17 --------- ogcp/templates/repos.html | 2 +- ogcp/views.py | 57 +++++++++++++++---------------- 4 files changed, 45 insertions(+), 48 deletions(-) create mode 100644 ogcp/templates/actions/repos_add.html delete mode 100644 ogcp/templates/actions/repos_details.html diff --git a/ogcp/templates/actions/repos_add.html b/ogcp/templates/actions/repos_add.html new file mode 100644 index 0000000..7782014 --- /dev/null +++ b/ogcp/templates/actions/repos_add.html @@ -0,0 +1,17 @@ +{% 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 %} + +

{{_('Add repo')}}

+ +{{ wtf.quick_form(form, + action=url_for('action_repo_add'), + method='post', + button_map={'submit': 'primary'}, + extra_classes="mx-5") }} +{% endblock %} diff --git a/ogcp/templates/actions/repos_details.html b/ogcp/templates/actions/repos_details.html deleted file mode 100644 index 2768492..0000000 --- a/ogcp/templates/actions/repos_details.html +++ /dev/null @@ -1,17 +0,0 @@ -{% 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, - action=url_for('repo_add_post'), - method='post', - button_map={'submit': 'primary'}, - extra_classes="mx-5") }} -{% endblock %} diff --git a/ogcp/templates/repos.html b/ogcp/templates/repos.html index 31a4226..5ca33fe 100644 --- a/ogcp/templates/repos.html +++ b/ogcp/templates/repos.html @@ -51,7 +51,7 @@ {% block commands %} + form="reposForm" formaction="{{ url_for('action_repo_add') }}" formmethod="get">