use a for loop to go through fields, rather than hardcode just name, now it is used to edit authors too

This commit is contained in:
2020-12-05 19:22:14 +11:00
parent 4268b03ff6
commit 92fd582981

View File

@@ -1,6 +1,6 @@
{% extends "base.html" %} {% block main_content %}
<div class="container">
<h3><center>{{page_title}}</center></h3>
<h3 class="offset-lg-2">{{page_title}}</h3>
{% if message|length %}
<div class="row alert alert-{{alert}}">
{{message}}
@@ -8,12 +8,16 @@
{% endif %}
<div class="row">
<form class="form form-inline col-xl-12" action="" method="POST">
{{ form.id }}
{{ form.csrf_token }}
<div class="form-row col-lg-12">
{{ form.name.label( class="col-lg-2" ) }}
{{ form.name( class="form-control col-lg-2" ) }}
</div class="form-row">
{% for field in form %}
{% if field.type == 'HiddenField' or field.type == 'CSRFTokenField' %}
{{field}}<br>
{% elif field.type != 'SubmitField' %}
<div class="form-row col-lg-12">
{{ field.label( class="col-lg-2" ) }}
{{ field( class="form-control col-lg-4" ) }}
</div class="form-row col-lg-12">
{% endif %}
{% endfor %}
<div class="row col-lg-12">
<br>
</div class="row">