use SliceList rather than SimpleList
[unfold.git] / plugins / static / js / simplelist.js
index 7cce7dc..c49456b 100644 (file)
@@ -64,6 +64,7 @@ simplelist_debug=false;
         }
         var options = e.data.data().SimpleList.options;
         var is_cached = options.query.timestamp != 'now' ? true : false;
+       // here is where we use 'key' and 'value' from the SimpleList (python) constructor
        html_code=myslice_html_ul(rows, options.key, options.value, is_cached)+"<br/>";
         e.data.html(html_code);
        var $elt = e.data;
@@ -80,12 +81,12 @@ simplelist_debug=false;
         return out;
     }
     
-    function myslice_html_li(key, value) {
-        var cached = '';
+    function myslice_html_li(key, value,is_cached) {
+        var cached = is_cached ? "(cached)" : "";
         if (key == 'slice_hrn') {
-            return "<li class='icn icn-play'><a href='/slice/" + value + "'>" + value + cached + "</a></li>";
+            return "<li class='slice-hrn'><i class='icon-play-circle'></i><a href='/slice/" + value + "'>" + value + cached + "</a></li>";
         } else if (key == 'network_hrn') {
-            return "<li class='icn icn-play'>" + value + cached + "</li>";
+            return "<li class='network-hrn'><i class='icon-play-circle'></i>" + value + cached + "</li>";
         } else {
             return "<li>" + value + "</li>";
         }