mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-08 10:28:57 -04:00
Put the currently selected branding top of list
There’s something that feels a bit off about not being able to see the name of the currently-selected branding when you land on the page. Putting it at the top also means that you can easily switch back to it if you change your mind.
This commit is contained in:
@@ -890,9 +890,14 @@ def service_set_email_branding(service_id):
|
||||
form = ServiceSetBranding()
|
||||
|
||||
# dynamically create org choices, including the null option
|
||||
email_brandings = sorted(get_branding_as_value_and_label(email_branding),
|
||||
key=lambda tup: tup[1].lower())
|
||||
form.branding_style.choices = [('None', 'GOV.UK')] + email_brandings
|
||||
form.branding_style.choices = sorted(
|
||||
get_branding_as_value_and_label(email_branding) + [('None', 'GOV.UK')],
|
||||
key=lambda branding: (
|
||||
branding[0] != current_service.email_branding,
|
||||
branding[0] is not 'None',
|
||||
branding[1].lower(),
|
||||
),
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
branding_style = None if form.branding_style.data == 'None' else form.branding_style.data
|
||||
|
||||
Reference in New Issue
Block a user