From 3468bd86c3f9ba548a49ff8a2a76511a5109b902 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Sat, 27 Sep 2014 22:42:21 +0100 Subject: [PATCH] filters: Redesign the filters form with the help of bootstrap Signed-off-by: Damien Lespiau Acked-by: Stephen Finucane --- htdocs/css/style.css | 18 ++++++----- patchwork/filters.py | 16 +++++----- patchwork/templates/patchwork/filters.html | 36 ++++++++++++---------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/htdocs/css/style.css b/htdocs/css/style.css index fcf5ac8c..e09821e6 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/style.css @@ -134,17 +134,21 @@ table.patchlist td img { vertical-align: bottom; } -table.patchlist td.patchlistfilters { - background: #c0c0ff; - border-top: thin solid gray; - border-bottom: thin solid black; - font-size: smaller; +.filters { + border: 1px solid #cccccc; + border-radius: 4px; + padding: 10px 20px; + margin-bottom: 20px; } -td.patchlistfilters a { - color: black; +a.filter-action { + color: black; +} +a.filter-action:hover { + text-decoration: none; } + table.patchlist td.patchlistreorder { background: #c0c0ff; border-top: thin solid gray; diff --git a/patchwork/filters.py b/patchwork/filters.py index 205be29e..3f8bd3e7 100644 --- a/patchwork/filters.py +++ b/patchwork/filters.py @@ -133,7 +133,8 @@ class SubmitterFilter(Filter): name = self.person.name return mark_safe((' ' % escape(name)) + + 'class="form-control"' + + 'value="%s">' % escape(name)) + '') @@ -188,7 +189,7 @@ class StateFilter(Filter): return None def _form(self): - str = '' % self.param selected = '' if not self.applied: @@ -248,7 +249,7 @@ class SearchFilter(Filter): value = '' if self.search: value = escape(self.search) - return mark_safe('' %\ + return mark_safe('' %\ (self.param, value)) def form_function(self): @@ -301,9 +302,10 @@ class ArchiveFilter(Filter): selected = '' if self.archive_state == b: selected = 'checked="true"' - s += ('%(label)s' + \ - '    ') % \ + s += ('') % \ {'label': label, 'param': self.param, 'selected': selected, @@ -357,7 +359,7 @@ class DelegateFilter(Filter): delegates = User.objects.filter(profile__maintainer_projects = self.filters.project) - str = '' selected = '' if not self.applied: diff --git a/patchwork/templates/patchwork/filters.html b/patchwork/templates/patchwork/filters.html index ddd20ddf..842e6435 100644 --- a/patchwork/templates/patchwork/filters.html +++ b/patchwork/templates/patchwork/filters.html @@ -149,30 +149,34 @@ function submitter_field_change(field) {% for filter in filters.applied_filters %} {{ filter.name }} = {{ filter.condition }} {% if not filter.forced %} -    +    {% endif %} {% if not forloop.last %}   |   {% endif %} {% endfor %} {% else %} - none   {% endif %} -- 2.47.3