From: afilsaime Date: Thu, 30 Apr 2015 09:10:21 +0000 (+0200) Subject: interface change on filter display X-Git-Tag: 1.6a^2~15^2~79 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=80c884cdd11c508d9ff49d50041485a1ac816ae6;p=telemeta.git interface change on filter display --- diff --git a/telemeta/forms/haystack_form.py b/telemeta/forms/haystack_form.py index cc6d628b..e2f386b6 100644 --- a/telemeta/forms/haystack_form.py +++ b/telemeta/forms/haystack_form.py @@ -22,7 +22,7 @@ class HaySearchForm(FacetedSearchForm): if value: if value == 'viewable': - sqs = sqs.narrow('item_acces:full OR item_acces:metadata OR item_acces:mixed') + sqs = sqs.narrow('item_acces:full OR item_acces:mixed').narrow('digitized:T') else: sqs = sqs.narrow(u'%s:"%s"' % (field, sqs.query.clean(value))) diff --git a/telemeta/static/telemeta/css/telemeta.css b/telemeta/static/telemeta/css/telemeta.css index 4a46b7fd..e667bf05 100644 --- a/telemeta/static/telemeta/css/telemeta.css +++ b/telemeta/static/telemeta/css/telemeta.css @@ -1238,6 +1238,7 @@ a.image-link { box-shadow: 5px 5px 5px #888888; } + .list_item, .list_item:visited, .list_item:hover{ display:block; color:#6A0307; diff --git a/telemeta/templates/search/search.html b/telemeta/templates/search/search.html index 9d5b0f2a..7ad0e700 100644 --- a/telemeta/templates/search/search.html +++ b/telemeta/templates/search/search.html @@ -2,7 +2,6 @@ {% load telemeta_utils %} {% load i18n %} - {% block title %} {% trans "Search" %} {% endblock %} @@ -19,7 +18,7 @@ - +
» recherche avancée

{% if query %} @@ -35,13 +34,13 @@ {% endifequal %} {% endifequal %}
-
Filters
+
Filters
{% if facets.fields.item_status %} {% for item_status in facets.fields.item_status %} - + {% endfor %} {% else %}

No acces facets.

@@ -52,9 +51,12 @@ {% for digitized in facets.fields.digitized %} {% ifequal digitized.0 'T' %} - + {% endifequal %} {% endfor %} + {% if digitized_count == 0 %} + + {% endif %} {% else %}

No acces facets.

{% endif %} @@ -63,13 +65,16 @@ {% if facets.fields.item_acces %} {% if viewable_count != 0 %} - + + {% endif %} + {% if viewable_count == 0 %} + {% endif %} {% comment %} {% for item_acces in facets.fields.item_acces %} {# Faire un booleen dans la vue, le passer en contexte puis verifier si il est a true ou a false pour l'affichage' #} {% ifequal item_acces.0 'none' %} - + {% endifequal %} {% endfor %} {%endcomment%} @@ -78,6 +83,23 @@ {% endif %}
Item Status{{ item_status.0 }} ({{ item_status.1 }}){{ item_status.0 }} {{ item_status.1 }}Player StatusSound ({{ digitized.1 }})Sound {{ digitized.1 }} Sound 0Access Rightviewable ({{viewable_count}})viewable {{viewable_count}}viewable {{viewable_count}}{{ item_acces.0 }} ({{ item_acces.1 }}){{ item_acces.0 }} {{ item_acces.1 }}
+
+
+ + +
+
{% with object_list as items %}
diff --git a/telemeta/views/haystack_search.py b/telemeta/views/haystack_search.py index 4b15af12..cb2ce52e 100644 --- a/telemeta/views/haystack_search.py +++ b/telemeta/views/haystack_search.py @@ -35,7 +35,8 @@ class HaystackSearch(FacetedSearchView): else: viewable_total = viewable_total + viewable[1] - extra['viewable_count'] = self.get_results().narrow('item_acces:full OR item_acces:metadata OR item_acces:mixed').count() + extra['viewable_count'] = self.get_results().narrow('item_acces:full OR item_acces:mixed').narrow('digitized:T').count() + extra['digitized_count'] = self.get_results().narrow('digitized:T').count() if self.type == 'collection': extra['type'] = 'collection' else: