Ticket #7984: admin-inlineviewonsite.diff
File admin-inlineviewonsite.diff, 2.5 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
773 773 def __init__(self, formset, form, fieldsets, prepopulated_fields, original): 774 774 self.formset = formset 775 775 self.original = original 776 self.original.content_type_id = ContentType.objects.get_for_model(original).id 776 777 self.show_url = original and hasattr(original, 'get_absolute_url') 777 778 super(InlineAdminForm, self).__init__(form, fieldsets, prepopulated_fields) 778 779 -
django/contrib/admin/templates/admin/edit_inline/stacked.html
10 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 %} 11 11 </h2> 12 12 {% if inline_admin_form.show_url %} 13 <p><a href=" /r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">View on site</a></p>13 <p><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">View on site</a></p> 14 14 {% endif %} 15 15 16 16 {% for fieldset in inline_admin_form %} -
django/contrib/admin/templates/admin/edit_inline/tabular.html
21 21 22 22 <td class="original">{% if inline_admin_form.original or inline_admin_form.show_url %}<p> 23 23 {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %} 24 {% if inline_admin_form.show_url %}<a href=" /r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">View on site</a>{% endif %}24 {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">View on site</a>{% endif %} 25 25 </p>{% endif %} 26 26 {{ inline_admin_form.pk_field.field }} 27 27 {% spaceless %}