1
|
<div id="community-edit-form " class=" uk-card uk-card-default uk-padding">
|
2
|
<div class="uk-text-large">Edit your community profile</div>
|
3
|
<div *ngIf="communityId != null && community != null" class="uk-margin-top">
|
4
|
<div class="form-group ">
|
5
|
<div for="name" class="uk-text-bold">Name (*):</div>
|
6
|
<div *ngIf="community.title == ''" class="uk-width-medium uk-text-danger uk-text-small style=display:none"> Please add name. </div>
|
7
|
<input *ngIf="community.title != null" placeholder={{community.title}} type="text"
|
8
|
class="form-control uk-input uk-width-medium" id="name" required [(ngModel)] = "community.title">
|
9
|
</div>
|
10
|
<div class="form-group">
|
11
|
<div for="shortName" class="uk-text-bold">Short Name:</div>
|
12
|
<input *ngIf="community.shortTitle != null" placeholder={{community.shortTitle}} type="text"
|
13
|
class="form-control uk-input uk-width-medium" id="shortName" [(ngModel)] = "community.shortTitle">
|
14
|
</div>
|
15
|
<div class="form-group">
|
16
|
<div for="description" class="uk-text-bold">Description:</div>
|
17
|
<input *ngIf="community.description != null" placeholder={{community.description}} type="text"
|
18
|
class="form-control uk-input uk-width-medium" id="description" [(ngModel)] = "community.description">
|
19
|
</div>
|
20
|
<div class="form-group">
|
21
|
<div for="logoUrl" class="uk-text-bold">Logo Url:</div>
|
22
|
<input *ngIf="community.logoUrl != null" placeholder={{community.logoUrl}} type="text"
|
23
|
class="form-control uk-input uk-width-medium" id="logoUrl" [(ngModel)] = "community.logoUrl">
|
24
|
</div>
|
25
|
<div class="form-group">
|
26
|
<div for="email" class="uk-text-bold">Email</div>
|
27
|
<div *ngIf="!community.managers[0].match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') || community.managers[0] == null"
|
28
|
class="uk-width-medium uk-text-danger uk-text-small style=display:none"> Please add a valid email. </div>
|
29
|
<input type="text" class="form-control uk-input uk-width-medium" id="email" [(ngModel)] = "community.managers[0]">
|
30
|
</div>
|
31
|
<div class="form-group">
|
32
|
<div for="managers" class="uk-text-bold">Managers:</div>
|
33
|
<div *ngIf="community.managers != null">
|
34
|
<div *ngFor='let manager of community.managers, let i = index; trackBy:trackByFn'>
|
35
|
<div *ngIf="!community.managers[i].match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') && community.managers[i] != '' "
|
36
|
class="uk-width-medium uk-text-danger uk-text-small style=display:none"> Please add a valid email. </div>
|
37
|
<input placeholder="Type managers" type="text" class="form-control uk-input uk-width-medium"
|
38
|
id="{{'manager'+i}}" name="{{'manager'+i}}" [(ngModel)] = "community.managers[i]">
|
39
|
<!-- <img type="uk-image" src="assets/imgs/delete-icon.png" height="25" width="25" title="Remove" onmouseover="" style="cursor: pointer;" (click)="removeManager(i)"/> -->
|
40
|
<a class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Remove" (click)="removeManager(i)"></a>
|
41
|
<a *ngIf="i == community.managers.length - 1" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add" (click)="addManager()"></a>
|
42
|
</div>
|
43
|
<a *ngIf="community.managers.length == 0" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add" (click)="addManager()"></a>
|
44
|
<!-- <img type="uk-image" src="assets/imgs/add-icon.png" height="25" width="25" title="Add" onmouseover="" style="cursor: pointer;" (click)="addManager()"/> -->
|
45
|
</div>
|
46
|
</div>
|
47
|
<div class="form-group">
|
48
|
<div for="subjects" class="uk-text-bold">Subjects:</div>
|
49
|
<div *ngIf="community.subjects != null">
|
50
|
<div *ngFor='let subject of community.subjects; let i = index; trackBy:trackByFn'>
|
51
|
<input placeholder="Type subjects" type="text" class="form-control uk-input uk-width-medium"
|
52
|
id="{{'subject'+i}}" name="{{'subject'+i}}" [(ngModel)] = "community.subjects[i]">
|
53
|
<!-- <img type="uk-image" src="assets/imgs/delete-icon.png" height="25" width="25" title="Remove" onmouseover="" style="cursor: pointer;" (click)="removeSubject(i)"/> -->
|
54
|
<a class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Remove" (click)="removeSubject(i)"></a>
|
55
|
<a *ngIf="i == community.subjects.length - 1" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add" (click)="addSubject()"></a>
|
56
|
</div>
|
57
|
<a *ngIf="community.subjects.length == 0" class="uk-icon-button add green_background_color green_color" uk-icon="plus" title="Add" (click)="addSubject()"></a>
|
58
|
<!-- <img type="uk-image" src="assets/imgs/add-icon.png" height="25" width="25" title="Add" onmouseover="" style="cursor: pointer;" (click)="addSubject()"/> -->
|
59
|
</div>
|
60
|
</div>
|
61
|
<div class="uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-text-danger">(*) Required fields</div>
|
62
|
<div class="uk-width-1-1 uk-grid-margin uk-first-column uk-align-center">
|
63
|
<button class="uk-button" (click)="resetForm(communityId)">Reset</button>
|
64
|
<button class="uk-button uk-button-primary" (click)="updateCommunity()">Save</button>
|
65
|
</div>
|
66
|
</div>
|
67
|
</div>
|