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