xppl/app/templates/results.html

109 lines
3.2 KiB
HTML
Raw Normal View History

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">
<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>
<button type="submit" class="button">Search</button>
</form>
<div class="container">
<h1 class="page-header">Search Results for: {{ query }}</h1>
{% 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 %}
<table class="library_table" id="table" style="width:100%">
<tr id="header">
<th>Cover</th>
2018-05-31 18:26:22 +02:00
<th>Title</th>
<th>Author</th>
<th>Filetype</th>
<th>Category</th>
<th>Stack</th>
2018-06-05 18:26:25 +02:00
<th>Add to stack</th>
2018-05-31 18:26:22 +02:00
</tr>
{% for book in books %}
<tr>
<td><img class="no_cover" id="{{ book.title }}" src="/uploads/cover/{{ book.cover }}" width="80" onerror="if (this.src != '/static/img/default_cover.png') 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>
<td>{{ book.fileformat }}</td>
<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-05 18:26:25 +02:00
<td id='plus'><a href='{{url_for('add_to_stack', id=book.id)}}'>
==>
</a></td>
2018-05-31 18:26:22 +02:00
{% endfor %}
</table>
</div>
<div class="container" >
<hr>
<h2> Other books </h2>
<table class="library_table" id="table" style="width:100%">
<tr id="header">
<th>Cover</th>
2018-05-31 18:26:22 +02:00
<th>Title</th>
<th>Author</th>
<th>Filetype</th>
<th>Category</th>
<th>Stack</th>
2018-06-05 18:26:25 +02:00
<th>Add to stack</th>
2018-05-31 18:26:22 +02:00
</tr>
{% for book in books_all %}
<tr>
<td><img class="no_cover" id="{{ book.title }}" src="/uploads/cover/{{ book.cover }}" width="80" onerror="if (this.src != '/static/img/default_cover.png') 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>
<td>{{ book.fileformat }}</td>
<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-05 18:26:25 +02:00
<td id='plus'><a href='{{url_for('add_to_stack', id=book.id)}}'>
==>
</a></td>
2018-05-31 18:26:22 +02:00
{% endfor %}
</table>
<p>
<a href="/books"> See all books </a>
</p>
</div>
{% endblock %}