Displaying files attached to a book.

This commit is contained in:
krzysiej
2022-05-23 15:35:24 +02:00
parent dddd432e3b
commit 319f6311fc
3 changed files with 53 additions and 26 deletions

View File

@@ -21,7 +21,7 @@
<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>{% if file_exists(asset('book_covers/cover_' ~ book.id ~ '.jpg')) %}<img class="img-thumbnail" style="max-width: 80px" src="{{ asset('book_covers/cover_' ~ book.id ~ '.jpg' ) }}" /> {% endif %}</td>
<td>{{ book.id }}</td>
<td>{{ book.Title }}</td>
<td>{{ book.language }}</td>

View File

@@ -7,33 +7,61 @@
<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 }}</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>
<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 }}</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>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>{{ file.fileSize }}</td>
<td>{{ file.extension }}</td>
<td>download</td>
<td>remove</td>
</tr>
{% else %}
<tr>
<td colspan="6">no files found</td>
</tr>
{% endfor %}
</table>
<a href="{{ path('app_book_index') }}">back to list</a>
<a href="{{ path('app_book_edit', {'id': book.id}) }}">edit</a>