2018-05-23 14:18:38 +02:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
{% block main %}
|
2018-06-11 17:24:30 +02:00
|
|
|
{% from "_formhelpers.html" import render_field %}
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
function outputUpdate(sameness) {
|
|
|
|
document.querySelector('#selected-sameness').value = sameness;
|
|
|
|
}
|
|
|
|
function outputUpdate2(diversity) {
|
|
|
|
document.querySelector('#selected-diversity').value = diversity;
|
|
|
|
}
|
|
|
|
function outputUpdate3(gender) {
|
|
|
|
document.querySelector('#selected-gender').value = gender;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
2018-05-23 14:18:38 +02:00
|
|
|
<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-11 17:24:30 +02:00
|
|
|
<div style="float:right; padding-right: 300px;">
|
|
|
|
<img class="no_cover" id="{{ book.title }}" src="../uploads/cover/{{ book.cover }}" width="280px" onerror="if (this.src != '/uploads/cover/{{ book.cover }}') this.src = '/static/img/default_cover.gif';"></div>
|
2018-06-01 17:20:12 +02:00
|
|
|
|
2018-06-11 17:24:30 +02:00
|
|
|
<br>
|
2018-05-23 14:18:38 +02:00
|
|
|
<div data-toggle="fieldset" id="phone-fieldset">
|
2018-06-11 17:24:30 +02:00
|
|
|
{{ form.author.label }}*: <button type="button" data-toggle="fieldset-add-row"
|
2018-05-23 14:18:38 +02:00
|
|
|
data-target="#phone-fieldset">+</button>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
{% for author in form.author %}
|
|
|
|
<tr data-toggle="fieldset-entry">
|
2018-06-11 17:24:30 +02:00
|
|
|
<td>{{ author.author_name (size=50, class="form-control") }}</td>
|
2018-05-23 14:18:38 +02:00
|
|
|
<td><button type="button" data-toggle="fieldset-remove-row" id="phone-{{loop.index0}}-remove">-</button></td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2018-06-11 17:24:30 +02:00
|
|
|
</table><br>
|
|
|
|
<br>
|
|
|
|
Category:* <br> {{ form.category(size=50, class="form-control") }} <br><br>
|
|
|
|
Year published: <br> {{ form.year_published(size=8, class="form-control") }} <br><br>
|
|
|
|
|
|
|
|
How different is this item to the rest of the collection?
|
|
|
|
Or is it more of the same? <br>
|
|
|
|
{{ form.sameness(min=0, max=100, oninput="outputUpdate(value)") }}
|
|
|
|
<span style="color: #d3d3d3;"><output for="sameness" id="selected-sameness">{{ form.sameness.data }} </output> % different</span>
|
|
|
|
|
|
|
|
<br><hr align="left" style="width:40%;"><br>
|
|
|
|
|
|
|
|
Check the bibliography. How diverse are the references in this book? <br>
|
|
|
|
{{ form.diversity(min=0, max=100, oninput="outputUpdate2(value)") }}
|
|
|
|
<span style="color: #d3d3d3;"><output for="diversity" id="selected-diversity">{{ form.diversity.data }} </output> % diverse</span>
|
|
|
|
|
|
|
|
<br><hr align="left" style="width:40%;"><br>
|
|
|
|
|
|
|
|
Check the writing. Who is speaking? Is the voice more often male or female? <br>
|
|
|
|
{{ form.gender(min=1, max=100, oninput="outputUpdate3(value)") }}
|
|
|
|
<span style="color: #d3d3d3;"><output for="diversity" id="selected-gender">{{ form.gender.data }} </output> % female</span>
|
|
|
|
|
|
|
|
<br><hr align="left" style="width:40%;"><br>
|
|
|
|
Who are you? {{ render_field(form.who)}}
|
|
|
|
<br><hr align="left" style="width:40%;"><br>
|
|
|
|
|
2018-06-09 22:05:47 +02:00
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
2018-06-11 17:24:30 +02:00
|
|
|
Current file: {{ book.file }} Upload new file: {{form.file}}
|
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-11 17:24:30 +02:00
|
|
|
|
2018-06-09 22:05:47 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group" style="padding-bottom: 10px;">
|
|
|
|
|
2018-06-11 17:24:30 +02:00
|
|
|
If uploading, write a new message: <br>{{form.message(size=135, 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 %}
|