rewrote to remove parent_ref and just use parent from ORM

This commit is contained in:
2020-12-01 20:27:17 +11:00
parent 9cce510669
commit 136be26ad0

View File

@@ -6,7 +6,7 @@
{% for book in books %}
<tr>
<td id="{{book.id}}">
{% if book.parent_ref|length %}
{% if book.parent|length %}
{% set style="style=visibility:hidden" %}
{% endif %}
<button name="move_button" value="up-{{book.id}}" id="up-{{book.id}}" class="btn btn-outline-primary btn-small" {{style}}
@@ -44,8 +44,8 @@
{% endif %}
{% if SeriesBookNum( series.id, book.id ) == 1 %}
<script>
{% if book.parent_ref|length %}
$('#up-{{book.parent_ref[0].book_id}}').prop("disabled", true)
{% if book.parent|length %}
$('#up-{{book.parent[0].id}}').prop("disabled", true)
{% else %}
$('#up-{{book.id}}').prop("disabled", true)
{% endif %}
@@ -53,8 +53,8 @@
{% endif %}
{% if SeriesBookNum( series.id, book.id ) == series.num_books %}
<script>
{% if book.parent_ref|length %}
$('#down-{{book.parent_ref[0].book_id}}').prop("disabled", true)
{% if book.parent|length %}
$('#down-{{book.parent[0].id}}').prop("disabled", true)
{% else %}
$('#down-{{book.id}}').prop("disabled", true)
{% endif %}