{% extends base %} {% from 'macro.html' import breadcrumbs with context %} {% block content %}
{{- breadcrumbs([ [url_for('author.info'), 'Кабинет автора'], [url_for('story.edit', pk=(story or chapter.story).id), 'Редактирование «{}»'.format((story or chapter.story).title)] ]) }}
{% if not chapter -%} {{ html_block('chapter_add') }} {%- else -%}

{{ page_title }}

{%- endif %}
{% if saved %}
Изменения сохранены

{% endif %} {% if not_saved %}
Изменения не сохранены, проверьте форму

{% endif %}
{{ form.title.label(class_='control-label') }}
{{ form.title }} {% if form.title.errors %} {% for error in form.title.errors %} {{ error }} {% endfor %} {% else %} {{ form.title.description }} {% endif %}
{{ form.notes.label(class_='control-label', for='id_text') }}
{{ form.notes }} {% if form.notes.errors %} {% for error in form.notes.errors %} {{ error }} {% endfor %} {% else %} {{ form.notes.description }} {% endif %}
{{ form.text.label(class_='control-label', for='id_text') }}
{{ form.text }} {% if form.text.errors %} {% for error in form.text.errors %} {{ error }} {% endfor %} {% else %} {{ form.text.description }} {% endif %} {% if diff_html %}
{{ diff_html|safe }}
{% endif %}
{%- if not edit %} {% if not story.published %} {% else %} {% endif %} {%- else %} {%- endif %}
{%- if preview_html -%} {%- include 'includes/chapter_preview.html' -%} {%- elif chapter -%} {%- with story=chapter.story, chapter_edit_mode=True %}{% include "includes/chapter_single.html" %}{% endwith -%} {%- endif -%}
{{- breadcrumbs([ [url_for('author.info'), 'Кабинет автора'], [url_for('story.edit', pk=(story or chapter.story).id), 'Редактирование «{}»'.format((story or chapter.story).title)] ]) }}
{% endblock %} {%- block modal -%} {%- if linter_error_messages -%} {%- include 'includes/linter_modal.html' -%} {%- elif lint_ok -%} {%- include 'includes/linter_ok_modal.html' -%} {%- endif -%} {%- endblock -%}