completed TODOs 13, 14, 15, 16 - views of subsets of books. Added 2 new TODOs to enhance their output / make the views better

This commit is contained in:
2021-01-09 01:13:26 +11:00
parent a6211928df
commit cd7a77ff6b
5 changed files with 59 additions and 16 deletions

View File

@@ -49,7 +49,11 @@
<a class="dropdown-item" href="{{url_for('books')}}">Show All</a>
<a class="dropdown-item" href="{{url_for('books_on_shelf')}}">Show Books on shelf</a>
<a class="dropdown-item" href="{{url_for('unrated_books')}}">Show Unrated_Books</a>
<a class="dropdown-item" href="{{url_for('wishlist')}}">Show Books on wishlist</a>
<a class="dropdown-item" href="{{url_for('missing_books')}}">Show Missing Books</a>
<a class="dropdown-item" href="{{url_for('poor_rating_books')}}">Show Books that scored &lt; 5/10</a>
<a class="dropdown-item" href="{{url_for('needs_replacing')}}">Show Books that Need Replacing</a>
<a class="dropdown-item" href="{{url_for('sold_books')}}">Show Books that have been Sold </a>
<a class="dropdown-item" href="{{url_for('stats')}}">Show Stats</a>
</div>
</div class="nav-item dropdown">

View File

@@ -31,16 +31,20 @@
</td>
{% if not InDBox %}
<td>{{ GetPublisherById(book.publisher)}}</td>
<td align="center">
{% set cond = GetConditionById(book.condition) %}
{% if cond == "Good" %}
<i class="fas fa-book" style="color:black"></i>
{% elif cond == "Average" %}
<i class="fas fa-book" style="color:orange"></i>
{% else %}
<i class="fas fa-book" style="color:red"></i>
{% endif %}
</td>
{% set cond = GetConditionById(book.condition) %}
{% if cond == "N/A" %}
<td>N/A</td>
{% else %}
<td align="center">
{% if cond == "Good" %}
<i class="fas fa-book" style="color:black"></i>
{% elif cond == "Average" %}
<i class="fas fa-book" style="color:orange"></i>
{% elif cond == "Needs Replacing" %}
<i class="fas fa-book" style="color:red"></i>
{% endif %}
</td>
{% endif %}
<td>{{ GetOwnedById(book.owned)}}</td>
{% endif %}
<td>{{ GetCovertypeById(book.covertype) }}</td>

16
templates/missing.html Normal file
View File

@@ -0,0 +1,16 @@
{% extends "base.html" %}
{% block main_content %}
<h3>Missing Books</h3>
<table id="missing_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
<thead>
<tr class="thead-light"><th>Books</th><th>Series</th><th>Number of Books in Series</th></tr>
</thead>
<tbody>
{% for obj in books %}
<tr><td>{{obj.missing}}</td><td><a href="{{url_for('series', id=obj.id )}}">{{obj.title}}</a></td><td>{{obj.num_books}}</td></tr>
{% endfor %}
</tbody>
</table>
{% endblock main_content %}