Merge branch 'master' of 192.168.0.2:pybook
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
|
||||
<h3><center>View/Edit Book</center></h1>
|
||||
{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
|
||||
{{books.owned}}
|
||||
<div class="container"><div class="row"><form class="form col-lg-12">
|
||||
<div class="container-fluid"><div class="row"><form class="form col-lg-10">
|
||||
{% for key in keys %}
|
||||
<div class="form-row">
|
||||
<label for="{{key}}" class="col-lg-2 col-form-label">{{key}}:</label>
|
||||
@@ -86,7 +85,19 @@
|
||||
{% endif %}
|
||||
</div class="form-row">
|
||||
{% endfor %}
|
||||
</form></div class="row"></div class="container">
|
||||
{% 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>
|
||||
{% endif %}
|
||||
{% if books.sub_book|length %}
|
||||
<p>sub_book is defined: {{books.sub_book}}</p>
|
||||
{% endif %}
|
||||
@@ -94,7 +105,20 @@
|
||||
<p>subs is defined {{ books.subs }}</p>
|
||||
{% endif %}
|
||||
{% if books.loan|length %}
|
||||
<p>loan is defined: {{books.loan}}</p>
|
||||
<div class="col">
|
||||
<div class="card border-info" style="max-width: 18rem;">
|
||||
<div class="card-header">Loaned to</div>
|
||||
<div class="card-body text-info">
|
||||
<h5 class="card-title">{{books.loan[0].firstnames}} {{books.loan[0].surname}}</h5>
|
||||
<p class="card-text">
|
||||
When: {{books.loan[0].date_lent}}<br>
|
||||
Contact: {{books.loan[0].contact_details}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div class="row">
|
||||
</div class="container">
|
||||
|
||||
{% endblock main_content %}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<tr class="thead-light"><th>Title</th><th>Book Number</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set last = namespace(val=0) %}
|
||||
{% for book in books %}
|
||||
<tr>
|
||||
<td>
|
||||
@@ -13,7 +14,13 @@
|
||||
<a id="down-{{book.id}}" class="btn btn-outline-primary btn-small" style="{{style}}" href="#"><i class="fas fa-angle-double-down"></i></a>
|
||||
<a href="/book/{{book.id}}">{{book.title}}</a>
|
||||
</td>
|
||||
<td data-sort="{{series.id}}.{{"%02d".format( SeriesBookNum( series.id, book.id ))}}">
|
||||
{% set num = SeriesBookNum( series.id, book.id ) %}
|
||||
{% if num == None %}
|
||||
{# okay, if this is a parent book, the num == None, so make it use last real-book and add .01 to it to make sure it sorts just after the last one #}
|
||||
<td data-sort="{{series.id}}.{{"{:02d}1".format( last.val )}}">
|
||||
{% else %}
|
||||
<td data-sort="{{series.id}}.{{"{:02d}".format( num )}}">
|
||||
{% endif %}
|
||||
{% for s in book.series %}
|
||||
{% if not book.child_ref|length %}
|
||||
{{ SeriesBookNum( s.id, book.id ) }} of <a href="/series/{{s.id}}">{{s.title}}</a><br>
|
||||
@@ -36,6 +43,7 @@
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% set last.val = num %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user