From 46a37afa86197ee82464c9e322c24161c467b126 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 1 Nov 2013 10:48:34 -0200 Subject: [PATCH] Changing filters on mobile and search form --- src/search/templates/search/includes/search_filters.html | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/search/templates/search/search.html | 21 ++++++++++++++++++++- src/static/css/screen.css | 8 ++++++++ src/templates/base.html | 25 ++++++++++++++++++++++++- 4 files changed, 214 insertions(+), 166 deletions(-) diff --git a/src/search/templates/search/includes/search_filters.html b/src/search/templates/search/includes/search_filters.html index ba889af..c69f14c 100644 --- a/src/search/templates/search/includes/search_filters.html +++ b/src/search/templates/search/includes/search_filters.html @@ -1,172 +1,170 @@ {% load i18n superarchives %} -

{% trans "Filters" %}

- - {% if filters %} - -
-
- - - - - - - {% for field_lookup, field_display, field_value in filters.fields %} -
- - {% if field_lookup == "list" %} - - {% elif field_lookup == "size" %} -
    - {% for value, option in size_choices %} - {% with value|add:" "|add:size_chosen as sizelistadd %} - {% if value in field_value %} -
  • - - {{ option }} -
  • - {% else %} -
  • - - {{ option }} -
  • - {% endif %} - {% endwith %} - {% endfor %} -
- {% elif field_lookup == "mimetype" %} -
    - {% for value, option in mimetype_choices %} - {% with value|add:" "|add:mimetype_chosen as mimelistadd %} - {% if value in mimetype_chosen %} -
  • - - {{ option }} -
  • - {% else %} -
  • - - {{ option }} -
  • - {% endif %} - {% endwith %} - {% endfor %} -
- {% elif field_lookup == "used_by" %} -
    - {% for value, option in used_by_choices %} - {% with value|add:" "|add:used_by_chosen as used_byadd %} - {% if value in used_by_chosen %} -
  • - - {{ option }} -
  • - {% else %} -
  • - - {{ option }} -
  • - {% endif %} - {% endwith %} - {% endfor %} -
- {% else %} - - {% endif %} -
- {% endfor %} - -
-


- {% endif %} - -

{% trans "Sort by" %}

+{% if filters %} - - {% if not request.GET.type %} -

{% trans "Types" %}

- - - {% endif %}
- {% for name, value in request.GET.items %} - {% if value and not name == "since" and not name == "until" %} - - {% endif %} + + + + + + + {% for field_lookup, field_display, field_value in filters.fields %} +
+ + {% if field_lookup == "list" %} + + {% elif field_lookup == "size" %} +
    + {% for value, option in size_choices %} + {% with value|add:" "|add:size_chosen as sizelistadd %} + {% if value in field_value %} +
  • + + {{ option }} +
  • + {% else %} +
  • + + {{ option }} +
  • + {% endif %} + {% endwith %} + {% endfor %} +
+ {% elif field_lookup == "mimetype" %} +
    + {% for value, option in mimetype_choices %} + {% with value|add:" "|add:mimetype_chosen as mimelistadd %} + {% if value in mimetype_chosen %} +
  • + + {{ option }} +
  • + {% else %} +
  • + + {{ option }} +
  • + {% endif %} + {% endwith %} + {% endfor %} +
+ {% elif field_lookup == "used_by" %} +
    + {% for value, option in used_by_choices %} + {% with value|add:" "|add:used_by_chosen as used_byadd %} + {% if value in used_by_chosen %} +
  • + + {{ option }} +
  • + {% else %} +
  • + + {{ option }} +
  • + {% endif %} + {% endwith %} + {% endfor %} +
+ {% else %} + + {% endif %} +
{% endfor %} -
- -
- - - - -
-
-
- -
- - - - -
-
-

- -

+
+


+{% endif %} + +

{% trans "Sort by" %}

+ + +{% if not request.GET.type %} +

{% trans "Types" %}

+ + +{% endif %} +
+
+ {% for name, value in request.GET.items %} + {% if value and not name == "since" and not name == "until" %} + + {% endif %} + {% endfor %} +
+ +
+ + + + +
+
+
+ +
+ + + + +
+
+

+ +

+
diff --git a/src/search/templates/search/search.html b/src/search/templates/search/search.html index 7e59636..2e76098 100644 --- a/src/search/templates/search/search.html +++ b/src/search/templates/search/search.html @@ -41,8 +41,27 @@
+ +
    @@ -72,8 +91,8 @@
{% endif %} -
+ {% endblock %} diff --git a/src/static/css/screen.css b/src/static/css/screen.css index 069c2d8..28c5377 100644 --- a/src/static/css/screen.css +++ b/src/static/css/screen.css @@ -395,3 +395,11 @@ ul.emails { span.highlighted { background-color: yellow; } + +/* Mobile search form */ +.navbar-nav > li > .mobile-search-form { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; + padding: 5px 15px 5px 15px; +} diff --git a/src/templates/base.html b/src/templates/base.html index bfdc566..fadc00c 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -2,7 +2,7 @@ {% load i18n browserid conversejs gravatar %} - {% block head %} + {% block head %} @@ -54,13 +54,36 @@