Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3128: Added explicit object-tools block so custom admin templa…

…tes can override it where needed. Thanks, Gary Wilson.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 069a8858baa6a6b687e67312ffdbcdfc55cee4b7 1 parent b3d1ce6
Jacob Kaplan-Moss authored December 20, 2006
5  django/contrib/admin/templates/admin/base.html
@@ -38,7 +38,10 @@
38 38
     <div id="content" class="{% block coltype %}colM{% endblock %}">
39 39
         {% block pretitle %}{% endblock %}
40 40
         {% block content_title %}{% if title %}<h1>{{ title|escape }}</h1>{% endif %}{% endblock %}
41  
-        {% block content %}{{ content }}{% endblock %}
  41
+        {% block content %}
  42
+        {% block object-tools %}{% endblock %}
  43
+        {{ content }}
  44
+        {% endblock %}
42 45
         {% block sidebar %}{% endblock %}
43 46
         <br class="clear" />
44 47
     </div>
2  django/contrib/admin/templates/admin/change_form.html
@@ -16,11 +16,13 @@
16 16
 </div>
17 17
 {% endif %}{% endblock %}
18 18
 {% block content %}<div id="content-main">
  19
+{% block object-tools %}
19 20
 {% if change %}{% if not is_popup %}
20 21
   <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
21 22
   {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
22 23
   </ul>
23 24
 {% endif %}{% endif %}
  25
+{% endblock %}
24 26
 <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
25 27
 <div>
26 28
 {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
2  django/contrib/admin/templates/admin/change_list.html
@@ -7,9 +7,11 @@
7 7
 {% block coltype %}flex{% endblock %}
8 8
 {% block content %}
9 9
 <div id="content-main">
  10
+{% block object-tools %}
10 11
 {% if has_add_permission %}
11 12
 <ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name|escape as name %}Add {{ name }}{% endblocktrans %}</a></li></ul>
12 13
 {% endif %}
  14
+{% endblock %}
13 15
 <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
14 16
 {% block search %}{% search_form cl %}{% endblock %}
15 17
 {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}

0 notes on commit 069a885

Please sign in to comment.
Something went wrong with that request. Please try again.