#28267: Change submit_line implementation to allow easier modification
---------------------------------+--------------------------------------
Reporter: Karolis Ryselis | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Comment (by Karolis Ryselis):
Correct me if I am wrong, but the only way to add a new button is to
create a `submit_line.html` under, say, `admin/app/model`, copy and paste
the content from original `submit_line.html` and make modifications.
If I extend base `submit_line.html`, I can only add buttons before `div
.submit-row` or after `div.submit-row`, there is no way to add one new
button while reusing existing code. Moreover, if I want to add new button,
I will have to copy and paste HTML of another button, changing a few
attributes. Finally, if I want to change style of my buttons by adding an
HTML `class` attribute, I will have to modify each button that exists in
any of the templates.
If we used the proposed approach, adding a button would become overriding
`get_submit_line_buttons` and adding a button to list. Finally, I could
iterate over all buttons in Python code and add a class, change the title
of a default button without having to copy and paste existing templates.
What do you think about it?
--
Ticket URL: <https://code.djangoproject.com/ticket/28267#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.9e0f15b68856e9b7e2b73d059c1a18df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.