Files
biblio/templates/book/index.html.twig
2022-05-20 14:53:13 +02:00

50 lines
1.7 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Book index{% endblock %}
{% block body %}
<h1>Book index</h1>
<table class="table">
<thead>
<tr>
<th>Cover</th>
<th>Id</th>
<th>Title</th>
<th>Language</th>
<th>Description</th>
<th>Publisher</th>
<th>Publish_date</th>
<th>Filename</th>
<th>Original_filename</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for book in books %}
<tr>
<td>{% if file_exists(asset('book_covers/cover_' ~ book.id ~ '.jpg')) %}<img class="img-thumbnail" src="{{ asset('book_covers/cover_' ~ book.id ~ '.jpg' ) }}" /> {% endif %}</td>
<td>{{ book.id }}</td>
<td>{{ book.Title }}</td>
<td>{{ book.language }}</td>
<td>{{ book.description }}</td>
<td>{{ book.publisher }}</td>
<td>{{ book.publishDate ? book.publishDate|date('Y-m-d') : '' }}</td>
<td>{{ book.filename }}</td>
<td><a href="{{ path('app_book_download', {'id': book.id}) }} ">{{ book.originalFilename }}</a></td>
<td>
<a href="{{ path('app_book_show', {'id': book.id}) }}">show</a>
<a href="{{ path('app_book_edit', {'id': book.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="9">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_book_new') }}">Create new</a>
{% endblock %}