Opened 7 years ago

Closed 4 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@…, Ciantic, 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 7 years ago.
Adds blocks around the top and bottom submit buttons.
change_form.diff (1.6 KB) - added by Ciantic 7 years ago.
more blocks
change_form_all_in_blocks.diff (2.4 KB) - added by Ciantic 7 years ago.
Even more blocks! Now all is customizable.

Download all attachments as: .zip

Change History (21)

Changed 7 years ago by kosmik

Adds blocks around the top and bottom submit buttons.

comment:1 follow-up: Changed 7 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 7 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 7 years ago by niels

  • Cc niels.busch@… added

comment:4 Changed 7 years ago by niels

  • Cc niels.busch@… removed

comment:5 Changed 7 years ago by kmtracey

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

comment:6 Changed 7 years ago by Ciantic

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 7 years ago by Ciantic

more blocks

Changed 7 years ago by Ciantic

Even more blocks! Now all is customizable.

comment:7 Changed 7 years ago by Ciantic

  • Cc ciantic@… added

comment:8 Changed 7 years ago by Ciantic

  • Component changed from Contrib apps to django.contrib.admin
  • milestone set to post-1.0
  • Version changed from 1.0 to SVN

comment:9 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:10 Changed 7 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:11 Changed 6 years ago by anonymous

  • Cc andy@… added

comment:12 Changed 6 years ago by rvdrijst

  • Cc rvdrijst added

comment:13 Changed 6 years ago by jacob

  • milestone changed from 1.1 to 1.2

comment:14 Changed 6 years ago by ubernostrum

  • milestone 1.2 deleted

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

comment:15 Changed 5 years ago by Ciantic

  • Cc Ciantic added; ciantic@… removed

comment:16 Changed 4 years ago by patchhammer

  • Easy pickings unset
  • Patch needs improvement set
  • Severity set to Normal
  • Type set to Uncategorized

change_form_all_in_blocks.diff fails to apply cleanly on to trunk

comment:17 Changed 4 years ago by lukeplant

  • Type changed from Uncategorized to New feature

comment:18 Changed 4 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

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