xppl/app/templates/show_book_detail.html

116 lines
3.8 KiB
HTML
Raw Normal View History

2018-05-20 00:10:01 +02:00
{% extends 'base.html' %}
{% block main %}
<div class="container">
2018-06-11 19:16:06 +02:00
2018-05-20 00:10:01 +02:00
<h1 class="header">{{ book.title }}</h1>
2018-06-11 12:00:48 +02:00
<div style="float:right; padding-right: 140px;">
<img class="no_cover" id="{{ book.title }}" src="../cover/{{ book.cover }}" width="280px" onerror="if (this.src != '../cover/{{ book.cover }}') this.src = '../static/img/default_cover.gif';"></div>
2018-05-23 14:12:24 +02:00
2018-06-12 19:54:22 +02:00
<table class="library_table" id="table" style="width:50%; padding-bottom: 180px;">
2018-06-11 12:00:48 +02:00
<thead>
<tr id="header">
<th style="width: 150px;"></th>
<th style="width: 300px;"></th>
</tr>
</thead>
<tbody>
2018-06-10 17:41:44 +02:00
<tr>
<td>Year published: </td>
<td>{{ book.year_published or ''}}</td>
</tr>
<tr>
<td> Author(s): </td>
<td>{% for author in book.authors %}
2018-06-11 12:00:48 +02:00
<a href="{{url_for('show_author_by_id', id=author.id)}}">{{ author.author_name }}</a><br>
{% endfor %}</td>
2018-06-10 17:41:44 +02:00
</tr>
<tr>
<td>Category: </td>
<td>{{ book.category }}</td>
</tr>
2018-06-11 12:00:48 +02:00
<tr>
2018-06-10 17:41:44 +02:00
<td>Included in stack(s): </td>
<td>{% for stack in book.stacks %}
2018-05-31 18:04:05 +02:00
<li><a href="{{url_for('show_stack_by_id', id=stack.id)}}">{{ stack.stack_name }}</a>
2018-06-10 17:41:44 +02:00
<p style="font-size: 10px;"><a href="{{url_for('remove_from_stack', stackid=stack.id, bookid=book.id)}}"> Remove from stack</a>{% endfor %}</td>
</tr>
2018-06-11 12:00:48 +02:00
<tr>
2018-06-11 13:51:24 +02:00
<td></td>
2018-06-11 12:00:48 +02:00
<td></td>
</tr>
<tr>
2018-06-11 13:51:24 +02:00
<td style="font-style: italic;">Notes from uploader</td>
2018-06-11 12:00:48 +02:00
<td></td>
</tr>
<tr>
<td>How different is this item to the rest of the collection?<br></td>
<td>{{ book.sameness or '?'}} % different</td>
</tr>
<tr>
<td>How diverse are the references in this book?<br></td>
<td>{{ book.diversity or '?' }} % diverse </td>
</tr>
<tr>
<td>Who is speaking?<br></td>
<td>{{ book.gender or '?' }} % female </td>
</tr>
<tr>
<td>Who is uploading<br></td>
<td>{{ book.who or '?' }} </td>
</tr>
2018-05-31 18:04:05 +02:00
2018-06-11 19:20:59 +02:00
<tr>
<td>Instances:</td>
<td>{% set got = {} %}
{% set all = 1 %}
{% for instance in book.instances %}
2018-05-31 18:04:05 +02:00
2018-06-11 19:20:59 +02:00
{% 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 %}
2018-05-31 18:04:05 +02:00
2018-06-11 19:20:59 +02:00
{% for instance, value in got.items() %}
{% set result = value/(book.instances|length) %}
{{ instance }}: {{ (result*100)|round|int }}%<br>
{% endfor %}</td>
2018-06-10 12:15:07 +02:00
2018-06-11 19:20:59 +02:00
</tbody>
</table>
{%if light%}
{%else%}
2018-06-11 19:24:53 +02:00
<br>
<a href="{{url_for('add_to_stack', id=book.id)}}">Add book to Stack ===></a> <br><br>
2018-06-10 12:15:07 +02:00
<br>
2018-05-20 00:10:01 +02:00
2018-06-11 19:16:06 +02:00
{% 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">&times;</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>
2018-06-11 19:24:53 +02:00
{% else %}
2018-06-11 19:16:06 +02:00
{% endif %}
2018-06-10 11:16:47 +02:00
<a href="{{ url_for('edit_book_by_id', id=book.id )}}"><button style= "font-size: 10pt;"> edit</button></a>
<a href="{{ url_for('remove_book_by_id', id=book.id)}}"><button style= "font-size: 10pt;"> delete</button></a>
<br><br>
2018-06-12 19:54:22 +02:00
<br><br>
{%endif%}
<hr>
2018-06-11 13:51:24 +02:00
{% if previousbook %}
2018-06-12 19:54:22 +02:00
<a href="{{ url_for('show_book_by_id', id=previousbook.id )}}" style="font-size: 10pt;"> < see the previous book added to XPPL: &nbsp;<i>{{ previousbook.title |truncate(40,True,'...') }} </i></a> {% endif %}
2018-06-11 13:51:24 +02:00
{% if nextbook %}
2018-06-12 19:54:22 +02:00
<a href="{{ url_for('show_book_by_id', id=nextbook.id )}}" style="float:right; font-size: 10pt;"> see the next book added to XPPL: &nbsp;<i>{{ nextbook.title|truncate(40,True,'...')}} </i>> </a>{% endif %}
2018-05-20 00:10:01 +02:00
</div>
2018-05-20 00:10:01 +02:00
{% endblock %}