From: Guillaume Pellerin Date: Fri, 26 Jun 2015 11:24:41 +0000 (+0200) Subject: cleanup and fix various haystack stuff X-Git-Tag: 1.6a^2~13 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b1b9068e5391021274835d50b4bc79389a7bcde0;p=telemeta.git cleanup and fix various haystack stuff --- diff --git a/telemeta/forms/haystack_form.py b/telemeta/forms/haystack_form.py index cee89cb4..75e88cdf 100644 --- a/telemeta/forms/haystack_form.py +++ b/telemeta/forms/haystack_form.py @@ -3,7 +3,7 @@ from telemeta.models import * from haystack.forms import * from haystack.query import SearchQuerySet from datetime import date - +from django.utils.translation import ugettext_lazy as _ class HaySearchForm(FacetedSearchForm): q = forms.CharField(required=False, widget=forms.TextInput(attrs={'class': 'form-control', 'type' : 'text'})) @@ -35,7 +35,7 @@ class HayAdvanceForm(SearchForm): #begin create field #to replace de basic search form field - q = forms.CharField(required=False, label=('title'), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) + q = forms.CharField(required=False, label=(_('title')), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) location = forms.CharField(required=False, label=('Location'), widget=forms.TextInput(attrs={'class': 'form-control', 'type': 'search'})) diff --git a/telemeta/static/telemeta/css/advanceSearch.css b/telemeta/static/telemeta/css/advanceSearch.css deleted file mode 100644 index 2c69cdaa..00000000 --- a/telemeta/static/telemeta/css/advanceSearch.css +++ /dev/null @@ -1,43 +0,0 @@ -.overflow{ - max-height:200px; -} - -.module ul, li { - border-radius: 0px 0px 0px 0px; -} - -.ui-selectmenu-button.ui-widget.ui-state-default{ - background-image:none; - background-color:#6a0307; - border-color:#6a0307; - color:white; -} - -.ui-selectmenu-button.ui-widget.ui-state-hover{ - background-image:none; - background-color:#6a0307; - border-color:#6a0307; - color:white; -} - -.ui-selectmenu-button.ui-widget.ui-state-focus{ - background-image:none; - background-color:#6a0307; - border-color:#6a0307; - color:white; -} - -.ui-selectmenu-button.ui-widget.ui-state-default .ui-icon{ - background-image:url("images/ui-icons_ffffff_256x240.png"); -} - -.ui-menu-item{ - background-color:white; -} - -.ui-menu-item.ui-state-focus{ - background-image:none; - background-color:#6a0307; - border-color:#6a0307; - color:white; -} diff --git a/telemeta/static/telemeta/css/search.css b/telemeta/static/telemeta/css/search.css new file mode 100644 index 00000000..2c69cdaa --- /dev/null +++ b/telemeta/static/telemeta/css/search.css @@ -0,0 +1,43 @@ +.overflow{ + max-height:200px; +} + +.module ul, li { + border-radius: 0px 0px 0px 0px; +} + +.ui-selectmenu-button.ui-widget.ui-state-default{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-hover{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-focus{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} + +.ui-selectmenu-button.ui-widget.ui-state-default .ui-icon{ + background-image:url("images/ui-icons_ffffff_256x240.png"); +} + +.ui-menu-item{ + background-color:white; +} + +.ui-menu-item.ui-state-focus{ + background-image:none; + background-color:#6a0307; + border-color:#6a0307; + color:white; +} diff --git a/telemeta/static/telemeta/css/search.js b/telemeta/static/telemeta/css/search.js deleted file mode 100644 index 8b2a5066..00000000 --- a/telemeta/static/telemeta/css/search.js +++ /dev/null @@ -1,69 +0,0 @@ -$(function() { - - function getPrevUrlParameter(sParam){ - var sPageURL = document.referrer.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) - { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == sParam) - { - return sParameterName[1]; - } - } - }; - - function getCurrUrlParameter(sParam){ - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) - { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == sParam) - { - return sParameterName[1]; - } - } - }; - - var prev = getPrevUrlParameter("page"); - var curr = getCurrUrlParameter("page"); - if(prev + {% endblock %} {% block content %} diff --git a/telemeta/templates/search/advanceSearch.html b/telemeta/templates/search/advanceSearch.html index 7703d6dd..7e21a4d1 100644 --- a/telemeta/templates/search/advanceSearch.html +++ b/telemeta/templates/search/advanceSearch.html @@ -9,6 +9,7 @@ {% endblock %} {% block extra_stylesheets %} + {% endblock %} {% block content %}
@@ -16,9 +17,14 @@
{{form.q.errors}} - {% trans form.q.label_tag %}
+ {{ form.q.label_tag }}
{{form.q}}
+
+ {{form.collectors.errors}} + {{ form.collectors.label_tag }}
+ {{form.collectors}} +
{{form.location.errors}} {% trans form.location.label_tag %}
@@ -34,11 +40,7 @@ {% trans form.instruments.label_tag %}
{{form.instruments}}
-
- {{form.year_published_from.errors}} {{form.year_published_to.errors}} -
- {{form.year_published_from}} {{form.year_published_to}} -
+
{{form.media_type.errors}}
@@ -84,11 +86,6 @@
-
- {{form.collectors.errors}} - {% trans form.collectors.label_tag %}
- {{form.collectors}} -
{{form.recorded_from_date.errors}} {{form.recorded_to_date.errors}}
@@ -115,6 +112,11 @@ {%endifequal%}
+
+ {{form.year_published_from.errors}} {{form.year_published_to.errors}} +
+ {{form.year_published_from}} {{form.year_published_to}} +
{{form.recording_context.errors}} {% trans form.recording_context.label_tag %}