{% extends base %}
{% from 'macro.html' import breadcrumbs with context %}

{% block content %}

<div class="row">
    <div class="span12 story-page">
        {{- breadcrumbs() }}

        {% for item in edit_log %}
            <p>
                {% with user=item.user %}
                    {% include 'includes/userlink.html' %}
                {% endwith %}
                {{ item.action_verb() }} рассказ <a href="{{ item.story.url }}">{{ item.story.title }}</a>
                {{ item.date|datetimeformat }}

                {% if item.json_data %}
                    <ul><ul>
                    {% for k, v in item.data.items() %}
                        <li><strong>{{ k }}:</strong> {{ v }}</li>
                    {% endfor %}
                    </ul></ul>
                {% endif %}
            </p>
        {% endfor %}

        {% if page_obj %}
            <div id="stories-pagination" class="pagination center">
                {% if page_obj.has_previous() %}
                    <a class="btn" href="{{ url_for(endpoint, page=page_obj.number - 1, **view_args) }}">← Назад</a>
                {% endif %}
                <span class="btn btn-primary">
                    {{ page_obj.number }} / {{ page_obj.num_pages }}
                </span>
                {% if page_obj.has_next() %}
                    <a class="btn" href="{{ url_for(endpoint, page=page_obj.number + 1, **view_args) }}">Вперед →</a>
                {% endif %}
              </div>
        {% endif %}
    </div>
</div>
{% endblock %}
