{% extends 'base.html' %} {% block right_sidebar %} {% endblock %} {% if current_user.is_authenticated %} {% include 'book/add_collection_modal.html' %} {% include 'book/delete_collection_modal.html' %} {% include 'book/add_sub_collection_modal.html' %} {% include 'book/delete_sub_collection_modal.html' %} {% include 'book/add_section_modal.html' %} {% include 'book/delete_section_modal.html' %} {% endif %} {% block content %}

Table of contents

{% for collection in book.versions[-1].children_collections if not collection.is_root and not collection.is_deleted %}
{% endfor %}

Created by {{book.owner.username}} on {{book.created_at.strftime('%B %d, %Y')}}. Last updated on {{book.created_at.strftime('%B %d, %Y')}}

{% if book.about==None %}About text{% else %}{{book.about}}{% endif %}

{% for collection in book.versions[-1].children_collections if not collection.is_root and not collection.is_deleted %}

#{{collection.label}}

{% if not collection.is_leaf and not collection.children %}

Collection is empty

{% endif %} {% if not collection.is_leaf %} {% for sub_collection in collection.children if not sub_collection.is_deleted%}

##{{sub_collection.label}}

{% if not sub_collection.active_sections %}

This sub collection is empty

{% endif %} {% for section in sub_collection.active_sections %}

{{ section.label }}

{% if not section.active_interpretations %}

This section is empty

{% else %}

{{ section.approved_interpretation.text|safe }}

Interpretation by {{section.approved_interpretation.user.username}} on {{section.approved_interpretation.created_at.strftime('%B %d, %Y')}}
{% if not section.approved_comments %}

No comments for current section

{% else %}

{% endif %} {% endif %}
{% endfor %} {% endfor %} {% else %} {% for section in collection.active_sections %}

{{ section.label }}

{% if not section.active_interpretations %}

This section is empty

{% else %}

{{ section.approved_interpretation.text|safe }}

Interpretation by {{section.approved_interpretation.user.username}} on {{section.approved_interpretation.created_at.strftime('%B %d, %Y')}}
{% if not section.approved_comments %}

No comments for current section

{% else %}

{% endif %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{% endblock %} {% block scripts %} {% endblock %}