]> git.parisson.com Git - telemeta.git/commitdiff
add sort table for list only in desk
authorKaltar5679 <killian.mary@outlook.fr>
Mon, 1 Jun 2015 08:05:32 +0000 (10:05 +0200)
committerKaltar5679 <killian.mary@outlook.fr>
Mon, 1 Jun 2015 08:05:32 +0000 (10:05 +0200)
telemeta/templates/telemeta/lists.html

index f53eb190b099196e7d428b93f15f50f21e1c3ac6..fc8d6043b058c6637f13ead3a729725a0f650f49 100644 (file)
@@ -5,6 +5,8 @@
 {% block extra_javascript %}
 <script src="{{ STATIC_URL }}telemeta/js/popupdiv.js" type="text/javascript"></script>
 <script src="{{ STATIC_URL }}telemeta/js/playlist.js" type="text/javascript"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}telemeta/js/jquery-latest.js"></script>
+<script type="text/javascript" src="{{ STATIC_URL }}telemeta/js/jquery.tablesorter.min.js"></script>
 <script>
     jQuery(window).ready(function(){
         var p = playlistUtils;
         playlistUtils.addEditPlaylist('{{playlist.playlist.public_id}}','{{ playlist.playlist.title }}','{{playlist.playlist.description}}');
     {% endfor %}
 
+</script>
 
+{% comment "added by Killian Mary" %}{% endcomment %}
+<script>
+$(document).ready(function(){
+    {% for playlist in playlists %}
+        $("#{{playlist.playlist.public_id}}tb").tablesorter( {sortList: [[2,0]]}, {headers: {6:{sorter:false}}} );
+    {% endfor %}
+});
 </script>
+{% comment "added by Killian Mary" %}end{% endcomment %}
+
 {% endblock %}
 
 {% block content %}
@@ -69,7 +81,9 @@
          </tr>
         {% endif %}
     </table>
-    <table class="listing" width="100%">
+    {% comment "added by Killian Mary, for sort table" %}{% endcomment %}
+    <table id="{{playlist.playlist.public_id}}tb" class="listing" width="100%">
+        <thead>
         <tr>
             <th class="highlight">{% trans "Title" %}</th>
             <th>{% trans "Type" %}</th>
@@ -79,6 +93,8 @@
             <th>{% trans "Digitized" %}</th>
             <th>{% trans "Action" %}</th>
         </tr>
+        </thead>
+        <tbody>
         {% for resource in playlist.resources %}
         <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
             <td>
             </td>
         </tr>
         {% endfor %}
+        </tbody>
     </table>
     {% endfor %}
 </div>