Ticket #11600: stackedinline-viewonsite-fix.diff

File stackedinline-viewonsite-fix.diff, 1.6 KB (added by Sean Brant, 15 years ago)

This moves the link next to the related object title

  • django/contrib/admin/templates/admin/edit_inline/stacked.html

     
    77{% for inline_admin_form in inline_admin_formset %}
    88<div class="inline-related{% if forloop.last %} last-related{% endif %}">
    99  <h3><b>{{ inline_admin_formset.opts.verbose_name|title }}:</b>&nbsp;{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% else %} #{{ forloop.counter }}{% endif %}
    10     {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
     10        {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
     11        {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
    1112  </h3>
    12   {% if inline_admin_form.show_url %}
    13   <p><a href="../../../r/{{ inline_admin_form.original_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p>
    14   {% endif %}
    1513  {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
    1614
    1715  {% for fieldset in inline_admin_form %}
Back to Top