diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-09-12 10:55:21 +1000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-09-12 10:55:21 +1000 |
commit | 5799a55da8c20e0f3820b2e131c20083fe559675 (patch) | |
tree | e05741730a5769925efa90817718bbda30bff4f2 /apps | |
parent | e472cd43637c3b30b45ace46146addb46b8a5980 (diff) | |
download | patchwork-5799a55da8c20e0f3820b2e131c20083fe559675.tar patchwork-5799a55da8c20e0f3820b2e131c20083fe559675.tar.gz |
Remember state filter settings
We need to set a few 'selected' options..
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/patchwork/filters.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/patchwork/filters.py b/apps/patchwork/filters.py index 228c9c2..a722a24 100644 --- a/apps/patchwork/filters.py +++ b/apps/patchwork/filters.py @@ -188,8 +188,18 @@ class StateFilter(Filter): def _form(self): str = '<select name="%s">' % self.param - str += '<option value="%s">any</option>' % self.any_key - str += '<option value="">%s</option>' % self.action_req_str + + selected = '' + if not self.applied: + selected = 'selected' + str += '<option %s value="%s">any</option>' % (selected, self.any_key) + + selected = '' + if self.applied and self.state == None: + selected = 'selected' + str += '<option %s value="">%s</option>' % \ + (selected, self.action_req_str) + for state in State.objects.all(): selected = '' if self.state and self.state == state: |