display series info at bottom of book.html
This commit is contained in:
2
main.py
2
main.py
@@ -109,7 +109,7 @@ class BookSchema(ma.SQLAlchemyAutoSchema):
|
|||||||
publisher = ma.Nested(PublisherSchema, many=True)
|
publisher = ma.Nested(PublisherSchema, many=True)
|
||||||
genre = ma.Nested(GenreSchema, many=True)
|
genre = ma.Nested(GenreSchema, many=True)
|
||||||
loan = ma.Nested(LoanSchema, many=True)
|
loan = ma.Nested(LoanSchema, many=True)
|
||||||
series = ma.Nested(Book_Series_LinkSchema, many=True)
|
series = ma.Nested(SeriesSchema, many=True)
|
||||||
parent_ref = ma.Nested(Book_Sub_Book_LinkSchema, many=True)
|
parent_ref = ma.Nested(Book_Sub_Book_LinkSchema, many=True)
|
||||||
child_ref = ma.Nested(Book_Sub_Book_LinkSchema, many=True)
|
child_ref = ma.Nested(Book_Sub_Book_LinkSchema, many=True)
|
||||||
class Meta: model = Book
|
class Meta: model = Book
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<h3><center>View/Edit Book</center></h1>
|
<h3><center>View/Edit Book</center></h1>
|
||||||
{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
|
{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
|
||||||
<div class="container-fluid"><div class="row"><form class="form col-lg-9">
|
<div class="container-fluid"><div class="row"><form class="form col-lg-10">
|
||||||
{% for key in keys %}
|
{% for key in keys %}
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="{{key}}" class="col-lg-2 col-form-label">{{key}}:</label>
|
<label for="{{key}}" class="col-lg-2 col-form-label">{{key}}:</label>
|
||||||
@@ -85,7 +85,19 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div class="form-row">
|
</div class="form-row">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if books.series|length %}
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="series" class="col-lg-2 col-form-label">Series:</label>
|
||||||
|
<table>
|
||||||
|
{% for s in books.series %}
|
||||||
|
<tr><td>
|
||||||
|
Book {{ SeriesBookNum( s.id, books.id ) }} of {{s.num_books}} in <a href="/series/{{s.id}}">{{s.title}}</a>
|
||||||
|
</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
{% endif %}
|
||||||
{% if books.sub_book|length %}
|
{% if books.sub_book|length %}
|
||||||
<p>sub_book is defined: {{books.sub_book}}</p>
|
<p>sub_book is defined: {{books.sub_book}}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -99,7 +111,7 @@
|
|||||||
<div class="card-body text-info">
|
<div class="card-body text-info">
|
||||||
<h5 class="card-title">{{books.loan[0].firstnames}} {{books.loan[0].surname}}</h5>
|
<h5 class="card-title">{{books.loan[0].firstnames}} {{books.loan[0].surname}}</h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Date Lent: {{books.loan[0].date_lent}}<br>
|
When: {{books.loan[0].date_lent}}<br>
|
||||||
Contact: {{books.loan[0].contact_details}}
|
Contact: {{books.loan[0].contact_details}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user