{% extends "shatailadmin/base.html" %} {% load shatailadmin_tags i18n %} {% block titletag %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}Editing {{ snippet_type_name }} - {{ instance }}{% endblocktrans %}{% endblock %} {% block
content %} {% trans "Editing" as editing_str %} {% include "shatailsnippets/snippets/_header_with_history.html" with title=editing_str subtitle=instance icon="snippet" merged=1 locale=locale translations=translations latest_log_entry=latest_log_entry
model_opts=model_opts instance=instance only %}

<div class="row row-flush">

    {% usage_count_enabled as uc_enabled %}
    <div class="{% if uc_enabled %}col10 divider-after{% else %}col12{% endif %}">
        <form action="{{ action_url }}" method="POST" novalidate{% if form.is_multipart %} enctype="multipart/form-data" {% endif %}>
            {% csrf_token %} {{ edit_handler.render_form_content }}
            <footer class="footer">
                <nav aria-label="{% trans 'Actions' %}">
                    <ul>
                        <li class="actions actions--primary footer__container">
                            <div class="dropdown dropup dropdown-button match-width">
                                {{ action_menu.render_html }}
                            </div>
                        </li>
                    </ul>
                </nav>
            </footer>
        </form>
    </div>

    {% if uc_enabled %}
    <div class="col2 ">
        <dl>
            <dt>{% trans "Usage" %}</dt>
            <dd>
                <a href="{{ instance.usage_url }}">{% blocktrans trimmed count usage_count=instance.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
            </dd>
        </dl>
    </div>
    {% endif %}
</div>


{% endblock %} {% block extra_css %} {{ block.super }} {% include "shatailadmin/pages/_editor_css.html" %} {{ media.css }} {% endblock %} {% block extra_js %} {{ block.super }} {% include "shatailadmin/pages/_editor_js.html" %} {{ media.js }}

<script>
    // Set shatailConfig.ACTIVE_CONTENT_LOCALE if this is a translated page
    // This value may be used by JS widgets on the form
    { %
        if locale %
    }
    window.shatailConfig = window.shatailConfig || {};
    window.shatailConfig.ACTIVE_CONTENT_LOCALE = '{{ locale.language_code|escapejs }}'; { % endif %
    }

    $(function() {
        $('[data-shatail-tooltip]').tooltip({
            animation: false,
            title: function() {
                return $(this).attr('data-shatail-tooltip');
            },
            trigger: 'hover',
            placement: 'bottom',
        });
    })
</script>
{% endblock %}