From fce0ee94c6bfef997ff4346612a55bdb241375aa Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 23 Jul 2024 12:53:21 +0200 Subject: templates: make client details template more compact Make the form template update automatically after form definition modifications. Use a loop to render the for fields. --- ogcp/templates/actions/client_details.html | 67 +++++------------------------- 1 file changed, 11 insertions(+), 56 deletions(-) (limited to 'ogcp/templates/actions/client_details.html') diff --git a/ogcp/templates/actions/client_details.html b/ogcp/templates/actions/client_details.html index 070e4d6..a718450 100644 --- a/ogcp/templates/actions/client_details.html +++ b/ogcp/templates/actions/client_details.html @@ -13,68 +13,23 @@

{{_('Client details')}}

-
-
+
+ {{ form.hidden_tag() }} {{ form.server() }} {{ form.folder_id() }} -
- -
- {{ form.name(class="form-control") }} + {% for field in form if field.type != 'CSRFToken' and field.name not in ['submit', 'remote', 'maintenance'] %} + {% if not field.flags.hidden %} +
+ +
+ {{ field(class="form-control") }} +
-
- -
- -
- {{ form.ip(class="form-control") }} -
-
- -
- -
- {{ form.mac(class="form-control") }} -
-
- -
- -
- {{ form.serial_number(class="form-control") }} -
-
- -
- -
- {{ form.livedir(class="form-control") }} -
-
- -
- -
- {{ form.repo(class="form-control") }} -
-
- -
- -
- {{ form.room(class="form-control") }} -
-
- -
- -
- {{ form.boot(class="form-control") }} -
-
+ {% endif %} + {% endfor %}
{{ form.submit(class="btn btn-primary") }} -- cgit v1.2.3-18-g5258