Make email "source" filter use a dropdown, in bouncer UI.
This commit is contained in:
parent
0ddb5bffd7
commit
c42e80f87a
2 changed files with 26 additions and 2 deletions
|
@ -85,6 +85,23 @@ class BooleanSearchFilter(SearchFilter):
|
|||
["True", "False"])
|
||||
|
||||
|
||||
class ChoiceSearchFilter(SearchFilter):
|
||||
"""
|
||||
Generic search filter where the user may only select among a specific set
|
||||
of choices.
|
||||
"""
|
||||
|
||||
def __init__(self, choices):
|
||||
self.choices = choices
|
||||
|
||||
def __call__(self, name, label=None, **kwargs):
|
||||
super(ChoiceSearchFilter, self).__init__(name, label=label, **kwargs)
|
||||
return self
|
||||
|
||||
def value_control(self):
|
||||
return tags.select(self.name, self.search.config.get(self.name), self.choices)
|
||||
|
||||
|
||||
def EnumSearchFilter(enum):
|
||||
options = enum.items()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue