Files
biblio/templates/book/show.html.twig
2022-05-31 15:25:57 +02:00

75 lines
2.1 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Book{% endblock %}
{% block body %}
<h1>Book</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ book.id }}</td>
</tr>
<tr>
<th>Title</th>
<td>{{ book.Title }}</td>
</tr>
<tr>
<th>Language</th>
<td>{{ book.language }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ book.description | nl2br }}</td>
</tr>
<tr>
<th>Publisher</th>
<td>{{ book.publisher }}</td>
</tr>
<tr>
<th>Publish_date</th>
<td>{{ book.publishDate ? book.publishDate|date('Y-m-d') : '' }}</td>
</tr>
</tbody>
</table>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>File name</th>
<th class="text-end">File size</th>
<th>Extension</th>
<th>Download</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
{% for file in book.files %}
<tr>
<td>{{ file.id }}</td>
<td>{{ file.fileName }}</td>
<td class="text-end">{{ file.fileSize | bytes_format }}</td>
<td>{{ file.extension }}</td>
<td><a href="{{ path('app_file_download', {id: file.id }) }}" class="link-secondary">download</a></td>
<td><a href="{{ path('app_file_delete', {id: file.id}) }}" class="link-danger">remove</a></td>
</tr>
{% else %}
<tr>
<td colspan="6">no files found</td>
</tr>
{% endfor %}
</table>
{{ form_start(file_form) }}
{{ form_widget(file_form) }}
<button class="btn btn-primary">{{ button_label|default('Save') }}</button>
{{ form_end(file_form) }}
<a href="{{ path('app_book_index') }}">back to list</a>
<a href="{{ path('app_book_edit', {'id': book.id}) }}">edit</a>
{{ include('book/_delete_form.html.twig') }}
{% endblock %}