{% extends 'base.html' %} {% block right_sidebar %} {% endblock %} {% block title %}{{book.label[:32]}}{% endblock %} {% block content %} {% if not version and current_user.is_authenticated %} {% include 'book/modals/add_collection_modal.html' %} {% include 'book/modals/delete_collection_modal.html' %} {% include 'book/modals/add_sub_collection_modal.html' %} {% include 'book/modals/delete_sub_collection_modal.html' %} {% include 'book/modals/add_section_modal.html' %} {% include 'book/modals/delete_section_modal.html' %} {% elif current_user.is_authenticated %} {% include 'book/modals/fork_version_modal.html' %} {% endif %}

Table of contents

{% if not version and has_permission(book, Access.U) %}
{% if not book.active_version.children_collections and current_user.is_authenticated %} {% endif %}
{% endif %}
{% if version %} {% set children_collections = version.children_collections %} {% else %} {% set children_collections = book.active_version.children_collections %} {% endif %} {% for collection in children_collections if not collection.is_root and not collection.is_deleted %}
{% if collection.active_children %} {% elif collection.active_sections %} {% else %}
{% endif %} {% endfor %}

{% if book.original_book %} Forked by {{book.owner.username}} from {{book.original_book.owner.username}}/{{book.original_book.label}} {% else %} Created by {{book.owner.username}} {% endif %} on {{book.created_at.strftime('%B %d, %Y')}}. Last updated on {{book.created_at.strftime('%B %d, %Y')}}

{% if version %}

Version: {{ version.semver.title() }}

{% endif %}
{% for tag in book.tags %}
{{tag.name}}
{% endfor %}

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

{% if version %} {% set children_collections = version.children_collections%} {% else %} {% set children_collections = book.active_version.children_collections %} {% endif %} {% for collection in children_collections if not collection.is_root and not collection.is_deleted %}

#{{collection.label}}

{% if not collection.active_sections and not collection.active_children %}

Collection is empty

{% endif %} {{recursive_render("book/components/sub_collection_preview_content.html",collection,book,version)|safe}} {% endfor %}
{% endblock %} {% block scripts %} {% endblock %}