Prechádzať zdrojové kódy

Create separate blocks in generic confirm_delete.html template to ease overrides

Sage Abdullah 4 mesiacov pred
rodič
commit
975e07bbdd

+ 15 - 9
wagtail/admin/templates/wagtailadmin/generic/confirm_delete.html

@@ -2,15 +2,21 @@
 {% load i18n %}
 
 {% block main_content %}
-    {% if usage_url %}
-        {% include "wagtailadmin/shared/usage_summary.html" %}
-    {% endif %}
+    {% block usage_summary %}
+        {% if usage_url %}
+            {% include "wagtailadmin/shared/usage_summary.html" %}
+        {% endif %}
+    {% endblock %}
     {% if not is_protected %}
-        <p>{{ view.confirmation_message }}</p>
-        <form action="{{ view.get_delete_url }}" method="POST">
-            {% csrf_token %}
-            <button type="submit" class="button serious">{% trans 'Yes, delete' %}</button>
-            <a href="{{ view.get_success_url }}" class="button button-secondary">{% trans "No, don't delete" %}</a>
-        </form>
+        {% block confirmation_message %}
+            <p>{{ view.confirmation_message }}</p>
+        {% endblock %}
+        {% block form %}
+            <form action="{{ view.get_delete_url }}" method="POST">
+                {% csrf_token %}
+                <button type="submit" class="button serious">{% trans 'Yes, delete' %}</button>
+                <a href="{{ view.get_success_url }}" class="button button-secondary">{% trans "No, don't delete" %}</a>
+            </form>
+        {% endblock %}
     {% endif %}
 {% endblock %}