books_for_series now deals with sub books (hiding ability to reorder them in series), and disables first book (parent or normal) and last book (normal or parent of last sub-book)
This commit is contained in:
@@ -4,6 +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">
|
||||
{% for key in keys %}
|
||||
<div class="form-row">
|
||||
|
||||
@@ -6,23 +6,36 @@
|
||||
{% for book in books %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if SeriesBookNum( series.id, book.id ) == 1 %}
|
||||
{% set ds="disabled" %}
|
||||
{% endif %}
|
||||
<a class="btn btn-outline-primary btn-small {{ds}}" href="#"><i class="fas fa-angle-double-up"></i></a>
|
||||
{% if SeriesBookNum( series.id, book.id ) == series.num_books %}
|
||||
{% set de="disabled" %}
|
||||
{% endif %}
|
||||
<a class="btn btn-outline-primary btn-small {{de}}" href="#"><i class="fas fa-angle-double-down"></i></a>
|
||||
{% if book.sub_book_num is defined %}
|
||||
<a href="/book/{{book.id}}"> {{book.title}}</a>
|
||||
{% else %}
|
||||
<a href="/book/{{book.id}}">{{book.title}}</a>
|
||||
{% if book.parent_ref|length %}
|
||||
{% set style="visibility: hidden" %}
|
||||
{% endif %}
|
||||
<a id="up-{{book.id}}" class="btn btn-outline-primary btn-small" style="{{style}}" href="#"><i class="fas fa-angle-double-up"></i></a>
|
||||
<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 ))}}">
|
||||
{% for s in book.series %}
|
||||
{{ SeriesBookNum( s.id, book.id ) }} of <a href="/series/{{s.id}}">{{s.title}}</a><br>
|
||||
{% if not book.child_ref|length %}
|
||||
{{ SeriesBookNum( s.id, book.id ) }} of <a href="/series/{{s.id}}">{{s.title}}</a><br>
|
||||
{% endif %}
|
||||
{% if SeriesBookNum( s.id, book.id ) == 1 %}
|
||||
<script>
|
||||
{% if book.parent_ref|length %}
|
||||
$('#up-{{book.parent_ref[0].book_id}}').addClass("disabled")
|
||||
{% else %}
|
||||
$('#up-{{book.id}}').addClass("disabled")
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% if SeriesBookNum( s.id, book.id ) == s.num_books %}
|
||||
<script>
|
||||
{% if book.parent_ref|length %}
|
||||
$('#down-{{book.parent_ref[0].book_id}}').addClass("disabled")
|
||||
{% else %}
|
||||
$('#down-{{book.id}}').addClass("disabled")
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -39,3 +52,4 @@
|
||||
"columnDefs": [ { "type": "num", "targets": 1 } ] } );
|
||||
} );
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user