1
|
<ng-template #card let-organization="organization">
|
2
|
<div class="uk-card-media-top affiliation-logo uk-padding-small">
|
3
|
<img *ngIf= "organization.logo_url != null && organization.logo_url != '' " class="uk-text-center"
|
4
|
src="{{urlPrefix(organization.logo_url) + organization.logo_url}}" alt="{{(organization.name)?organization.name:''}} logo">
|
5
|
<span *ngIf= "organization.logo_url == null || organization.logo_url == '' "class="uk-icon uk-padding-small">
|
6
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" icon="image" ratio="2.5"><circle cx="16.1" cy="6.1" r="1.1"></circle><rect fill="none" stroke="#000" x="0.5" y="2.5" width="19" height="15"></rect><polyline fill="none" stroke="#000" stroke-width="1.01" points="4,13 8,9 13,14"></polyline><polyline fill="none" stroke="#000" stroke-width="1.01" points="11,12 12.5,10.5 16,14"></polyline></svg>
|
7
|
</span>
|
8
|
</div>
|
9
|
</ng-template>
|
10
|
|
11
|
<ng-template #affiliations_list>
|
12
|
<div class="uk-margin uk-flex uk-flex-middle" uk-grid>
|
13
|
<h3 class="uk-h3 uk-width-2-5">
|
14
|
<span *ngIf="curatorAffiliations">My Affiliations</span>
|
15
|
<span *ngIf="!curatorAffiliations">Related Organizations</span>
|
16
|
</h3>
|
17
|
<div class="uk-width-expand">
|
18
|
<button class="uk-button portal-button uk-align-right" (click)="initAffiliation()">
|
19
|
<span uk-icon="plus"></span>
|
20
|
<span *ngIf="curatorAffiliations">Add new Affiliation</span>
|
21
|
<span *ngIf="!curatorAffiliations">Add new Organization</span>
|
22
|
</button>
|
23
|
</div>
|
24
|
|
25
|
<div *ngIf="!curatorAffiliations && organizationsPageId" class="uk-width-1-1 uk-margin">
|
26
|
Do you need to add more information about the Related Organizations? Click
|
27
|
<!-- classContentId: ,-->
|
28
|
<!-- /edit-->
|
29
|
<a [queryParams]="{communityId: communityId, pageId: organizationsPageId}" routerLink="/pageContents"
|
30
|
routerLinkActive="router-link-active">
|
31
|
here
|
32
|
</a>
|
33
|
.
|
34
|
<div *ngIf="!organizationsEnabled" class="uk-alert uk-alert-warning" role="alert">
|
35
|
<span class="uk-margin-small-right uk-icon" uk-icon="warning">
|
36
|
</span>
|
37
|
Community's Organizations page is disabled. Please enable it <a routerLink="/pages" routerLinkActive="router-link-active" [queryParams]="{communityId: communityId, type: 'other'}">here</a>.
|
38
|
</div>
|
39
|
</div>
|
40
|
</div>
|
41
|
|
42
|
<ul [class]="'uk-list uk-list-divider uk-margin' + (curatorAffiliations ? ' uk-height-max-large uk-overflow-auto' : '')"
|
43
|
uk-height-match="target: > li > div > .uk-card; row: false">
|
44
|
<li *ngFor="let result of affiliations; let i=index"
|
45
|
class="uk-animation-fade uk-height-small uk-flex uk-flex-middle" uk-grid>
|
46
|
<div class="uk-width-1-5">
|
47
|
<a *ngIf="result.website_url" target="_blank" [href]="urlPrefix(result.website_url) + result.website_url"
|
48
|
class="affiliation-content uk-card uk-card-small uk-card-default uk-flex uk-flex-middle uk-flex-center">
|
49
|
<ng-container *ngTemplateOutlet="card; context: { organization: result, fullView: true}"></ng-container>
|
50
|
</a>
|
51
|
<span *ngIf="!result.website_url"
|
52
|
class="affiliation-content uk-card uk-card-small uk-card-default uk-flex uk-flex-middle uk-flex-center">
|
53
|
<ng-container *ngTemplateOutlet="card; context: { organization: result, fullView: true}"></ng-container>
|
54
|
</span>
|
55
|
</div>
|
56
|
|
57
|
<div class="uk-width-3-5">
|
58
|
<h3 class="uk-h3" title="{{result.name}}">{{_format(result.name)}}</h3>
|
59
|
<a href="{{urlPrefix(affiliation.website_url) + result.website_url}}" title="{{result.website_url}}" class="uk-margin-auto-top" target="_blank">{{_format(result.website_url)}}</a>
|
60
|
</div>
|
61
|
<div class="uk-width-1-5">
|
62
|
<button class="uk-icon-button uk-icon uk-button-secondary uk-margin-small-right uk-margin-small-bottom" title="Edit" uk-icon="pencil" (click)="chooseAffiliation(i, 'edit')"></button>
|
63
|
<button class="uk-icon-button uk-icon uk-button-danger uk-margin-small-bottom" title="Remove" uk-icon="minus" (click)="chooseAffiliation(i)"></button>
|
64
|
</div>
|
65
|
</li>
|
66
|
</ul>
|
67
|
</ng-template>
|
68
|
|
69
|
<div *ngIf="!curatorAffiliations">
|
70
|
<!-- <div class="uk-padding uk-padding-remove-top uk-text-large uk-text-center uk-width">Edit Community Affiliations</div>-->
|
71
|
<div class="uk-flex" uk-grid>
|
72
|
<div *ngIf="showLoading" class="uk-align-center uk-animation-fade uk-width-1-2" role="alert">
|
73
|
<span class="loading-gif uk-align-center"></span>
|
74
|
</div>
|
75
|
<div *ngIf="!showLoading" class="uk-padding-large">
|
76
|
<div *ngIf="message" [class]="'uk-animation-fade uk-alert uk-alert-' + messageType" role="alert">
|
77
|
{{message}}
|
78
|
</div>
|
79
|
<ng-container *ngTemplateOutlet="affiliations_list;"></ng-container>
|
80
|
</div>
|
81
|
</div>
|
82
|
</div>
|
83
|
<div *ngIf="curatorAffiliations">
|
84
|
<ng-container *ngTemplateOutlet="affiliations_list;"></ng-container>
|
85
|
</div>
|
86
|
|
87
|
<modal-alert #affiliationModal [okDisabled]="isEmptyAffiliation()" (alertOutput)="addAffiliation()">
|
88
|
<table class="uk-align-center">
|
89
|
<tbody class="uk-table">
|
90
|
<tr>
|
91
|
<td for="name" class="uk-text-bold uk-text-right">
|
92
|
Name
|
93
|
<span class="uk-text-danger uk-text-bold">
|
94
|
*
|
95
|
</span>
|
96
|
:
|
97
|
</td>
|
98
|
<td class="uk-text-left">
|
99
|
<input type="text"
|
100
|
class="form-control uk-input uk-width-medium@l uk-width-medium@m" id="afname"
|
101
|
[(ngModel)]="affiliation.name" required>
|
102
|
</td>
|
103
|
</tr>
|
104
|
<tr>
|
105
|
<td for="name" class="uk-text-bold uk-text-right">
|
106
|
Logo Url
|
107
|
<span class="uk-text-danger uk-text-bold">
|
108
|
*
|
109
|
</span>
|
110
|
:
|
111
|
</td>
|
112
|
<td class="uk-text-left">
|
113
|
<input type="text"
|
114
|
class="form-control uk-input" id="logourl"
|
115
|
[(ngModel)]="affiliation.logo_url" required>
|
116
|
</td>
|
117
|
</tr>
|
118
|
<tr>
|
119
|
<td for="name" class="uk-text-bold uk-text-right">
|
120
|
Website Url
|
121
|
<span class="uk-text-danger uk-text-bold">
|
122
|
*
|
123
|
</span>
|
124
|
:
|
125
|
</td>
|
126
|
<td class="uk-text-left">
|
127
|
<input type="text"
|
128
|
class="form-control uk-input" id="websiteurl"
|
129
|
[(ngModel)]="affiliation.website_url" required>
|
130
|
</td>
|
131
|
</tr>
|
132
|
</tbody>
|
133
|
</table>
|
134
|
</modal-alert>
|
135
|
<modal-alert #removeAffiliationModal (alertOutput)="removeAffiliation()">
|
136
|
</modal-alert>
|