{% extends theme("layout.html") %}

{% import "utils.html" as utils with context %}
{% import "snippets.html" as snippets with context %}
{% import theme("itemviews.html") as itemviews with context %}

{% set footer_meta = snippets.footer_meta() %}

{% block head_links %}
    {{ super() }}
    <link rel="alternate" title="{{ item_name }} changes" href="{{ url_for('feed.atom', item_name=item_name) }}" type="application/atom+xml">
    {# universal edit button support #}
    {%- if may.write and 'frontend.modify_item' not in cfg.endpoints_excluded -%}
        <link rel="alternate" type="application/wiki" title="{{ _('Modify') }}" href="{{ url_for('frontend.modify_item', item_name=item_name) }}">
    {%- endif %}
{% endblock %}

{% block header_itemviews %}
    {{ itemviews }}
{% endblock %}

{% block content %}
    {% block headline %}
        {% if item.meta['summary'] %}
            {% block item_summary %}
                <div class="moin-summary">
                    {{ _('Summary: {summary}').format(summary=item.meta['summary']) }}
                </div>
            {% endblock %}
        {% endif %}
        {{ utils.rev_navigation(rev_navigation_ids_dates, fqname, view='frontend.show_item', item=item) }}
    {% endblock %}

    {% block content_data %}
        {% if data_rendered %}
            <div id="moin-content-data">
                {{ data_rendered }}
            </div>
        {% endif %}
    {% endblock %}
{% endblock %}

{% block footer_hr %}{% endblock %}

{% block footer_itemviews %}
    {{ itemviews }}
{% endblock %}

{% block footer_meta %}
    {{ footer_meta }}
{% endblock %}

{% block options_for_javascript %}
    {%- if item_name and user.edit_on_doubleclick and may.write and data_rendered and not form -%}
        <br id="moin-edit-on-doubleclick">
    {%- endif %}
    {%- if user.show_comments -%}
        <br id="moin-show-comments">
    {%- endif %}
{% endblock %}
