{% load l10n i18n cms_tags cms_static static sekizai_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% spaceless %}
        {% if v1 and v2 %}
        {% blocktrans with left=v1.description right=v1.description %}
        Compare {{ left }} to {{ right }}
        {% endblocktrans %}
    {% elif v1 %}
        {% blocktrans with left=v1.description %}
        Compare {{ left }}
        {% endblocktrans %}
    {% elif right %}
        {% blocktrans with right=v2.description %}
        Compare {{ right }}
        {% endblocktrans %}
    {% endif %}{% endspaceless %}</title>
    <link rel="stylesheet" href="{% static_with_version "cms/css/cms.base.css" %}" />
    <link rel="stylesheet" href="{% static 'djangocms_versioning/css/versioning.css' %}">
</head>
<body>
    <div id="cms-top" class="cms cms-reset" data-compare='{
        {% if v2_preview_url %}
            "v2_url": "{{ v2_preview_url }}",
        {% endif %}
        {% if v2 %}
            "v2_description": "{{ v2_description|default:v2.verbose_name }}",
        {% endif %}
        "v1_url": "{{ v1_preview_url }}",
        "v1_description": "{{ v1_description|default:v1.verbose_name }}"
    }'>
        <div class="cms-toolbar">
            <div class="cms-versioning-controls">
                {% if return_url %}
                    <a class="cms-btn" href="{{ return_url }}">{% translate "Back" %}</a> &nbsp;
                {% endif %}
                <span class="cms-versioning-title">
                {% blocktrans with left=v1_description|default:v1.verbose_name %}
                    Comparing {{ left }} with
                {% endblocktrans %}
                </span>
                <select class="js-cms-versioning-version cms-select">
                    <option disabled {% if not request.GET.compare_to %} selected{% endif %}>{% translate "Pick a version to compare to" %}</option>
                    {% for version in version_list %}
                        {% if version.pk != v1.pk %}
                            <option value="{{ version.pk }}" {% if v2 and v2.pk == version.pk %} selected{% endif %}>{{ version.verbose_name }}</option>
                        {% endif %}
                    {% endfor %}
                </select>
                <div class="cms-tooblar-item cms-toolbar-item-buttons">
                    <div class="cms-btn-group" style="display: none;">
                        <a href="#"
                            class="cms-btn cms-btn-active js-cms-versioning-control js-cms-versioning-control-visual">
                            {% translate "Visual" %}
                        </a>
                        <a href="#" class="cms-btn js-cms-versioning-control js-cms-versioning-control-source">
                            {% translate "Source" %}
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="{% static 'djangocms_versioning/js/dist/bundle.versioning.min.js' %}"></script>
</body>
</html>
