Opened 15 years ago

Closed 7 years ago

#11974 closed New feature (fixed)

Submit_row in admin doesn't follow the pattern of using admin/app_label/model/submit_line.html

Reported by: vbmendes Owned by: Raffaele Salmaso
Component: contrib.admin Version:
Severity: Normal Keywords: django admin templates
Cc: vbmendes, jedie, Andy Baker, andy@…, jgbreezer@…, raffaele.salmaso+djangoproject@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The admin's submit_row template tag does not follow the pattern for searching for templates: admin/app_label/model/submit_line.html

And it would be nice if it supports since it will be easier to override this template.

I made a patch that add this support.

Attachments (1)

admin_modify.diff (2.7 KB ) - added by vbmendes 15 years ago.
Patch for the submit_rows template tag. With this, it will follow the template naming pattern of the admin.

Download all attachments as: .zip

Change History (16)

by vbmendes, 15 years ago

Attachment: admin_modify.diff added

Patch for the submit_rows template tag. With this, it will follow the template naming pattern of the admin.

comment:1 by vbmendes, 15 years ago

Cc: vbmendes added; vbmendes@… removed

comment:2 by Jannis Leidel, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by jedie, 14 years ago

Cc: jedie added

comment:4 by Jannis Leidel, 14 years ago

Needs documentation: set
Needs tests: set
Triage Stage: Design decision neededAccepted

comment:5 by Ramiro Morales, 14 years ago

See also #13875.

comment:6 by Andy Baker, 14 years ago

Cc: Andy Baker added
Severity: Normal
Type: Uncategorized

comment:7 by Jannis Leidel, 14 years ago

Easy pickings: unset
Type: UncategorizedNew feature
Version: 1.1

comment:8 by Andy Baker <andy@…>, 13 years ago

Cc: andy@… added
Needs documentation: unset
Needs tests: unset
UI/UX: unset

I am fairly sure it doesn't need tests or docs on the grounds that:

  1. We haven't documented the template structure of many similar parts of the admin
  2. We don't have specific tests for the template structure of other parts of the admin.

comment:9 by Jannis Leidel, 13 years ago

Needs documentation: set
Needs tests: set
Patch needs improvement: set

In fact there are several tests for using custom templates (e.g. source:django/trunk/tests/regressiontests/admin_views/tests.py?rev=16498#L608), so this definitely needs to be tested and documented as part of the "Overriding admin templates" docs (https://docs.djangoproject.com/en/dev//ref/contrib/admin/#overriding-admin-templates).

comment:10 by John G, 12 years ago

Cc: jgbreezer@… added

comment:11 by Raffaele Salmaso, 8 years ago

Cc: raffaele.salmaso+djangoproject@… added
Needs tests: unset

Added a PR => https://github.com/django/django/pull/7782

Hi, I've usually customize the submit row of many models in my admin.
At first I've used a similar strategy from the former patch (using render_to_string), but while working with my setup (only one admin.site), half of admin_views tests were broken. So this is why I used the InclusionNode for SubmitRowNode parent class.
Additionally I've added a { block submit-row %}{% endblock %} in default submit_line.html.

comment:12 by Tim Graham, 8 years ago

Needs documentation: unset
Patch needs improvement: unset

Don't forget to uncheck the "needs improvement" flags on the ticket, else it won't appear in the review queue.

comment:13 by Raffaele Salmaso, 8 years ago

Owner: changed from nobody to Raffaele Salmaso
Status: newassigned

comment:14 by Carlton Gibson, 7 years ago

Has patch: unset

PR for this was closed but this should be resolved with #27728.

comment:15 by Carlton Gibson, 7 years ago

Resolution: fixed
Status: assignedclosed

This was resolved by #27728, which allowed overriding admin templatetag's templates.

Note: See TracTickets for help on using tickets.
Back to Top