move parent[] to parent as the array was never needed, removed some dead code, clarified another example of new BUG-46

This commit is contained in:
2023-07-08 15:10:38 +10:00
parent ff87aca2f5
commit 4e8bda4134
6 changed files with 27 additions and 44 deletions

View File

@@ -6,7 +6,7 @@
{% for book in books %}
<tr>
<td id="{{book.id}}">
{% if book.parent|length %}
{% if book.parent %}
{% 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}}
@@ -51,8 +51,8 @@
{% endif %}
{% if SeriesBookNum( s.id, book.id ) == 1 %}
<script>
{% if book.parent|length %}
$('#up-{{book.parent[0].id}}').prop("disabled", true)
{% if book.parent %}
$('#up-{{book.parent.id}}').prop("disabled", true)
{% else %}
$('#up-{{book.id}}').prop("disabled", true)
{% endif %}
@@ -60,8 +60,8 @@
{% endif %}
{% if SeriesBookNum( s.id, book.id ) == s.num_books %}
<script>
{% if book.parent|length %}
$('#down-{{book.parent[0].id}}').prop("disabled", true)
{% if book.parent %}
$('#down-{{book.parent.id}}').prop("disabled", true)
{% else %}
$('#down-{{book.id}}').prop("disabled", true)
{% endif %}