Fix: update users to a slice
authorYasin <mohammed-yasin.rahman@lip6.fr>
Wed, 23 Jul 2014 10:22:01 +0000 (12:22 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Wed, 23 Jul 2014 10:22:01 +0000 (12:22 +0200)
portal/templates/slice-tab-users-view.html

index 103a1ff..1aaea71 100644 (file)
                     console.log(slice_users);
                 }
             });
-       }); // post rest/user
-    }
+       }); // post rest/use
+
+               $('button#addusers').click(function() {
+               $.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
+                       if(data.success){
+                       // TODO: highlight row after success
+                       //$('tr[id="'+record_id+'"]').highlight();
+                       mysliceAlert('Success: slice updated','success', true);
+                       }else{
+                       mysliceAlert('Rest Error for: '+data.error,'warning', true);
+                       }
+               }); // post update slice
+               // TODO: refresh table
+               //window.location="/portal/institution#slices";
+               }); // button#addusers click
+
+    } // get_users_in_slice
 
     $(document).ready(function() {
             // TODO: Add a filter based on the list of authorities
 
             get_users_in_slice("{{user_details.parent_authority}}");
 
-               $('button#addusers').click(function() {
-                $.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
-                       if(data.success){
-                       // TODO: highlight row after success
-                       //$('tr[id="'+record_id+'"]').highlight();
-                       mysliceAlert('Success: slice updated','success', true);
-                       }else{
-                       mysliceAlert('Rest Error for: '+data.error,'warning', true);
-                       }
-                }); // post update slice
-            
-               // TODO: refresh table
-               //window.location="/portal/institution#slices";
-
-            }); // button#addusers click
        $('[title!=""]').qtip();
     }); // document ready
 </script>