xppl/app/templates/add_book.html

130 lines
4.1 KiB
HTML
Raw Normal View History

2018-05-20 00:10:01 +02:00
{% extends 'base.html' %}
{% block main %}
2018-06-11 12:00:48 +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-06-10 17:41:44 +02:00
<div class="container" style="float: left; width:50%;">
<div style="width: 98%; border-right: dashed; border-width: 1px;">
2018-05-20 00:10:01 +02:00
<h1 class="page-header">Add Book</h1>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert alert-danger">
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endwith %}
<form method="POST" action="{{ url_for('add_book') }}" enctype=multipart/form-data>
{{ form.csrf_token }}
2018-06-11 12:00:48 +02:00
<div class="form-group">Title:* <br> {{ form.title (size=50, class="form-control") }}</div>
2018-05-23 14:12:24 +02:00
<br>
<div data-toggle="fieldset" id="phone-fieldset">
2018-06-11 17:57:22 +02:00
Author(s):* <button type="button" data-toggle="fieldset-add-row" data-target="#phone-fieldset">+</button>
2018-05-23 14:12:24 +02:00
<table>
<tr>
<th></th>
<th></th>
</tr>
{% for author in form.author %}
<tr data-toggle="fieldset-entry">
2018-06-11 12:00:48 +02:00
<td>{{ author.author_name (size=50)}}</td>
2018-05-23 14:12:24 +02:00
<td><button type="button" data-toggle="fieldset-remove-row" id="phone-{{loop.index0}}-remove">-</button></td>
</tr>
{% endfor %}
</table>
</div>
<br>
2018-06-11 12:00:48 +02:00
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)") }} &nbsp;
<span style="color: #d3d3d3;"><output for="sameness" id="selected-sameness">{{ form.sameness.data }} </output> % different</span>
<br><hr align="left" style="width:96%;"><br>
Check the bibliography. How diverse are the references in this book? <br>
{{ form.diversity(min=0, max=100, oninput="outputUpdate2(value)") }} &nbsp;
<span style="color: #d3d3d3;"><output for="diversity" id="selected-diversity">{{ form.diversity.data }} </output> % diverse</span>
<br><hr align="left" style="width:96%;"><br>
Check the writing. Who is speaking? Is the voice more often male or female? <br>
2018-06-11 17:24:30 +02:00
{{ form.gender(min=1, max=100, oninput="outputUpdate3(value)") }} &nbsp;
2018-06-11 12:00:48 +02:00
<span style="color: #d3d3d3;"><output for="diversity" id="selected-gender">{{ form.gender.data }} </output> % female</span>
<br><hr align="left" style="width:96%;"><br>
Who are you? {{ render_field(form.who) }}
<br><hr align="left" style="width:96%;"><br>
2018-06-10 17:41:44 +02:00
<div style="width: 40%;">
Add a message for future readers: {{ form.message(size=90, class="form-control") }}
<br></div>
2018-06-09 15:41:21 +02:00
<br>
2018-05-20 00:10:01 +02:00
{{ form.file }}
2018-05-31 18:26:22 +02:00
{{ form.upload }}
{{ form.wish }}
2018-06-11 12:00:48 +02:00
2018-06-08 17:56:20 +02:00
</div>
2018-05-20 00:10:01 +02:00
</form>
2018-06-10 17:41:44 +02:00
</div>
<div>
2018-06-11 12:00:48 +02:00
<table class="library_table" id="table" style="width:30% padding:10px; padding-bottom: 400px;" >
2018-06-10 17:41:44 +02:00
<thead>
<tr id="header" style="height:15px;">
<th style="width: 10%;"> <h5> Currently in the library </h5></th>
<th style="width: 20%;"></th>
</tr>
</thead>
<tbody>
<tr>
<td> Titles: </td>
<td> {{ books_all }}</td>
</tr>
<tr>
<td> Authors: </td>
<td> {{ authors_all }} </td>
</tr>
<tr>
<td> Categories: </td>
<td> {{ categories|replace('[', '')|replace(']', '') }}</td>
</tr>
<tr>
<td> Stacks: </td>
<td> {{ stacks_all|replace('[', '')|replace(']', '') }}</td>
</tr>
<tr>
<td> From the years: </td>
<td> {{earliest}} {{latest}}</td>
</tr>
<tr>
<td> Gaps in the collection: </td>
<td> At least {{ books_potential }} potential books missing</td>
</tr>
2018-05-20 00:10:01 +02:00
2018-06-10 17:41:44 +02:00
</tbody>
</table>
</div>
2018-05-20 00:10:01 +02:00
</div>
2018-06-11 12:00:48 +02:00
<clear>
2018-05-20 00:10:01 +02:00
{% endblock %}