-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathmodal-keyword.component.html
More file actions
180 lines (178 loc) · 6.09 KB
/
Copy pathmodal-keyword.component.html
File metadata and controls
180 lines (178 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<app-modal [loading]="loadingKeywords" [noSidebar]="true">
<app-modal-header [closeLabel]="ariaLabelKeywordsClose">
<ng-container i18n="@@topBar.keywords">Keywords</ng-container>
</app-modal-header>
<app-modal-footer>
<button
mat-raised-button
color="primary"
(click)="saveEvent()"
i18n="@@shared.saveChanges"
id="save-keywords-button"
[attr.aria-label]="ariaLabelSave"
>
Save changes
</button>
<button
mat-stroked-button
color="primary"
(click)="closeEvent()"
i18n="@@shared.cancel"
id="cancel-keywords-button"
[attr.aria-label]="ariaLabelCancel"
>
Cancel
</button>
</app-modal-footer>
<div
class="container no-padding"
[formGroup]="keywordsForm"
(ngSubmit)="onSubmit()"
>
<section id="my-keywords">
<p class="orc-font-body-small" i18n="@@topBar.keywordsAre">
Keywords are words or phrases which describe your research activities.
Adding keywords can help people find you when searching the ORCID
registry.
</p>
<ng-container *ngIf="keywords?.length > 0">
<div class="row">
<h2 class="col no-gutters orc-font-body" i18n="@@topBar.myKeywords">
My keywords
</h2>
</div>
<hr class="dashed-line" />
<div
class="row keyword-list"
id="keyword-dropList"
cdkDropList
(cdkDropListDropped)="drop($event)"
>
<div
cdkDrag
class="row keyword-box"
[ngStyle]="{ direction: screenDirection }"
[formGroupName]="keyword.putCode"
*ngFor="let keyword of keywords"
>
<div class="row drag-placeholder" *cdkDragPlaceholder></div>
<div
class="row keywords-input-line"
[ngClass]="{ 'no-wrap': !isMobile }"
>
<div class="col l12 m8 s4 top no-wrap no-gutters input-container">
<div class="image-container">
<img
class="icon-drag"
cdkDragHandle
src="./assets/vectors/draggable.svg"
aria-label="drag handle"
/>
</div>
<div class="row">
<mat-form-field
appearance="outline"
class="mat-form-field-min"
[ngClass]="{
'read-only': keyword.source && keyword.source !== this.id
}"
>
<input
[readonly]="keyword.source && keyword.source !== this.id"
class="content-input"
matInput
#keywordInput
formControlName="content"
placeholder=" {{ ngOrcidKeyword }}"
[ngClass]="{ 'keyword-input': screenDirection === 'rtl' }"
[attr.aria-label]="
keyword.putCode.indexOf('new') < 0
? ariaLabelKeyword
: ariaLabelNewKeyword
"
/>
<mat-hint
class="mat-caption"
*ngIf="keyword.putCode.indexOf('new') < 0"
>
<app-source-hit
[createdDate]="keyword.createdDate"
[source]="keyword.sourceName || keyword.source"
[assertion]="
keyword.assertionOriginName ||
keyword.assertionOriginOrcid
"
></app-source-hit>
</mat-hint>
<mat-error
*ngIf="
keywordsForm.get(keyword.putCode)?.get('content')
?.errors?.maxlength
"
i18n="@@topBar.keywordMaxLength"
>
Must be less than 100 characters
</mat-error>
</mat-form-field>
</div>
</div>
<div
class="col no-wrap actions-wrapper no-gutters"
[ngClass]="{ privacy: !platform.columns12 }"
>
<app-visibility-selector
[ngClass]="{ selector: !platform.columns12 }"
formControlName="visibility"
[itemTitle]="
keywordsForm.get(keyword.putCode)?.get('content').value ||
''
"
></app-visibility-selector>
<button
(click)="deleteKeyword(keyword.putCode)"
mat-icon-button
class="delete-button"
[attr.aria-label]="
ariaLabelDelete +
' ' +
(keywordsForm.get(keyword.putCode)?.get('content').value ||
'')
"
>
<mat-icon
class="material-icons-outlined extra-large-material-icon"
>delete
</mat-icon>
</button>
</div>
</div>
<hr class="dashed-line" />
</div>
</div>
</ng-container>
<div class="row">
<a
id="add-keyword"
class="col add-more no-gutters"
(click)="addKeyword()"
>
<mat-icon class="large-material-icon">add_circle_outline</mat-icon>
<span class="mat-body-2">
<ng-container
*ngIf="keywords?.length === 0"
i18n="@@topBar.addKeyword"
>
Add a keyword
</ng-container>
<ng-container
*ngIf="keywords?.length !== 0"
i18n="@@topBar.addAnotherKeyword"
>
Add another keyword
</ng-container>
</span>
</a>
</div>
</section>
</div>
</app-modal>