Merge pull request #2208 from alphagov/label-message-type-search

Label the search box dependent on message type
This commit is contained in:
Chris Hill-Scott
2018-08-09 09:37:01 +01:00
committed by GitHub
3 changed files with 32 additions and 4 deletions

View File

@@ -877,7 +877,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):