Revision 51913
Added by Argiro Kokogiannaki almost 6 years ago
communities.component.ts | ||
---|---|---|
16 | 16 |
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; |
17 | 17 |
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; |
18 | 18 |
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; |
19 |
|
|
19 |
import {Session} from '../openaireLibrary/login/utils/helper.class'; |
|
20 | 20 |
@Component({ |
21 | 21 |
selector: 'communities', |
22 | 22 |
templateUrl: 'communities.component.html', |
... | ... | |
81 | 81 |
getProductionPrefix():string{ |
82 | 82 |
return ConnectHelper.getProductionPrefix(document.location.hostname); |
83 | 83 |
} |
84 |
showCommunity(community):boolean{ |
|
85 |
if(community['status'] == "hidden"){ |
|
86 |
return false; |
|
87 |
}else if(community['status'] == "manager"){ |
|
88 |
var mail = Session.getUserEmail(); |
|
89 |
if(mail == null){ // no user |
|
90 |
return false; |
|
91 |
}else if(Session.isCommunityCurator() || Session.isPortalAdministrator()){ |
|
92 |
return true; |
|
93 |
}else if(community.managers.indexOf(mail)!=-1){ |
|
94 |
return true; |
|
95 |
} |
|
96 |
return false; |
|
97 |
} |
|
98 |
return true; |
|
99 |
|
|
100 |
} |
|
84 | 101 |
} |
Also available in: Unified diff
Check for the status before showing communities | show label 'Private view' when the status is hidden| minor layout changes in community landing| add piwik id for aginfra