42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block main_content %}
|
|
<div class="container">
|
|
<h3 class="offset-2">{{page_title}}</h3>
|
|
<div class="row">
|
|
<form action="" method="POST">
|
|
{% for field in form %}
|
|
{% if field.type == 'HiddenField' or field.type == 'CSRFTokenField' %}
|
|
{{field}}
|
|
{% elif field.type != 'SubmitField' %}
|
|
<div class="input-group">
|
|
{{ field.label( class="input-group-text col-2 justify-content-end" ) }}
|
|
{% if field.type == 'SelectField' %}
|
|
{{ field( class="form-select col-9" ) }}
|
|
{% else %}
|
|
{{ field( class="form-control col-9" ) }}
|
|
{% endif %}
|
|
</div class="">
|
|
{% endif %}
|
|
{% endfor %}
|
|
<div class="form-row col-12">
|
|
{{form.submit(class="btn btn-primary offset-2 col-2 mt-4" )}}
|
|
</div class="row">
|
|
</div class="form">
|
|
</div class="row">
|
|
</div class="container">
|
|
{% if page_title == 'Edit Author' %}
|
|
<div class="row mt-5">
|
|
<div class="offset-1 col-10" id="books_by_author">
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock main_content %}
|
|
|
|
{% block script_content %}
|
|
{% if object %}
|
|
<script>
|
|
$.get( "/author/{{object.id}}/books", function(data) { $('#books_by_author').html(data) } );
|
|
</script>
|
|
{% endif %}
|
|
{% endblock script_content %}
|