﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28267	Change submit_line implementation to allow easier modification	Karolis Ryselis	nobody	"Currently submit_line renders its buttons inside a div element and 5 if statements in the template are used to show or hide these buttons. This makes it difficult to add more buttons. Whole html template has to be overridden because there is no way to place the buttons inside div.submit-row element.
We needed quite a few of those buttons, e.g., save as draft, save and add invoice (shortcut button).
There is no way to change the default button either - `class=""default""` is hardcoded in Save button.

Proposed solution:
define buttons in admin class. `ModelAdmin` could have a method `get_submit_line_buttons` which returns a list of buttons. A single item of this list could be either a dict or an object of a new Button class. Suggested dict keys or object properties:
`id` - translates to HTML id attribute
`display_name` - visible text on the button
`name` - HTML name attribute
`highlighted` - `bool`, equivalent to current `class=""default""` if `True`
`onclick` - hook to attach JavaScript

Current buttons could be defined in default `ModelAdmin.get_submit_line_buttons` implementation with the same conditions as now. Template would consist of a loop that iterates over a list of buttons and renders them."	New feature	new	contrib.admin	dev	Normal				Accepted	0	0	0	0	0	0
