123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- {% extends "wagtailadmin/base.html" %}
- {% load wagtailadmin_tags %}
- {% load i18n %}
- {% load l10n %}
- {% block titletag %}{% blocktrans with title=page.get_admin_display_title page_type=content_type.model_class.get_verbose_name %}Editing {{ page_type }}: {{ title }}{% endblocktrans %}{% endblock %}
- {% block bodyclass %}page-editor {% if page.live %}page-is-live{% endif %} model-{{ content_type.model }} {% if page_locked %}page-locked{% endif %}{% endblock %}
- {% block content %}
- {% page_permissions page as page_perms %}
- <div id="comments">
-
- </div>
- <header class="merged tab-merged">
- {% explorer_breadcrumb page %}
- <div class="row">
- <h1 class="left col9 header-title" title="{% blocktrans with title=page.get_admin_display_title page_type=content_type.model_class.get_verbose_name %}Editing {{ page_type }}{% endblocktrans %}">
- {{ page.get_admin_display_title }}
- </h1>
- <div class="right col3">
- {% include "wagtailadmin/pages/_page_view_live_tag.html" with page=page_for_status %}
- </div>
- </div>
- <ul class="row header-meta">
- {% include "wagtailadmin/shared/workflow_status.html" with page=page_for_status %}
- {% if page.get_latest_revision %}
- <li>
- <a href="{% url 'wagtailadmin_pages:history' page.id %}" class="button button-small button-nobg text-notransform">
- {% icon "history" class_name="default" %}
- {% trans "History" %}
- </a>
- </li>
- {% endif %}
- <li class="header-meta--type">
- {% icon name="doc-empty-inverse" class_name="default" %}
- {{ content_type.model_class.get_verbose_name }}
- </li>
- {% if locale %}
- <li class="header-meta--locale">
- {% include "wagtailadmin/shared/locale_selector.html" %}
- </li>
- {% endif %}
- </ul>
- </header>
- {% block form %}
- <form id="page-edit-form" action="{% url 'wagtailadmin_pages:edit' page.id %}" method="POST" novalidate{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
- {% csrf_token %}
- <input type="hidden" name="next" value="{{ next }}">
- {{ edit_handler.render_form_content }}
- {% if is_revision %}
- <input type="hidden" name="revision" value="{{ revision.id|unlocalize }}" />
- {% endif %}
- <footer>
- <nav aria-label="{% trans 'Actions' %}">
- <ul>
- <li class="actions actions--primary">
- <div class="dropdown dropup dropdown-button match-width {% if is_revision %}warning{% endif %}">
- {{ action_menu.render_html }}
- </div>
- </li>
- {% if preview_modes %}
- <li class="preview">
- {% trans 'Preview' as preview_label %}
- {% if preview_modes|length > 1 %}
- <div class="dropdown dropup dropdown-button match-width">
- {% include "wagtailadmin/pages/_preview_button_on_edit.html" with label=preview_label icon=1 %}
- <div class="dropdown-toggle">{% icon name="arrow-up" %}</div>
- <ul>
- {% for mode_name, mode_display_name in preview_modes %}
- <li>
- {% include "wagtailadmin/pages/_preview_button_on_edit.html" with mode=mode_name label=mode_display_name %}
- </li>
- {% endfor %}
- </ul>
- </div>
- {% else %}
- {% include "wagtailadmin/pages/_preview_button_on_edit.html" with label=preview_label icon=1 %}
- {% endif %}
- </li>
- {% endif %}
- {% block extra_footer_actions %}
- {% endblock %}
- </ul>
- </nav>
- </footer>
- </form>
- {% endblock %}
- {% endblock %}
- {% block extra_css %}
- {{ block.super }}
- {% include "wagtailadmin/pages/_editor_css.html" %}
- {{ edit_handler.form.media.css }}
- {{ action_menu.media.css }}
- {% endblock %}
- {% block extra_js %}
- {{ block.super }}
- {% include "wagtailadmin/pages/_editor_js.html" %}
- {% comment %}
- Additional js from widgets media. Allows for custom widgets in admin panel.
- {% endcomment %}
- {{ edit_handler.form.media.js }}
- {{ action_menu.media.js }}
- {% comment %}
- Additional HTML code that edit handlers define through 'html_declarations'. (Technically this isn't JavaScript, but it will generally be data that exists for JavaScript to work with...)
- {% endcomment %}
- {{ edit_handler.html_declarations }}
- {{ comments_author|json_script:"comments-author" }}
- <button type="button" id="comment-icon" data-annotation class="button button-secondary button-small u-hidden">{% icon name='comment' class_name='initial' %}</button>
- <script>
- $(function() {
- {% if publishing_will_cancel_workflow %}
- /* Make user confirm before publishing the page if it will cancel an ongoing workflow */
- let cancellationConfirmed = false;
- $('[name=action-publish]').click((e) => {
- if (!cancellationConfirmed) {
- e.stopImmediatePropagation();
- e.preventDefault();
- ModalWorkflow({
- 'url': "{% url 'wagtailadmin_pages:confirm_workflow_cancellation' page.id %}",
- 'onload': {
- 'confirm': function(modal, jsonData) {
- $('[data-confirm-cancellation]', modal.body).click((event) => {
- cancellationConfirmed = true;
- modal.close();
- e.currentTarget.click();
- })
- $('[data-cancel-dialog]', modal.body).click((event) => {
- modal.close();
- })
- },
- 'no_confirmation_needed': function(modal, jsonData) {
- modal.close();
- cancellationConfirmed = true;
- e.currentTarget.click();
- }
- },
- });
- }
- });
- {% endif %}
- /* Make user confirm before leaving the editor if there are unsaved changes */
- {% trans "This page has unsaved changes." as confirmation_message %}
- enableDirtyFormCheck(
- '#page-edit-form',
- {
- confirmationMessage: '{{ confirmation_message|escapejs }}',
- {% if has_unsaved_changes %}
- alwaysDirty: true,
- {% endif %}
- }
- );
- /* Tooltips used by the workflow status component */
- $('[data-wagtail-tooltip]').tooltip({
- animation: false,
- title: function() {
- return $(this).attr('data-wagtail-tooltip');
- },
- trigger: 'hover',
- placement: 'bottom',
- });
- ActivateWorkflowActionsForEditView('#page-edit-form');
- LockUnlockAction('{{ csrf_token|escapejs }}', '{% url 'wagtailadmin_pages:edit' page.id %}');
- });
- </script>
- <script>
- window.comments.initComments([]);
- </script>
- {% endblock %}
|