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