diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-04 05:35:15 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-04 05:35:15 +0000 |
| commit | 79adb5151481dde4ff72464e15afba94e1739223 (patch) | |
| tree | e75684d662145294b92d637b010f002ad80a5b0d | |
| parent | ae7213b593b829734d00619ec7a7b45f22bdd000 (diff) | |
Fixed #12694 -- Added template block to make it easier to add new tools to the change_list and change_form templates. Thanks to andybak for the suggestion, and Simon Meers for the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/admin/templates/admin/change_form.html | 7 | ||||
| -rw-r--r-- | django/contrib/admin/templates/admin/change_list.html | 12 |
2 files changed, 12 insertions, 7 deletions
diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index 1689c5b48e..8f8dfe6143 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -26,8 +26,11 @@ {% block content %}<div id="content-main"> {% block object-tools %} {% if change %}{% if not is_popup %} - <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li> - {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%} + <ul class="object-tools"> + {% block object-tools-items %} + <li><a href="history/" class="historylink">{% trans "History" %}</a></li> + {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%} + {% endblock %} </ul> {% endif %}{% endif %} {% endblock %} diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index cb4bae3da8..3dfe4673aa 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -58,11 +58,13 @@ {% block object-tools %} {% if has_add_permission %} <ul class="object-tools"> - <li> - <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink"> - {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %} - </a> - </li> + {% block object-tools-items %} + <li> + <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink"> + {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %} + </a> + </li> + {% endblock %} </ul> {% endif %} {% endblock %} |
