Code

Ticket #10283: change_form.diff

File change_form.diff, 1.6 KB (added by Ciantic, 5 years ago)

change_form.html extra blocks, for customization.

Line 
1Index: django/contrib/admin/templates/admin/change_form.html
2===================================================================
3--- django/contrib/admin/templates/admin/change_form.html       (revision 9844)
4+++ django/contrib/admin/templates/admin/change_form.html       (working copy)
5@@ -32,27 +32,34 @@
6 <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
7 <div>
8 {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
9-{% if save_on_top %}{% submit_row %}{% endif %}
10+{% block submit_row_top %}{% if save_on_top %}{% submit_row %}{% endif %}{% endblock %}
11+{% block errors %}
12 {% if errors %}
13     <p class="errornote">
14     {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
15     </p>
16     <ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul>
17 {% endif %}
18-
19+{% endblock %}
20+{% block fieldsets %}
21 {% for fieldset in adminform %}
22   {% include "admin/includes/fieldset.html" %}
23 {% endfor %}
24+{% endblock %}
25 
26 {% block after_field_sets %}{% endblock %}
27 
28+{% block inline_admin_formsets %}
29 {% for inline_admin_formset in inline_admin_formsets %}
30     {% include inline_admin_formset.opts.template %}
31 {% endfor %}
32+{% endblock %}
33 
34 {% block after_related_objects %}{% endblock %}
35 
36+{% block submit_row_bottom %}
37 {% submit_row %}
38+{% endblock %}
39 
40 {% if add %}
41    <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script>