mgt/slice tab: show only the first user (TO BE MODIFIED)
authorRezende & Pedro & Carlos & Raphael <rezende@land.ufrj.br>
Fri, 3 Oct 2014 20:49:22 +0000 (17:49 -0300)
committerRezende & Pedro & Carlos & Raphael <rezende@land.ufrj.br>
Fri, 3 Oct 2014 20:49:22 +0000 (17:49 -0300)
portal/templates/fibre/fibre_institution.html

index 3ee7a55..1d6cf97 100644 (file)
@@ -103,8 +103,8 @@ $(document).ready(function() {
             var table_slices = [];
             /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
             $.each( data, function( key, val ) {
-               if(String(val.users).indexOf("@") != -1){
-               if(String(val.users).split("@")[1] == username.split("@")[1]){
+               if(String(val.users[0]).indexOf("@") != -1){
+               if(String(val.users[0]).split("@")[1] == username.split("@")[1]){
                 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
                 if(val.nodes=="undefined" || val.nodes==null){
                     nodes_length=0;
@@ -127,14 +127,14 @@ $(document).ready(function() {
                 slice_row = "<tr id='"+val.slice_hrn+"'>";
                 slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
                 slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
-                slice_row += "<td>"+users_length+"</td>";
+                slice_row += "<td>"+val.users[0]+"</td>";
                 slice_row += "<td>"+slice_url+"</td>";
                 //slice_row += "<td>"+nodes_length+"</td>";
                 slice_row += "<td>"+val.slice_expires+"</td>";
                 slice_row += "</tr>";
                 table_slices.push(slice_row);
                }
-                }
+              }
             });
            
             /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */