Ticket #3128: object-tools-block.diff

File object-tools-block.diff, 2.5 KB (added by Gary Wilson <gary.wilson@…>, 18 years ago)

block in admin/base.html with overrides in change_list and change_form

  • django/contrib/admin/templates/admin/base.html

    === modified file 'django/contrib/admin/templates/admin/base.html'
     
    3838    <div id="content" class="{% block coltype %}colM{% endblock %}">
    3939        {% block pretitle %}{% endblock %}
    4040        {% 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 %}
    4245        {% block sidebar %}{% endblock %}
    4346        <br class="clear" />
    4447    </div>
  • django/contrib/admin/templates/admin/change_form.html

    === modified file 'django/contrib/admin/templates/admin/change_form.html'
     
    1616</div>
    1717{% endif %}{% endblock %}
    1818{% block content %}<div id="content-main">
     19{% block object-tools %}
    1920{% if change %}{% if not is_popup %}
    2021  <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
    2122  {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
    2223  </ul>
    2324{% endif %}{% endif %}
     25{% endblock %}
    2426<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
    2527<div>
    2628{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
  • django/contrib/admin/templates/admin/change_list.html

    === modified file 'django/contrib/admin/templates/admin/change_list.html'
     
    77{% block coltype %}flex{% endblock %}
    88{% block content %}
    99<div id="content-main">
     10{% block object-tools %}
    1011{% if has_add_permission %}
    1112<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>
    1213{% endif %}
     14{% endblock %}
    1315<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
    1416{% block search %}{% search_form cl %}{% endblock %}
    1517{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
Back to Top