From 695fcfe6255fd53b19b416e8375b48d2dc5595e4 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Wed, 10 Jan 2024 11:23:36 +0100 Subject: src: Add support for adding folders Add support to create a folder able to contain multiple computers. Add support for adding a folder able to contain rooms --- ogcp/forms/action_forms.py | 7 ++++++ ogcp/templates/actions/folder_add.html | 19 ++++++++++++++++ ogcp/templates/scopes.html | 11 +++++++++ ogcp/views.py | 41 +++++++++++++++++++++++++++++++++- 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 ogcp/templates/actions/folder_add.html diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 64b292a..9110913 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -105,6 +105,13 @@ class RepoForm(FlaskForm): ip = StringField(label=_l('IP')) submit = SubmitField(label=_l('Submit')) +class FolderForm(FlaskForm): + server = HiddenField() + room = HiddenField() + center = HiddenField() + name = StringField(label=_l('Name')) + submit = SubmitField(label=_l('Submit')) + class ClientDetailsForm(FlaskForm): server = HiddenField() name = StringField(label=_l('Name')) diff --git a/ogcp/templates/actions/folder_add.html b/ogcp/templates/actions/folder_add.html new file mode 100644 index 0000000..70f7e57 --- /dev/null +++ b/ogcp/templates/actions/folder_add.html @@ -0,0 +1,19 @@ +{% extends 'scopes.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% set sidebar_state = 'disabled' %} +{% set btn_back = true %} + +{% block nav_folder %} active{% endblock %} +{% block nav_folder_add %} active{% endblock %} +{% block content %} + +

{{_('Add folder')}}

+ +{{ wtf.quick_form(form, + method='post', + button_map={'submit': 'primary'}, + extra_classes="mx-5") }} + +{% endblock %} + diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 8a0701f..ecc8433 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -56,6 +56,17 @@ form="scopesForm" formaction="{{ url_for('action_center_delete') }}" formmethod="get"> + + + {% endif %} {% if btn_back %}