|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
|
|
|
|
|
<h1 class="header">{{ book.title }}</h1>
|
|
|
|
|
<div style="float:right; padding-right: 140px;">
|
|
|
|
|
<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>
|
|
|
|
@ -61,44 +60,43 @@
|
|
|
|
|
<td>{{ book.who or '?' }} </td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<a href="{{url_for('add_to_stack', id=book.id)}}">Add book to Stack ===></a> <br><br>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>Instances:</td>
|
|
|
|
|
<td>{% set got = {} %}
|
|
|
|
|
{% set all = 1 %}
|
|
|
|
|
{% for instance in book.instances %}
|
|
|
|
|
|
|
|
|
|
<a href="../uploads/{{ book.file }}">download {{ book.fileformat }}</a>
|
|
|
|
|
<br>
|
|
|
|
|
<br>
|
|
|
|
|
<p>Instances:</p>
|
|
|
|
|
{% set got = {} %}
|
|
|
|
|
{% set all = 1 %}
|
|
|
|
|
{% for instance in book.instances %}
|
|
|
|
|
{% if instance.name in got %}
|
|
|
|
|
{% set x=got.__setitem__(instance.name, got[instance.name]+1) %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% set x=got.__setitem__(instance.name, 1) %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% set all = loop.index %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
{% if instance.name in got %}
|
|
|
|
|
{% set x=got.__setitem__(instance.name, got[instance.name]+1) %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% set x=got.__setitem__(instance.name, 1) %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% set all = loop.index %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% for instance, value in got.items() %}
|
|
|
|
|
{% set result = value/(book.instances|length) %}
|
|
|
|
|
{{ instance }}: {{ (result*100)|round|int }}%<br>
|
|
|
|
|
{% endfor %}</td>
|
|
|
|
|
|
|
|
|
|
{% for instance, value in got.items() %}
|
|
|
|
|
{% set result = value/(book.instances|length) %}
|
|
|
|
|
{{ instance }}: {{ (result*100)|round|int }}%<br>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<br>
|
|
|
|
|
<a href="{{url_for('add_to_stack', id=book.id)}}">Add book to Stack ===></a> <br><br>
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% if book.file %}
|
|
|
|
|
<button id="myBtn" style= "width: 180px; font-size: 10pt;"><a> Download this {{ book.fileformat }}</a></button>
|
|
|
|
|
<div id="myModal" class="modal">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<span class="close">×</span>
|
|
|
|
|
<h3>A message from the uploading librarian:</h3>
|
|
|
|
|
<span style="font-style: italic;">"{{book.message or '...'}}" </span><br>
|
|
|
|
|
<h4><a href="../uploads/{{ book.file }}"> >>>> Link to file <<<<</h4></a></div>
|
|
|
|
|
</div>
|
|
|
|
|
{% else %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if book.file %}
|
|
|
|
|
<button id="myBtn" style= "width: 180px; font-size: 10pt;"><a> Download this {{ book.fileformat }}</a></button>
|
|
|
|
|
<div id="myModal" class="modal">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<span class="close">×</span>
|
|
|
|
|
<h3>A message from the uploading librarian:</h3>
|
|
|
|
|
<span style="font-style: italic;">"{{book.message or '...'}}" </span><br>
|
|
|
|
|
<h4><a href="../uploads/{{ book.file }}"> >>>> Link to file <<<<</h4></a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% else %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
<button style= "font-size: 10pt;"> <a href="{{ url_for('edit_book_by_id', id=book.id )}}">edit</a></button>
|
|
|
|
|
<button style= "font-size: 10pt;"> <a href="{{ url_for('remove_book_by_id', id=book.id)}}">delete</a></button>
|
|
|
|
|