mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Label the search box dependent on message type
It doesn’t make sense to say ‘Search by email address or phone number’ when you’re only looking at emails.
This commit is contained in:
@@ -871,7 +871,19 @@ class SearchUsersForm(StripWhitespaceForm):
|
||||
|
||||
class SearchNotificationsForm(StripWhitespaceForm):
|
||||
|
||||
to = SearchField('Search by phone number or email address')
|
||||
to = SearchField()
|
||||
|
||||
labels = {
|
||||
'email': 'Search by email address',
|
||||
'sms': 'Search by phone number',
|
||||
}
|
||||
|
||||
def __init__(self, message_type, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.to.label.text = self.labels.get(
|
||||
message_type,
|
||||
'Search by phone number or email address',
|
||||
)
|
||||
|
||||
|
||||
class PlaceholderForm(StripWhitespaceForm):
|
||||
|
||||
Reference in New Issue
Block a user