From: Loic Baron <loic.baron@lip6.fr>
Date: Thu, 5 Jun 2014 12:54:28 +0000 (+0200)
Subject: Templates: small cosmetic changes, wip for filter on authorities for users in a slice
X-Git-Tag: myslice-1.1~77^2~1
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e6da36658fb9bce878dd7f9e22694e8dccd04bb4;p=unfold.git

Templates: small cosmetic changes, wip for filter on authorities for users in a slice
---

diff --git a/portal/templates/account-view.html b/portal/templates/account-view.html
index 353a83c2..c60efb96 100644
--- a/portal/templates/account-view.html
+++ b/portal/templates/account-view.html
@@ -127,7 +127,7 @@
 			    		<tr class="even" id="pkey_row">
 						 {%if 'N/A' not in user_private_key%}
 			      			<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
-			      			<td class="value">********<a href="#">
+			      			<td class="value">********<a href="#"></a>
 			      				<button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
 									<span class="glyphicon glyphicon-download"></span> Download	
 								</button>
@@ -136,7 +136,7 @@
 			    			</td>
 						  {%else%}
 							<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
-		 					<td class="value">********<a href="#">
+		 					<td class="value">********<a href="#"></a>
 		     					<button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
 		        					<span class="glyphicon glyphicon-download"></span> Download 
 		     					</button>
diff --git a/portal/templates/slice-resource-view.html b/portal/templates/slice-resource-view.html
index 707fa364..27ac3c5b 100644
--- a/portal/templates/slice-resource-view.html
+++ b/portal/templates/slice-resource-view.html
@@ -79,7 +79,13 @@
 				<!-- <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table> -->
 			</div>
 			<div id="reserved" class="panel" style="height:370px;display:none;">
-                {{list_reserved_resources}}
+                <table width="80%">
+                    <tr><th width="50%" style="text-align:center;">resources</th><th width="50%" style="text-align:center;">leases</th></tr>
+                    <tr>
+                        <td style="text-align:center">{{list_reserved_resources}}</td>
+                        <td style="text-align:center">{{list_reserved_leases}}</td>
+                    </tr>
+                </table>
 			</div>
 			<div id="pending" class="panel" style="height:370px;display:none;">
                 {{pending_resources}}
diff --git a/portal/templates/slice-tab-users-view.html b/portal/templates/slice-tab-users-view.html
index 50806ac6..6942861a 100644
--- a/portal/templates/slice-tab-users-view.html
+++ b/portal/templates/slice-tab-users-view.html
@@ -40,6 +40,11 @@
         	</div>
 <script>
     $(document).ready(function() {
+            // TODO: Add a filter based on the list of authorities
+        	$.post("/rest/authority/",{'fields':['authority_hrn']}, function( data ) {
+                console.log(data);
+            }); // post rest/authority
+
 			var slice_users = [];
         	$.post("/rest/user/",{'filters':{'parent_authority': "{{user_details.parent_authority}}"}}, function( data ) {
             	var list_users = [];
@@ -72,33 +77,23 @@
                 	table_users.push(user_row);
                 
             	});
-				 console.log("slice users before");
-				 console.log(slice_users);
             
 				$("table#user-tab tr:last").after(table_users.join( "" ));
             	$("div#user-tab-loaded").css("display","block");
             	$("div#user-tab-loading").css("display","none");
                 $("input:checkbox.user").click(function() {
-                    console.log("user_hrn");
                     user_hrn = $(this).closest('tr').find('td:eq(2)').html();
-                    console.log(user_hrn);
-                    console.log(this.checked);
                     if(this.checked){
                         var record_id = this.id;
                         slice_users.push (user_hrn);
                     }else{
-                        console.log("not checked");
-                        slice_users = $.grep(slice_users, function( user, i ) {
-                            return user != user_hrn;
-                        });
+                        console.log(slice_users);
                     }
-                    console.log(slice_users);
                 });
            
          	}); // post rest/user
 	        $('button#addusers').click(function() {
                 $.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
-                    console.log(data);
                 	if(data.success){
                     	// TODO: highlight row after success
                     	//$('tr[id="'+record_id+'"]').highlight();