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
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51913 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
92aa07e927
commit
31b34734ed
|
@ -20,8 +20,8 @@
|
|||
<div *ngIf= "communitiesResults != null && communitiesResults.length > 0">
|
||||
<div class="uk-container uk-margin-top uk-margin-bottom">
|
||||
<div class="uk-child-width-1-3@m uk-text-center uk-grid-match " uk-grid >
|
||||
<div *ngFor="let item of communitiesResults; let i = index">
|
||||
<div class="uk-card uk-card-default uk-margin-bottom">
|
||||
<ng-container *ngFor="let item of communitiesResults; let i = index">
|
||||
<div *ngIf="showCommunity(item)" class="uk-card uk-card-default uk-margin-bottom">
|
||||
<span >
|
||||
<div class="uk-card-media-top">
|
||||
<img *ngIf= "item.logoUrl != null && item.logoUrl != '' " src="{{item.logoUrl}}" alt="{{(item.title)?item.title:item.shortTitle}} logo" class="uk-height-small uk-responsive-height ">
|
||||
|
@ -32,7 +32,10 @@
|
|||
</span>
|
||||
<div class="uk-card-body">
|
||||
<div>
|
||||
<h3 class="uk-card-title">
|
||||
<div *ngIf="item.status !='all'" class="uk-float-right" uk-tooltip="title: Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100">
|
||||
<span class="uk-label uk-label-info " aria-expanded="false">Private view</span>
|
||||
</div>
|
||||
<h3 class="uk-card-title">
|
||||
<a *ngIf="!isProduction()" [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/" target="_blank">
|
||||
{{(item.title)?item.title:item.shortTitle}}</a>
|
||||
<a *ngIf="isProduction()" href="{{'https://'+getProductionPrefix()+item.communityId+'.openaire.eu'}}" target="_blank">
|
||||
|
@ -53,7 +56,7 @@
|
|||
<manage [communityId]="item.communityId"></manage>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@ import {ErrorCodes} from '../openaireLibrary/utils/
|
|||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
|
||||
import {Session} from '../openaireLibrary/login/utils/helper.class';
|
||||
@Component({
|
||||
selector: 'communities',
|
||||
templateUrl: 'communities.component.html',
|
||||
|
@ -81,4 +81,21 @@ export class CommunitiesComponent {
|
|||
getProductionPrefix():string{
|
||||
return ConnectHelper.getProductionPrefix(document.location.hostname);
|
||||
}
|
||||
showCommunity(community):boolean{
|
||||
if(community['status'] == "hidden"){
|
||||
return false;
|
||||
}else if(community['status'] == "manager"){
|
||||
var mail = Session.getUserEmail();
|
||||
if(mail == null){ // no user
|
||||
return false;
|
||||
}else if(Session.isCommunityCurator() || Session.isPortalAdministrator()){
|
||||
return true;
|
||||
}else if(community.managers.indexOf(mail)!=-1){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
<div *ngIf="communityId == null || communityId == ''" class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-alert uk-alert-primary">
|
||||
No community chosen
|
||||
</div>
|
||||
<manage *ngIf="communityId != null && communityId != ''" [communityId]="communityId" class=" uk-float-right"></manage>
|
||||
<subscribe *ngIf="communityId != null && communityId != ''" [communityId]="communityId" class=" uk-float-right"></subscribe>
|
||||
|
||||
<div class="uk-clearfix uk-margin-bottom">
|
||||
<manage *ngIf="communityId != null && communityId != ''" [communityId]="communityId" class=" uk-float-right"></manage>
|
||||
<subscribe *ngIf="communityId != null && communityId != ''" [communityId]="communityId" class=" uk-float-right"></subscribe>
|
||||
</div>
|
||||
<div *ngIf="communityId != null && communityId != '' && community != null">
|
||||
<blockquote>
|
||||
<div *ngIf="community.title != null">
|
||||
|
@ -103,23 +104,23 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div *ngIf="communityId != null && communityId != ''" class="uk-grid-small uk-margin-medium uk-grid" uk-grid="">
|
||||
<div *ngIf="IsEntityEnabled('publication')" class="uk-width-expand@m">
|
||||
<h2 class="uk-h3 uk-heading-line uk-text-primary">
|
||||
<span>Most recent publications</span>
|
||||
<span>Recent publications</span>
|
||||
</h2>
|
||||
<results-comp [(results)]=publicationResults [(total)]=publicationTotal resultType="publication" [community]=community [params]=params></results-comp>
|
||||
</div>
|
||||
<div *ngIf="IsEntityEnabled('dataset')" class="uk-width-expand@m">
|
||||
<h2 class="uk-h3 uk-heading-line uk-text-primary">
|
||||
<span>Most recent research data</span>
|
||||
<span>Recent research data</span>
|
||||
</h2>
|
||||
<results-comp [(results)]=researchDataResults [(total)]=researchDataTotal resultType="dataset" [community]=community [params]=params></results-comp>
|
||||
</div>
|
||||
<div *ngIf="IsEntityEnabled('software')" class="uk-width-expand@m">
|
||||
<h2 class="uk-h3 uk-heading-line uk-text-primary">
|
||||
<span>Most recent software</span>
|
||||
<span>Recent software</span>
|
||||
</h2>
|
||||
<results-comp [(results)]=softwareResults [(total)]=softwareTotal resultType="software" [community]=community [params]=params></results-comp>
|
||||
</div>
|
||||
|
@ -129,7 +130,7 @@
|
|||
<!--div>
|
||||
<div class="uk-margin-large-top">
|
||||
<h2 class="uk-h3 uk-text-primary">
|
||||
Most recent research results
|
||||
Recent research results
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -10,43 +10,8 @@ export class PiwikHelper{
|
|||
"mes":87,
|
||||
"ni":88,
|
||||
"oa-pg":89,
|
||||
"rda":90
|
||||
|
||||
"rda":90,
|
||||
"aginfra":93
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
beta.connect.openaire.eu
|
||||
|
||||
80
|
||||
|
||||
beta.dh-ch.openaire.eu
|
||||
|
||||
81
|
||||
|
||||
beta.ee.openaire.eu
|
||||
|
||||
82
|
||||
|
||||
beta.egi.openaire.eu
|
||||
83
|
||||
beta.elixir-gr.openaire.eu
|
||||
84
|
||||
beta.fam.openaire.eu
|
||||
85
|
||||
beta.instruct.openaire.eu
|
||||
86
|
||||
beta.mes.openaire.eu
|
||||
87
|
||||
beta.ni.openaire.eu
|
||||
88
|
||||
beta.oa-pg.openaire.eu
|
||||
89
|
||||
beta.rda.openaire.eu
|
||||
90
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue