xppl/app/templates/show_books.html

45 lines
1.1 KiB
HTML
Raw Normal View History

2018-05-20 00:10:01 +02:00
{% extends 'base.html' %}
{% block main %}
<div class="container">
<h1 class="page-header">All Books</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 %}
2018-05-27 22:11:35 +02:00
<table class="library_table" style="width:100%">
2018-05-20 00:10:01 +02:00
<tr>
2018-05-23 14:12:24 +02:00
<th>Cover</th>
2018-05-20 00:10:01 +02:00
<th>Title</th>
<th>Author</th>
2018-05-23 14:12:24 +02:00
<th>Filetype</th>
2018-05-27 22:11:35 +02:00
<th>Category</th>
2018-05-20 00:10:01 +02:00
</tr>
2018-05-27 22:11:35 +02:00
{% for book in books|sort(attribute='title', reverse = False) %}
2018-05-20 00:10:01 +02:00
<tr>
2018-05-23 14:12:24 +02:00
<td><img src="../uploads/cover/{{ book.cover }}" width="80"></td>
2018-05-27 22:11:35 +02:00
<td class="title_col"><a href="books/{{ book.id }}">{{ book.title }}</a></td>
2018-05-23 14:42:52 +02:00
2018-05-27 22:11:35 +02:00
<td class="author_col"> {% for author in book.authors %}
2018-05-23 14:12:24 +02:00
2018-05-23 17:50:01 +02:00
<li><a href="{{url_for('show_author_by_id', id=author.id)}}">{{ author.author_name }}</a> </li>
2018-05-23 14:12:24 +02:00
{% endfor %}</td>
<td>{{ book.fileformat }}</td>
2018-05-27 22:11:35 +02:00
<td>{{ book.category}}</td>
2018-05-20 00:10:01 +02:00
</tr>
{% endfor %}
</table>
</div>
{% endblock %}