From 92fd582981e1471cc29478acefd9fc99aed1d8ae Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 5 Dec 2020 19:22:14 +1100 Subject: [PATCH] use a for loop to go through fields, rather than hardcode just name, now it is used to edit authors too --- templates/edit_id_name.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/edit_id_name.html b/templates/edit_id_name.html index 4f91d04..11037cf 100644 --- a/templates/edit_id_name.html +++ b/templates/edit_id_name.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block main_content %}
-

{{page_title}}

+

{{page_title}}

{% if message|length %}
{{message}} @@ -8,12 +8,16 @@ {% endif %}
- {{ form.id }} - {{ form.csrf_token }} -
- {{ form.name.label( class="col-lg-2" ) }} - {{ form.name( class="form-control col-lg-2" ) }} -
+ {% for field in form %} + {% if field.type == 'HiddenField' or field.type == 'CSRFTokenField' %} + {{field}}
+ {% elif field.type != 'SubmitField' %} +
+ {{ field.label( class="col-lg-2" ) }} + {{ field( class="form-control col-lg-4" ) }} +
+ {% endif %} + {% endfor %}