{% extends 'base.html' %} {% block title %} Chapter {{ num_major }}{% if num_minor %}.{{ num_minor }}{% endif %}{% if name %} - {{ name }}{% endif %} {% endblock %} {% block head %} {% if next_chapter %} {% endif %} {% endblock %} {% block content %}

{{ self.title() }}

{# Put buttons in block to reuse later in this same template #} {% block buttons %}
{% if prev_chapter %} {{ ibutton(href=url_for('chapter_view', site=site, title_id=title_id, chapter_id=prev_chapter['id']), left_icon='chevrons-left', text='Prev') }} {% else %} {{ ibutton(left_icon='chevrons-left', text='Prev', disabled=True) }} {% endif %} {{ ibutton(href=url_for('title_view', title_id=title_id, site=site), left_icon='list', text='Chapter list', color='blue') }} {% if next_chapter %} {% set next_url = url_for('chapter_view', site=site, title_id=title_id, chapter_id=next_chapter['id']) %} {% if session['user'] %} {% set next_url = next_url + '?has_read=' + id %} {% endif %} {{ ibutton(href=next_url, right_icon='chevrons-right', text='Next') }} {% else %} {% if session['user'] %} {{ ibutton(href=url_for('title_view', site=site, title_id=title_id) + '?has_read=' + id, text='✓ Finish reading', color='green') }} {% else %} {{ ibutton(right_icon='chevrons-right', text='Next', disabled=True) }} {% endif %} {% endif %}
{% endblock %}
{% for page in pages %} {% endfor %}
{{ self.buttons() }} {% endblock %}