2018-05-23 14:18:38 +02:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
<div class="container">
|
|
|
|
|
|
|
|
<a href="{{ url_for('show_book_by_id', id=book.id )}}">back</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-07 09:59:08 +02:00
|
|
|
<form method="POST" action="{{ url_for('edit_book_by_id', id=book.id )}}" enctype=multipart/form-data>
|
2018-05-23 14:18:38 +02:00
|
|
|
{{ form.csrf_token }}
|
|
|
|
|
|
|
|
<div class="form-group"><h1 class="header">{{ form.title.label }} {{ form.title(size=20, class="form-control") }}</h1></div>
|
2018-06-01 21:37:45 +02:00
|
|
|
|
2018-06-07 19:10:56 +02:00
|
|
|
<img class="no_cover" id="{{ book.title }}" src="/uploads/cover/{{ book.cover }}" width="150" onerror="if (this.src != '/uploads/cover/{{ book.cover }}') this.src = '/static/img/default_cover.gif';">
|
2018-06-01 17:20:12 +02:00
|
|
|
|
2018-05-23 14:18:38 +02:00
|
|
|
<br> <br>
|
|
|
|
<div data-toggle="fieldset" id="phone-fieldset">
|
|
|
|
{{ form.author.label }} <button type="button" data-toggle="fieldset-add-row"
|
|
|
|
data-target="#phone-fieldset">+</button>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
{% for author in form.author %}
|
|
|
|
<tr data-toggle="fieldset-entry">
|
|
|
|
<td>{{ author.author_name }}</td>
|
|
|
|
<td><button type="button" data-toggle="fieldset-remove-row" id="phone-{{loop.index0}}-remove">-</button></td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2018-06-01 21:37:45 +02:00
|
|
|
</div><br>
|
2018-06-09 22:05:47 +02:00
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
|
|
|
Category: {{ form.category(size=20,
|
2018-06-07 09:59:08 +02:00
|
|
|
class="form-control") }}
|
2018-06-09 22:05:47 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
|
|
|
Year published: {{ form.year_published(size=8, class="form-control") }}
|
2018-06-07 09:59:08 +02:00
|
|
|
</div>
|
2018-06-09 22:05:47 +02:00
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
2018-06-07 09:59:08 +02:00
|
|
|
Current file: {{ book.file }}
|
|
|
|
</div>
|
2018-06-09 22:05:47 +02:00
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
2018-06-07 09:59:08 +02:00
|
|
|
Upload new file: {{form.file}}
|
2018-06-09 22:05:47 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
|
|
|
|
|
|
|
If uploading, write a new message: {{form.message(size=150, class="form-control") }}
|
2018-06-07 09:59:08 +02:00
|
|
|
|
2018-06-01 21:37:45 +02:00
|
|
|
</div>
|
2018-05-23 14:18:38 +02:00
|
|
|
<br>
|
|
|
|
<button type="submit" class="btn btn-primary">Update</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|