2018-05-31 18:26:22 +02:00
|
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
<div class="container">
|
|
|
|
|
{% from "_formhelpers.html" import render_field %}
|
|
|
|
|
<form method="POST">
|
2018-06-01 17:20:12 +02:00
|
|
|
|
<div>{{ form.select(style="width: 100px; margin: 10px; float: left; font-size: 20px") }}</div>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
<div class="search">
|
|
|
|
|
{{ render_field(form.search) }} </div>
|
2018-06-07 10:46:14 +02:00
|
|
|
|
<button type="submit" class="button">browse</button>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<p><br>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{{ form.grid(style="font-size:20px")}}{{ form.listview(style="font-size:20px")}}</p>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
</form>
|
2018-06-07 10:46:14 +02:00
|
|
|
|
</div>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
|
2018-06-07 10:46:14 +02:00
|
|
|
|
<br>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
<h3 style="line-height:0px;">Results: "{{ query }}" included in {{ count }} out of {{ whole }} items </h3>
|
2018-06-07 10:46:14 +02:00
|
|
|
|
<div style="height: 20px; background-color: yellow; line-height:4px;">
|
|
|
|
|
<div style="background-color: black; width: {{ percentage }}%; height: 100%;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<br>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
{% with messages = get_flashed_messages() %}
|
|
|
|
|
{% if messages %}
|
|
|
|
|
<div class="alert alert-success">
|
|
|
|
|
<ul>
|
|
|
|
|
{% for message in messages %}
|
|
|
|
|
<li>{{ message }}</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endwith %}
|
|
|
|
|
|
2018-06-10 12:29:09 +02:00
|
|
|
|
<table class="library_table" id="table" style="width:100%; padding-bottom:60px;">
|
2018-06-01 17:20:12 +02:00
|
|
|
|
<tr id="header">
|
2018-06-07 23:33:22 +02:00
|
|
|
|
<th width="70px;">Cover</th>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
<th>Title</th>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="400px;">Author</th>
|
2018-06-09 18:13:18 +02:00
|
|
|
|
<th width="100px;">Year</th>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="100px;">Category</th>
|
|
|
|
|
<th width="100px;">Stack</th>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%if light%}
|
|
|
|
|
{%else%}
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="100px;">Add to stack</th>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%endif%}
|
2018-05-31 18:26:22 +02:00
|
|
|
|
</tr>
|
|
|
|
|
{% for book in books %}
|
|
|
|
|
<tr>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<td style= "padding: 5px;">
|
2018-06-13 20:29:25 +02:00
|
|
|
|
<img class="no_cover" id="{{ book.title }}" src="/cover/{{ book.cover }}" width="70" onerror="if (this.src != '/cover/{{ book.cover }}') this.src = '/static/img/default_cover.png';"></td>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
<td><a href="{{url_for('show_book_by_id', id=book.id)}}">{{ book.title }}</a></td>
|
|
|
|
|
|
|
|
|
|
<td> {% for author in book.authors %}
|
|
|
|
|
|
|
|
|
|
<li><a href="{{url_for('show_author_by_id', id=author.id)}}">{{ author.author_name }}</a> </li>
|
|
|
|
|
|
|
|
|
|
{% endfor %}</td>
|
2018-06-09 19:27:55 +02:00
|
|
|
|
<td>{{ book.year_published or '––'}}</td>
|
2018-06-01 17:20:12 +02:00
|
|
|
|
<td>{{ book.category}}</td>
|
|
|
|
|
<td> {% for stack in book.stacks %}
|
|
|
|
|
|
|
|
|
|
<li><a href="{{url_for('show_stack_by_id', id=stack.id)}}">{{ stack.stack_name }}</a> </li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</td>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%if light%}
|
|
|
|
|
{%else%}
|
2018-06-07 10:46:14 +02:00
|
|
|
|
<td id='plus'><a href="{{url_for('add_to_stack', id=book.id)}}">
|
2018-06-05 18:26:25 +02:00
|
|
|
|
==>
|
|
|
|
|
</a></td>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%endif%}
|
2018-06-07 10:46:14 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
|
2018-05-31 18:26:22 +02:00
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</div>
|
2018-06-10 12:29:09 +02:00
|
|
|
|
<br>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
|
2018-06-09 19:27:55 +02:00
|
|
|
|
<div class="container" style= "border-top: dashed; border-width: 1px;" >
|
2018-06-10 12:29:09 +02:00
|
|
|
|
<h2> More books </h2>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
|
2018-06-01 17:20:12 +02:00
|
|
|
|
<table class="library_table" id="table" style="width:100%">
|
|
|
|
|
<tr id="header">
|
2018-06-07 23:33:22 +02:00
|
|
|
|
<th width="70px;">Cover</th>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
<th>Title</th>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="400px;">Author</th>
|
2018-06-09 18:13:18 +02:00
|
|
|
|
<th width="100px;">Year</th>
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="100px;">Category</th>
|
|
|
|
|
<th width="100px;">Stack</th>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%if light%}
|
|
|
|
|
{%else%}
|
2018-06-07 19:10:56 +02:00
|
|
|
|
<th width="100px;">Add to stack</th>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%endif%}
|
2018-05-31 18:26:22 +02:00
|
|
|
|
</tr>
|
|
|
|
|
{% for book in books_all %}
|
|
|
|
|
<tr>
|
2018-06-13 20:29:25 +02:00
|
|
|
|
<td style= "padding: 5px;"><img class="no_cover" id="{{ book.title }}" src="/cover/{{ book.cover }}" width="80" onerror="if (this.src != '/cover/{{ book.cover }}') this.src = '/static/img/default_cover.png';"></td>
|
2018-05-31 18:26:22 +02:00
|
|
|
|
<td><a href="{{url_for('show_book_by_id', id=book.id)}}">{{ book.title }}</a></td>
|
|
|
|
|
|
|
|
|
|
<td> {% for author in book.authors %}
|
|
|
|
|
|
|
|
|
|
<li><a href="{{url_for('show_author_by_id', id=author.id)}}">{{ author.author_name }}</a> </li>
|
|
|
|
|
|
|
|
|
|
{% endfor %}</td>
|
2018-06-09 19:27:55 +02:00
|
|
|
|
<td>{{ book.year_published or '––'}}</td>
|
2018-06-01 17:20:12 +02:00
|
|
|
|
<td>{{ book.category}}</td>
|
|
|
|
|
<td> {% for stack in book.stacks %}
|
|
|
|
|
|
|
|
|
|
<li><a href="{{url_for('show_stack_by_id', id=stack.id)}}">{{ stack.stack_name }}</a> </li>
|
2018-06-07 10:46:14 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
|
2018-06-01 17:20:12 +02:00
|
|
|
|
</td>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%if light%}
|
|
|
|
|
{%else%}
|
2018-06-07 10:46:14 +02:00
|
|
|
|
<td id='plus'><a href="{{url_for('add_to_stack', id=book.id)}}">
|
2018-06-05 18:26:25 +02:00
|
|
|
|
==>
|
|
|
|
|
</a></td>
|
2018-06-12 13:17:02 +02:00
|
|
|
|
{%endif%}
|
2018-05-31 18:26:22 +02:00
|
|
|
|
{% endfor %}
|
|
|
|
|
</table>
|
|
|
|
|
<p>
|
|
|
|
|
<a href="/books"> See all books </a>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|