{% if books is not mapping %}

All Books

{% for book in books %} {% if book.sub_book_num is defined %} {% else %} {% endif %} {% endfor %}
TitleAuthorPublisherConditionOwnedCovertype
    {{book.title}}{{book.title}}{{ book.author[0]['surname'] }}, {{book.author[0]['firstnames']}} {{ book.publisher[0]['name']}} {% if book.condition == "Good" %} {% elif book.condition == "Average" %} {% else %} {% endif %} {{ book.owned}} {{ book.covertype}}
{% else %}

View/Edit Book

{% set keys = [ 'title', 'author', 'publisher', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
{% for key in keys %}
{% if books[key] is iterable and books[key] is not string %} {% for objects in books[key] %} {% for attr in objects %} {% endfor %} {% endfor %} {% else %} {% if key == "notes" or key == "blurb" %} {% else %} {% endif %} {% endif %}
{% endfor %}
{% if books.sub_book is defined %}

sub_book is defined: {{books.sub_book}}

{% endif %} {% endif %}