From 42dc44323e4cf0eaf0b563ba02f368942cf86e3d Mon Sep 17 00:00:00 2001 From: Daniel GarcĂ­a Moreno Date: Wed, 30 Jun 2021 12:40:22 +0200 Subject: Add new partition button in setup action This patch adds a way to add a new partition to the setup.html template. This button opens a modal dialog with a new form and calls a new endpoint to create the new partition (this endpoint does nothing, it's needed to be implemented in the future). I've followed the initial design for this template, with one form per each partition, so every button will call a function and reload the page. It's possible to do all actions at once, but that will require a rework of this, to do that we can just define an unique form in the whole html, remove all the "Modify" buttons and add just one "Apply" button at the end. But maybe that option is a lot complex in the backend because will require to validate all the changes at once. This patch also improves the setup.html form without using flask-bootstrap and rendering the form in the template directly with the bootstrap4 classes. --- ogcp/templates/actions/setup.html | 81 ++++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 9 deletions(-) (limited to 'ogcp/templates/actions') diff --git a/ogcp/templates/actions/setup.html b/ogcp/templates/actions/setup.html index 0dcd4c7..6856ed1 100644 --- a/ogcp/templates/actions/setup.html +++ b/ogcp/templates/actions/setup.html @@ -1,19 +1,82 @@ {% extends 'commands.html' %} -{% import "bootstrap/wtf.html" as wtf %} {% block content %}

{{_('Partition and Format')}}

-{% for form in forms %} + + + + + + + + + + -{{ wtf.quick_form(form, - method='post', - form_type='inline', - extra_classes='mx-5 pb-3', - button_map={'modify': 'primary', - 'delete': 'danger'}) }} + + {% for form in forms %} + + + {{ form.hidden_tag() }} + + + + + + + + + {% endfor %} + +
TypeFilesytemSize (KB)Format?
{{ form.part_type(class_="form-control") }}{{ form.fs(class_="form-control") }}{{ form.size(class_="form-control") }}{{ form.format_partition(class_="form-control") }}{{ form.modify(class_="form-control btn-primary") }}{{ form.delete(class_="form-control btn-danger") }}
-{% endfor %} + + + + {% endblock %} -- cgit v1.2.3-18-g5258