13 |
13 |
<td class="uk-text-left">
|
14 |
14 |
<div *ngIf="community.title == '' " class="uk-width-medium uk-text-danger uk-text-small style=display:none"> Please add name. </div>
|
15 |
15 |
<input *ngIf="community.title != null" placeholder={{community.title}} type="text"
|
16 |
|
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="name" required [(ngModel)] = "community.title"></td>
|
|
16 |
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="name"
|
|
17 |
required [(ngModel)] = "community.title" (input)="change()"></td>
|
|
18 |
<!-- Todo remove after testing -->
|
|
19 |
<!-- {{hasChanged}} -->
|
17 |
20 |
</tr>
|
18 |
21 |
<tr>
|
19 |
22 |
<td for="shortName" class="uk-text-bold uk-text-right">Short Name:</td>
|
20 |
23 |
<td class="uk-text-left">
|
21 |
24 |
<input *ngIf="community.shortTitle != null" placeholder={{community.shortTitle}} type="text"
|
22 |
|
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="shortName" [(ngModel)] = "community.shortTitle"></td>
|
|
25 |
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="shortName"
|
|
26 |
[(ngModel)] = "community.shortTitle" (input)="change()"></td>
|
23 |
27 |
</tr>
|
24 |
28 |
<tr>
|
25 |
29 |
<td for="description" class="uk-text-bold uk-text-right">Description:</td>
|
26 |
30 |
<td class="uk-text-left">
|
27 |
31 |
<textarea *ngIf="community.description != null" placeholder={{community.description}} type="text"
|
28 |
|
class="form-control uk-textarea uk-width-large@l uk-width-medium@s" rows="6" id="description" [(ngModel)] = "community.description">
|
|
32 |
class="form-control uk-textarea uk-width-large@l uk-width-medium@s" rows="6" id="description"
|
|
33 |
[(ngModel)] = "community.description" (input)="change()">
|
29 |
34 |
</textarea></td>
|
30 |
35 |
</tr>
|
31 |
36 |
<tr>
|
32 |
37 |
<td for="logoUrl" class="uk-text-bold uk-text-right">Logo Url:</td>
|
33 |
38 |
<td class="uk-text-left">
|
34 |
39 |
<input *ngIf="community.logoUrl != null" placeholder={{community.logoUrl}} type="text"
|
35 |
|
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="logoUrl" [(ngModel)] = "community.logoUrl"></td>
|
|
40 |
class="form-control uk-input uk-width-large@l uk-width-medium@s" id="logoUrl"
|
|
41 |
[(ngModel)] = "community.logoUrl" (input)="change()"></td>
|
36 |
42 |
</tr>
|
37 |
43 |
<tr>
|
38 |
44 |
<td for="status" class="uk-text-bold uk-text-right">Status:</td>
|
39 |
45 |
<td class="uk-text-left uk-margin">
|
40 |
|
<select class="form-control uk-select uk-width-large@l uk-width-medium@s" id="status" [(ngModel)] = "community.status">
|
|
46 |
<select class="form-control uk-select uk-width-large@l uk-width-medium@s" id="status"
|
|
47 |
[(ngModel)] = "community.status" (input)="change()">
|
41 |
48 |
<option value="all">Visible</option>
|
42 |
49 |
<option value="manager">Visible to managers</option>
|
43 |
50 |
<option value="hidden">Hidden</option>
|
... | ... | |
51 |
58 |
<div *ngIf="!community.managers[i].match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$') && community.managers[i] != '' "
|
52 |
59 |
class="uk-width-large uk-text-danger uk-text-small uk-margin-top"> Please add a valid email. </div>
|
53 |
60 |
<input placeholder="Type managers" type="text" class="form-control uk-input uk-width-large@l uk-width-medium@s"
|
54 |
|
id="{{'manager'+i}}" name="{{'manager'+i}}" [(ngModel)] = "community.managers[i]">
|
|
61 |
id="{{'manager'+i}}" name="{{'manager'+i}}" [(ngModel)] = "community.managers[i]" (input)="change()">
|
55 |
62 |
<!-- <img type="uk-image" src="assets/imgs/delete-icon.png" height="25" width="25" title="Remove" onmouseover="" style="cursor: pointer;" (click)="removeManager(i)"/> -->
|
56 |
63 |
<a class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Remove" (click)="removeManager(i)"></a>
|
57 |
64 |
<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>
|
... | ... | |
67 |
74 |
<div *ngIf="community.subjects != null">
|
68 |
75 |
<div *ngFor='let subject of community.subjects; let i = index; trackBy:trackByFn'>
|
69 |
76 |
<input placeholder="Type subjects" type="text" class="form-control uk-input uk-width-large@l uk-width-medium@s"
|
70 |
|
id="{{'subject'+i}}" name="{{'subject'+i}}" [(ngModel)] = "community.subjects[i]">
|
|
77 |
id="{{'subject'+i}}" name="{{'subject'+i}}" [(ngModel)] = "community.subjects[i]" (input)="change()">
|
71 |
78 |
<!-- <img type="uk-image" src="assets/imgs/delete-icon.png" height="25" width="25" title="Remove" onmouseover="" style="cursor: pointer;" (click)="removeSubject(i)"/> -->
|
72 |
79 |
<a class="uk-icon-button remove red_background_color red_color" uk-icon="close" title="Remove" (click)="removeSubject(i)"></a>
|
73 |
80 |
<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>
|
... | ... | |
86 |
93 |
<td class="uk-text-right"></td>
|
87 |
94 |
<td>
|
88 |
95 |
<div class="uk-grid-margin uk-first-column uk-align-center uk-text-left uk-padding uk-padding-remove-top uk-padding-remove-bottom">
|
89 |
|
<button class="uk-button uk-button-primary" (click)="updateCommunity()">Save</button>
|
|
96 |
<button *ngIf="hasChanged" class="uk-button uk-button-primary" (click)="updateCommunity()">Save</button>
|
|
97 |
<button *ngIf="!hasChanged" class="uk-button uk-button-default" disabled>Save</button>
|
90 |
98 |
<button class="uk-button" (click)="resetForm(communityId)">Reset</button>
|
91 |
99 |
</div>
|
92 |
100 |
</td>
|
Disable SAVE button if there are no changes to save in the form