]> git.parisson.com Git - telemeta.git/commitdiff
cleanup and fix various haystack stuff
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 26 Jun 2015 11:24:41 +0000 (13:24 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 26 Jun 2015 11:24:41 +0000 (13:24 +0200)
telemeta/forms/haystack_form.py
telemeta/static/telemeta/css/advanceSearch.css [deleted file]
telemeta/static/telemeta/css/search.css [new file with mode: 0644]
telemeta/static/telemeta/css/search.js [deleted file]
telemeta/templates/search/addplaylist.html
telemeta/templates/search/advanceSearch.html

index cee89cb4a66f81edd92c91a7e2f4e87928b03032..75e88cdf745a9a5205e3bc923dec77744d9ca548 100644 (file)
@@ -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 (file)
index 2c69cda..0000000
+++ /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 (file)
index 0000000..2c69cda
--- /dev/null
@@ -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 (file)
index 8b2a506..0000000
+++ /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<curr){
-                $(".fullpage").show( "slide", {direction:"right"} );
-            }
-            else if(!curr){
-                $(".fullpage").fadeIn(500);
-            }
-            else if(!prev){
-                $(".fullpage").show( "slide", {direction:"right"} );
-            }
-            else{
-                $(".fullpage").show( "slide", {direction:"left"} );
-            };
-
-            //alert("prev = "+ prev +" curr = "+ curr);
-
-            var nouvellesIcones = {
-                header : 'ui-icon-carat-1-e',
-                activeHeader : 'ui-icon-carat-1-s',
-
-
-            };
-
-            $("#accordeon").accordion({
-                collapsible : true,
-                icons : nouvellesIcones,
-            });
-            $("#selectAll").click(function(){
-                if(this.checked){
-                    $(".check1").each(function(){
-                        this.checked=true;
-                    });
-                }
-                else{
-                    $(".check1").each(function(){
-                        this.checked=false;
-                    });
-                }
-            });
-       });
index b08ad8dbd4eca5fe4f01eec907081a327486aeaa..61377bbe763333efb2d44c95a6720c840a6e088e 100644 (file)
@@ -7,6 +7,7 @@
 {% endblock %}
 {% block extra_stylesheets %}
     <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/jquery-ui.css" />
+    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/search.css" />
 {% endblock %}
 {% block content %}
 
index 7703d6ddb25dfd2db199e12845f5b02fd7d82dea..7e21a4d1d71d38396deda421ebb064e26ff01a19 100644 (file)
@@ -9,6 +9,7 @@
 {% endblock %}
 {% block extra_stylesheets %}
     <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/jquery-ui.css" />
+    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/search.css" />
 {% endblock %}
 {% block content %}
     <form method="get" action=".">
             <div class="col-md-5" id="left-form">
                 <div class="fieldWrapper">
                     {{form.q.errors}}
-                    {% trans form.q.label_tag %}</br>
+                    {{ form.q.label_tag }}</br>
                     {{form.q}}
                 </div>
+                <div class="fieldWrapper">
+                    {{form.collectors.errors}}
+                    {{ form.collectors.label_tag }}</br>
+                    {{form.collectors}}
+                </div>
                 <div class="fieldWrapper">
                     {{form.location.errors}}
                     {% trans form.location.label_tag %}</br>
                     {% trans form.instruments.label_tag %}</br>
                     {{form.instruments}}
                 </div>
-                <div class="fieldWrapper">
-                    {{form.year_published_from.errors}} {{form.year_published_to.errors}}
-                    <label> {% trans "Year Published" %} :</label></br>
-                    {{form.year_published_from}} <span style="font-size:3em" aria-hidden="true">-</span> {{form.year_published_to}}
-                </div>
+
                 <div class="fieldWrapper">
                     {{form.media_type.errors}}
                     <label>{% trans "Media Type" %} :</label></br>
                 </div>
             </div>
             <div class="col-md-5" id="right-form" style="margin-left:13%">
-                <div class="fieldWrapper">
-                    {{form.collectors.errors}}
-                    {% trans form.collectors.label_tag %}</br>
-                    {{form.collectors}}
-                </div>
                 <div class="fieldWrapper">
                     {{form.recorded_from_date.errors}} {{form.recorded_to_date.errors}}
                     <label>{% trans "Recording date" %}:</label></br>
                         {%endifequal%}
                     </ul>
                 </div>
+                <div class="fieldWrapper">
+                    {{form.year_published_from.errors}} {{form.year_published_to.errors}}
+                    <label> {% trans "Year Published" %} :</label></br>
+                    {{form.year_published_from}} <span style="font-size:3em" aria-hidden="true">-</span> {{form.year_published_to}}
+                </div>
                 <div class="fieldWrapper">
                     {{form.recording_context.errors}}
                     {% trans form.recording_context.label_tag %}</br>