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:
@@ -221,17 +221,17 @@ function AddAuthorToBook(num) {
|
||||
<form role="form" class="form" action="" method="POST">
|
||||
{{ book_form.id }}
|
||||
{{ book_form.csrf_token }}
|
||||
{% if b.parent|length %}
|
||||
{% if b.parent %}
|
||||
<div class="form-row">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text col-2 col-form-label bg-secondary text-white"><i>Parent Book:</i></label>
|
||||
<div class="col">
|
||||
<span class="col-12 d-flex h-100 border rounded-end border-primary">
|
||||
<i class="col-12 d-flex h-100 justify-content-center"><a href="/book/{{b.parent[0].id}}">{{b.parent[0].title}}</a></i>
|
||||
<i class="col-12 d-flex h-100 justify-content-center"><a href="/book/{{b.parent.id}}">{{b.parent.title}}</a></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="hidden" name="parent_id" value="{{b.parent[0].id}}">
|
||||
<input type="hidden" name="parent_title" value="{{b.parent[0].title}}">
|
||||
<input type="hidden" name="parent_id" value="{{b.parent.id}}">
|
||||
<input type="hidden" name="parent_title" value="{{b.parent.title}}">
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -303,7 +303,7 @@ function AddAuthorToBook(num) {
|
||||
{% if key == "notes" %}
|
||||
{% set rows=2 %}
|
||||
{% endif %}
|
||||
{% if b.parent|length and
|
||||
{% if b.parent and
|
||||
(key == 'publisher' or key == 'owned' or key == 'covertype'
|
||||
or key == 'condition' or key == 'blurb' ) %}
|
||||
{{book_form[key](class="form-control", rows=rows, disabled="disabled" )}}
|
||||
@@ -426,7 +426,7 @@ function AddAuthorToBook(num) {
|
||||
{% else %}
|
||||
<div class="form-row">
|
||||
{% endif %}
|
||||
{% if b.parent|length == 0 %}
|
||||
{% if b.parent %}
|
||||
<form role="form" class="form" action="{{url_for('new_book')}}" method="POST">
|
||||
<input type="hidden" name="add_sub_parent_id" value="{{books.id}}">
|
||||
{{ book_form.add_sub( class="btn btn-outline-success offset-2 col-2" )}}
|
||||
@@ -434,7 +434,7 @@ function AddAuthorToBook(num) {
|
||||
{% else %}
|
||||
<form role="form" class="form" action="{{url_for('remove_sub_book')}}" method="POST">
|
||||
<input type="hidden" name="rem_sub_sub_book_id" value="{{books.id}}">
|
||||
<input type="hidden" name="rem_sub_parent_id" value="{{b.parent[0].id}}">
|
||||
<input type="hidden" name="rem_sub_parent_id" value="{{b.parent.id}}">
|
||||
{{ book_form.rem_sub( class="btn btn-outline-danger offset-2 col-3" )}}
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user