]> git.parisson.com Git - telemeta.git/commitdiff
Ajout tri recherche simple et avancee
authormathieu <mathieu.boye28@gmail.com>
Wed, 13 Apr 2016 10:39:51 +0000 (12:39 +0200)
committermathieu <mathieu.boye28@gmail.com>
Wed, 13 Apr 2016 10:39:51 +0000 (12:39 +0200)
Former-commit-id: fc7321864fa1f8f23f64574dd6df06901226c912

telemeta/templates/search/advanceSearch.html
telemeta/templates/search/mediacollection_listhaystack.html
telemeta/templates/search/mediaitem_listhaystack.html
telemeta/templates/search/mediaresource_listhaystack.html
telemeta/templates/search/search.html

index 258481ba1cdb385fb96943df3d21f975cf62da45..dcc86f36c9de5961849ee62bf99213ede0b64557 100644 (file)
@@ -10,6 +10,7 @@
 {% 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" />
+    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/lists_sorttable.css" media="print, projection, screen"/>
 {% endblock %}
 {% block content %}
     <form method="get" action=".">
 {% block extra_javascript %}
     <script src="{{ STATIC_URL }}jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
     <script src="{{ STATIC_URL }}telemeta/js/advanceSearch.js" type="text/javascript"></script>
+    <script src="{{ STATIC_URL }}tablesorter/jquery.tablesorter.min.js" type="text/javascript"></script>
     <script>
         $(function(){
             $("#results-per-page").selectmenu({
@@ -269,6 +271,11 @@ $(function(){
         }
     });
     });
+    
+    $.tablesorter.defaults.sortList = [[1,0]];
+    
+    $("#searchtable").tablesorter({headers: {0:{sorter:false}, 2:{sorter:false}}} );
+    
 });
     </script>
 {% endblock %}
index 621fac942976a57628bc7a57f3ae284c4b3b7149..307a4f54a80b273534803fc8f5542656e75923c0 100644 (file)
@@ -3,7 +3,8 @@
 
 {% if page.object_list %}
 
-<table class="listing">
+<table class="listing" id="searchtable">
+<thead>
 <tr>
     {% if user.is_authenticated %}
         <th class="highlight"><input id="selectAll" type="checkbox"/> select all </th>
@@ -17,7 +18,9 @@
     <th>{% trans "Recording period" %}</th>
     <th>{% trans "Code" %}</th>
 </tr>
+</thead>
 {% if user.is_authenticated %}
+<tbody>
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
         <td class="highlight"><input type="checkbox" class="check1" name="selected_items_list" value="{{ result.object.id }}"/></td>
@@ -45,6 +48,7 @@
         </td>
     </tr>
     {% endfor %}
+    </tbody>
 {% else %}
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
index 47bf9da0db28b2a660900254130ccff36a4441e4..2fd5306b83f5f937b50dcd56fca93f393edb5e61 100644 (file)
@@ -3,7 +3,8 @@
 
 {% if page.object_list %}
 
-<table class="listing">
+<table class="listing" id="searchtable">
+<thead>
 <tr>
     {% if user.is_authenticated %}
         <th class="highlight"><input id="selectAll" type="checkbox"/> select all </th>
@@ -21,7 +22,9 @@
     <th>{% trans "Year of recording" %}</th>
     <th>{% trans "Code" %}</th>
 </tr>
+</thead>
 {% if user.is_authenticated %}
+<tbody>
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
         <td class="highlight"><input type="checkbox" class="check1" name="selected_items_list" value="{{ result.object.id }}"/></td>
@@ -50,6 +53,7 @@
         </td>
     </tr>
     {% endfor %}
+    </tbody>
 {% else %}
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
index 533c32f01fc0c764fbf6b20425d97f35a89c2292..e9caad86d2670b61d8dc8ded63cd3b4af083abc2 100644 (file)
@@ -3,7 +3,8 @@
 
 {% if page.object_list %}
 
-<table class="listing">
+<table class="listing" id="searchtable">
+<thead>
 <tr>
     {% if user.is_authenticated %}
         <th class="highlight"><input id="selectAll" type="checkbox"/> select all </th>
@@ -15,7 +16,9 @@
     <th>{% trans "Description" %}</th>
     <th>{% trans "Code" %}</th>
 </tr>
+</thead>
 {% if user.is_authenticated %}
+<tbody>
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
         <td class="highlight"><input type="checkbox" class="check1" name="selected_items_list" value="{{ result.object.id }}"/></td>
@@ -34,6 +37,7 @@
         </td>
     </tr>
     {% endfor %}
+    </tbody>
 {% else %}
     {% for result in page.object_list %}
     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
index 4cca777e0c3aaded2b6b87fc0e4bbbeec4d0912b..4b2945abfda8c3c44962ecfa536691af058b629d 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/lists_sorttable.css" media="print, projection, screen"/>
 {% endblock %}
 {% block content %}
         {% if query %}
 {% block extra_javascript %}
     <script src="{{ STATIC_URL }}jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
     <script src="{{ STATIC_URL }}telemeta/js/search.js" type="text/javascript"></script>
+        <script src="{{ STATIC_URL }}tablesorter/jquery.tablesorter.min.js" type="text/javascript"></script>
     <script>
 
 
                     window.location = '?q={{ query }}&amp;page=1&amp;selected_facets={{selected_facets_url|join:'&selected_facets='}}&results_page='+$(this).val();
                 }
             }).selectmenu("menuWidget").addClass("overflow");
+            
+             $.tablesorter.defaults.sortList = [[1,0]];
+    
+               $("#searchtable").tablesorter({headers: {0:{sorter:false}, 2:{sorter:false}}} );
+
 
         });
     </script>