Added table for tracking progress of a book.

This commit is contained in:
krzysiej
2022-06-06 15:33:20 +02:00
parent f715f401e1
commit 21743d032c
5 changed files with 216 additions and 9 deletions

View File

@@ -3,10 +3,13 @@
{% block title %}Book{% endblock %}
{% block body %}
<div class="progress" style="height: 2px;">
<div class="progress-bar" role="progressbar" style="width: {{ (book.getProgress().first().pages / book.pages*100) | round }}%"></div>
<div class="progress-bar bg-secondary bg-opacity-10" role="progressbar" style="width: {{ 100-(book.getProgress().first().pages / book.pages*100) | round }}%"></div>
</div>
<div class="d-flex">
<div>
{% if file_exists(asset('book_covers/cover_' ~ book.id ~ '.jpg')) %}
<img class="img-thumbnail"
style="max-width: 80px"
@@ -38,9 +41,7 @@
</tr>
<tr>
<th>Isbn</th>
<td>{{ book.isbn }}</td>
<th>Pages</th>
<td>{{ book.pages }}</td>
<td colspan="3">{{ book.isbn }}</td>
</tr>
<tr>
<th>Tags</th>
@@ -54,6 +55,13 @@
<th>Language</th>
<td colspan="3">{{ book.language }}</td>
</tr>
<tr>
<th>Progress</th>
<td>{{ book.getProgress().first().pages }}</td>
<th>Pages</th>
<td>{{ book.pages }}</td>
</tr>
</tbody>
</table>