Templates: small cosmetic changes, wip for filter on authorities for users in a slice
authorLoic Baron <loic.baron@lip6.fr>
Thu, 5 Jun 2014 12:54:28 +0000 (14:54 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Thu, 5 Jun 2014 12:54:28 +0000 (14:54 +0200)
portal/templates/account-view.html
portal/templates/slice-resource-view.html
portal/templates/slice-tab-users-view.html

index 353a83c..c60efb9 100644 (file)
                                        <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>
                                                </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>
index 707fa36..27ac3c5 100644 (file)
                                <!-- <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}}
index 50806ac..6942861 100644 (file)
                </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 = [];
                        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();