Opened 8 years ago

Closed 5 years ago

#9460 closed New feature (fixed)

Template blocks for submit buttons in admin's change view

Reported by: kosmik Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords: admin, submit, buttons, template
Cc: bernhard.bender@…, Jari Pennanen, andy@…, rvdrijst Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX:

Description

Having the submit buttons inside their own template blocks in admin/change_form.html would be useful when one wants to customize the buttons. It is of course possible to override the "content" block but that block has quite a lot of code and copying it would be very unefficient. The template block approach seems to be the simplest one. Another option would be to enable overriding the admin/submit_line.html template.

Attachments (3)

submit_button_blocks_r9290.diff (1.2 KB) - added by kosmik 8 years ago.
Adds blocks around the top and bottom submit buttons.
change_form.diff (1.6 KB) - added by Jari Pennanen 8 years ago.
more blocks
change_form_all_in_blocks.diff (2.4 KB) - added by Jari Pennanen 8 years ago.
Even more blocks! Now all is customizable.

Download all attachments as: .zip

Change History (21)

Changed 8 years ago by kosmik

Adds blocks around the top and bottom submit buttons.

comment:1 Changed 8 years ago by bernhard.bender@…

Cc: bernhard.bender@… added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

While you're at it, please inclose the reming section of admin/change_form.html in their own blocks.
I need the submit line block, and would also like to see the remaining parts block'ed.

-Bernhard

comment:2 in reply to:  1 Changed 8 years ago by kosmik

Which parts in particular would you to have inside their own blocks? I looked at the template but didn't see any places where further blocks would help. Maybe it would be possible for you to create a patch yourself? That's almost easier than trying to explain the required changes to me or someone else.

comment:3 Changed 8 years ago by Niels Sandholt Busch

Cc: niels.busch@… added

comment:4 Changed 8 years ago by Niels Sandholt Busch

Cc: niels.busch@… removed

comment:5 Changed 8 years ago by Karen Tracey

#10283 looks like a similar request and also contains a patch.

comment:6 Changed 8 years ago by Jari Pennanen

My patch includes more blocks, I support the idea of having customizable errors too! And, the submit_row_top should be outside the if, if you ask me!

Changed 8 years ago by Jari Pennanen

Attachment: change_form.diff added

more blocks

Changed 8 years ago by Jari Pennanen

Even more blocks! Now all is customizable.

comment:7 Changed 8 years ago by Jari Pennanen

Cc: ciantic@… added

comment:8 Changed 8 years ago by Jari Pennanen

Component: Contrib appsdjango.contrib.admin
milestone: post-1.0
Version: 1.0SVN

comment:9 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:10 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:11 Changed 8 years ago by anonymous

Cc: andy@… added

comment:12 Changed 8 years ago by rvdrijst

Cc: rvdrijst added

comment:13 Changed 7 years ago by Jacob

milestone: 1.11.2

comment:14 Changed 7 years ago by James Bennett

milestone: 1.2

1.2 is feature-frozen, moving this feature request off the milestone.

comment:15 Changed 7 years ago by Jari Pennanen

Cc: Jari Pennanen added; ciantic@… removed

comment:16 Changed 5 years ago by patchhammer

Easy pickings: unset
Patch needs improvement: set
Severity: Normal
Type: Uncategorized

change_form_all_in_blocks.diff fails to apply cleanly on to trunk

comment:17 Changed 5 years ago by Luke Plant

Type: UncategorizedNew feature

comment:18 Changed 5 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

In [16956]:

Fixed #9460 -- Added template blocks for submit buttons rows in admin app model add/change views.

This allows for easier customization. Thanks kosmik for report and patch.

Refs #13875.

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