X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Ffed4fire%2Ffed4fire_institution.html;h=7e9c176efeca7ba159b712ad2b25afb6fa604aa4;hb=c457730e8d49ee507846edeb8a474374f0122f25;hp=d4025864bfbd45807a777284113225a26ffd4212;hpb=3b23a22c52227bc896d3e63d21073564d66d9b8b;p=unfold.git
diff --git a/portal/templates/fed4fire/fed4fire_institution.html b/portal/templates/fed4fire/fed4fire_institution.html
index d4025864..7e9c176e 100644
--- a/portal/templates/fed4fire/fed4fire_institution.html
+++ b/portal/templates/fed4fire/fed4fire_institution.html
@@ -87,8 +87,8 @@
- {% if pi %}
+ {% if pi %}
Create project
Delete selected projects
{% else %}
@@ -158,7 +158,14 @@ $(document).ready(function() {
slice_row = "
";
slice_row += " ";
- slice_row += "" + val.slice_hrn + " ";
+
+ // filter links to slices, only those that the user has credentials for
+ s = myslice.user.slices;
+ if(s.length > 0 && $.inArray(val.slice_hrn, myslice.user.slices)!=-1){
+ slice_row += "" + val.slice_hrn + " ";
+ }else{
+ slice_row += "" + val.slice_hrn + " ";
+ }
slice_row += ""+users_length+" ";
slice_row += ""+slice_url+" ";
//slice_row += ""+nodes_length+" ";
@@ -192,7 +199,7 @@ $(document).ready(function() {
});
{% else %}
- $.post("/rest/user/",{'fields':['user_hrn','user_email'],'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
+ $.post("/rest/myslice:user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
var list_users = [];
var table_users = [];
/* Available fields
@@ -202,7 +209,7 @@ $(document).ready(function() {
$.each( data, function( key, val ) {
list_users.push( "" + val.user_email + " " );
user_row = " ";
- user_row += " ";
+ user_row += " ";
user_row += ""+val.user_email+" ";
user_row += ""+val.user_hrn+" ";
/*
@@ -224,7 +231,14 @@ $(document).ready(function() {
console.log(val);
project_row = " ";
project_row += " ";
- project_row += ""+val.authority_hrn+" ";
+
+ // filter links to projects, only those that the user has credentials for
+ p = myslice.projects;
+ if(p.length > 0 && $.inArray(val.authority_hrn, p)!=-1){
+ project_row += ""+val.authority_hrn+" ";
+ }else{
+ project_row += ""+val.authority_hrn+" ";
+ }
project_row += " ";
table_projects.push(project_row);
});
@@ -311,6 +325,17 @@ $(document).ready(function() {
$.post("/update/myslice:authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'},'params':{'pi_users':pi_users}}, function(data) {
if(data.success){
mysliceAlert('Success: User rights removed from: {{user_details.parent_authority}}','success', true);
+ {% if project %}
+ // remove the user from the list of pis of the project displayed
+ $('input:checkbox.user').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ $('tr[id="'+record_id+'"]').fadeOut("slow");
+ $('tr[id="'+record_id+'"]').remove();
+ }
+
+ });
+ {% endif %}
}else{
mysliceAlert('Rest Error for: '+data.error,'warning', true);
//alert("Rest Error for "+record_id+": "+data.error);