{% extends "base.html" %} {% block main_content %}

View/Edit Book

{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
{% for key in keys %}
{% if key == "genre" %}
{% for genre in genre_list %} {% set gname=genre.name %}
{% endfor %}
{% elif key == "publisher" %}
{% 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 %}
{{book_form[key](class="form-control", value=books[key], rows="5" )}}
{% endif %}
{% endfor %} {% if books.series|length %}
{% for s in books.series %} {% endfor %}
Book {{ SeriesBookNum( s.id, books.id ) }} of {{s.num_books}} in {{s.title}}
{% endif %} {% if books.sub_book|length %}

sub_book is defined: {{books.sub_book}}

{% endif %} {% if books.subs|length %}

subs is defined {{ books.subs }}

{% endif %} {% 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 %}