{% extends "base.html" %} {% block main_content %} {% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
{% if message|length %}
{{message}}
{% endif %}
{{ book_form.id }} {{ book_form.csrf_token }} {% if b.parent|length %}
{% endif %} {% for key in keys %}
{% if key == "genre" %}
{% for genre in genre_list %}
{% endfor %}
{% elif key == "author" %}
{% set cnt = namespace(idx=0) %} {% for objects in books[key] %}
{% if cnt.idx > 0 %}
{% endif %}
{% set cnt.idx = cnt.idx+1 %} {% endfor %}
{% else %}
{% set rows=4 %} {% if key == "notes" %} {% set rows=2 %} {% endif %} {% if b.parent|length and (key == 'publisher' or key == 'owned' or key == 'covertype' or key == 'condition' or key == 'blurb' ) %} {{book_form[key](class="form-control", value=books[key], rows=rows, disabled="disabled" )}} {% else %} {{book_form[key](class="form-control", value=books[key], rows=rows )}} {% endif %}
{% endif %}
{% endfor %} {% if books.series|length %}
{% for s in books.series %} {% endfor %}
{% if SeriesBookNum( s.id, books.id ) %} {% else %} {% endif %}
{% endif %} {% if books.child_ref|length %}
{% endif %}
{{ book_form.delete( class="btn btn-outline-danger offset-lg-2 col-lg-2" )}} {{ book_form.submit( class="btn btn-primary col-lg-2" )}}
{% if books.loan|length %}
Loaned to
{{books.loan[0].firstnames}} {{books.loan[0].surname}}

When: {{books.loan[0].date_lent}}
Contact: {{books.loan[0].contact_details}}

{% endif %}
{% endblock main_content %} {% if books.child_ref|length %} {% block script_content %} {% endblock script_content %} {% endif %}