moved to using a Get*ById() in condition, covertype, owned files and exposing them in jinja and using them in books.html to fix-up the fact those columns were now raw forein keys (ids)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
{% block main_content %}
|
||||
<h3>All Books</h1>
|
||||
<h3>All Books</h1>
|
||||
<table id="book_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
|
||||
<thead>
|
||||
<tr class="thead-light"><th>Title</th><th>Author</th><th>Publisher</th><th>Condition</th><th>Owned</th><th>Covertype</th></tr>
|
||||
@@ -16,16 +16,17 @@
|
||||
<td>{{ book.author[0]['surname'] }}, {{book.author[0]['firstnames']}}</td>
|
||||
<td>{{ book.publisher[0]['name']}}</td>
|
||||
<td align="center">
|
||||
{% if book.condition == "Good" %}
|
||||
{% set cond = GetConditionById(book.condition) %}
|
||||
{% if cond == "Good" %}
|
||||
<i class="fas fa-book" style="color:black"></i>
|
||||
{% elif book.condition == "Average" %}
|
||||
{% elif cond == "Average" %}
|
||||
<i class="fas fa-book" style="color:orange"></i>
|
||||
{% else %}
|
||||
<i class="fas fa-book" style="color:red"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ book.owned}}</td>
|
||||
<td>{{ book.covertype}}</td>
|
||||
<td>{{ GetOwnedById(book.owned)}}</td>
|
||||
<td>{{ GetCovertypeById(book.covertype) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user