|
26 | 26 | gr-usage-rights-updated-by-template="ctrl.usageRightsUpdatedByTemplate">
|
27 | 27 | </gr-usage-rights-editor>
|
28 | 28 |
|
29 |
| - <dd class="image-info__title" ng-if="! ctrl.showUsageRights"> |
30 |
| - <dd ng-if="! ctrl.usageRightsSummary"> |
| 29 | + <div class="image-info__title" ng-if="!ctrl.showUsageRights"> |
| 30 | + <dd ng-if="!ctrl.usageRightsSummary"> |
31 | 31 | {{ctrl.usageCategory || 'None'}}
|
32 | 32 | </dd>
|
33 | 33 | <dd ng-if="ctrl.usageRightsSummary">
|
|
36 | 36 | props="{'images':ctrl.selectedImages, 'categoryCallback':ctrl.callbackUsageCategory}">
|
37 | 37 | </usage-rights-summary>
|
38 | 38 | </dd>
|
39 |
| - </dd> |
| 39 | + </div> |
40 | 40 |
|
41 | 41 | <button
|
42 | 42 | data-cy="it-edit-usage-rights-button"
|
|
140 | 140 | <button data-cy="it-edit-description-button"
|
141 | 141 | class="image-info__edit"
|
142 | 142 | ng-if="ctrl.userCanEdit && ctrl.metadataUpdatedByTemplate.length == 0"
|
143 |
| - ng-click="descriptionEditForm.$show()" |
| 143 | + ng-click="descriptionEditForm.$show(); ctrl.checkDescriptionLength();" |
144 | 144 | ng-hide="descriptionEditForm.$visible">✎</button>
|
145 | 145 | <form editable-form name="descriptionEditForm" onaftersave="ctrl.updateDescriptionField('description', $data)">
|
146 | 146 | <div ng-hide="descriptionEditForm.$visible" ng-class="{'image-info--multiple': ctrl.hasMultipleValues(ctrl.rawMetadata.description)}">
|
|
206 | 206 | </dl>
|
207 | 207 | </div>
|
208 | 208 |
|
209 |
| - <div class="image-info__group" ng-if="ctrl.rawMetadata.specialInstructions" role="region" aria-label="Special instructions"> |
| 209 | + <div data-cy="metadata-specialInstructions" role="region" class="image-info__group" aria-label="Special instructions"> |
210 | 210 | <dl class="image-info__wrap">
|
211 | 211 | <dt class="metadata-line metadata-line__key">Special instructions</dt>
|
| 212 | + <span ng-if="ctrl.metadata.usageInstructions"> |
| 213 | + <span class="metadata-line__info">{{ctrl.metadata.usageInstructions}}</span> |
| 214 | + </span> |
212 | 215 | <span ng-if="ctrl.metadataUpdatedByTemplate.includes('specialInstructions')">
|
213 | 216 | <div class="metadata-line__info">
|
214 |
| - <dd class="image-info__special-instructions-preview">{{ctrl.metadata.specialInstructions}}</dd> |
| 217 | + <dd class="image-info__description-preview">{{ctrl.metadata.specialInstructions}}</dd> |
215 | 218 | </div>
|
216 | 219 | </span>
|
217 | 220 | <span ng-if="!ctrl.metadataUpdatedByTemplate.includes('specialInstructions')">
|
218 | 221 | <button class="image-info__edit"
|
219 | 222 | ng-if="ctrl.userCanEdit && ctrl.metadataUpdatedByTemplate.length == 0"
|
220 |
| - ng-click="specialInstructionsEditForm.$show()" |
| 223 | + ng-click="specialInstructionsEditForm.$show(); ctrl.checkSpecialInstructionsLength();" |
221 | 224 | ng-hide="specialInstructionsEditForm.$visible">✎</button>
|
222 |
| - <div class="metadata-line__info" ng-class="{'image-info--multiple': ctrl.hasMultipleValues(ctrl.rawMetadata.specialInstructions)}" |
223 |
| - editable-textarea="ctrl.metadata.specialInstructions" |
224 |
| - ng-hide="specialInstructionsEditForm.$visible" |
225 |
| - onbeforesave="ctrl.updateMetadataField('specialInstructions', $data)" |
226 |
| - e:msd-elastic |
227 |
| - e:form="specialInstructionsEditForm" |
228 |
| - e:ng-class="{'image-info__editor--error': $error, |
229 |
| - 'image-info__editor--saving': specialInstructionsEditForm.$waiting, |
230 |
| - 'text-input': true}"> |
231 |
| - |
232 |
| - <div ng-if="ctrl.userCanEdit"> |
233 |
| - <dd ng-if="ctrl.hasMultipleValues(ctrl.rawMetadata.specialInstructions)" |
234 |
| - class="image-info__special-instructions" |
235 |
| - >Multiple special instructions (click ✎ to edit <strong>all</strong>) |
236 |
| - </dd> |
| 225 | + <form editable-form name="specialInstructionsEditForm" onaftersave="ctrl.updateSpecialInstructionsField()"> |
| 226 | + <div ng-hide="specialInstructionsEditForm.$visible" |
| 227 | + ng-class="{'image-info--multiple': ctrl.hasMultipleSpecialInstructions()}"> |
237 | 228 |
|
238 |
| - <dd ng-if="!ctrl.hasMultipleValues(ctrl.rawMetadata.specialInstructions)" |
239 |
| - class="image-info__special-instructions" |
240 |
| - >{{ctrl.metadata.specialInstructions}} |
241 |
| - </dd> |
242 |
| - </div> |
| 229 | + <div ng-if="ctrl.userCanEdit"> |
| 230 | + <dd class="image-info__special-instructions" |
| 231 | + ng-if="ctrl.hasMultipleSpecialInstructions()" |
| 232 | + >Multiple special instructions (click ✎ to edit <strong>all</strong>) |
| 233 | + </dd> |
243 | 234 |
|
244 |
| - <div ng-if="!ctrl.userCanEdit"> |
245 |
| - <dd ng-if="ctrl.hasMultipleValues(ctrl.rawMetadata.specialInstructions)" |
246 |
| - class="image-info__special-instructions" |
247 |
| - >Multiple special instructions |
248 |
| - </dd> |
| 235 | + <dd class="image-info__special-instructions" |
| 236 | + ng-class="{'editable-empty': !ctrl.metadata.specialInstructions}" |
| 237 | + ng-if="!ctrl.hasMultipleSpecialInstructions() && !ctrl.metadata.usageInstructions" |
| 238 | + >{{ctrl.metadata.specialInstructions || "Unknown (click ✎ to add)"}} |
| 239 | + </dd> |
249 | 240 |
|
250 |
| - <dd ng-if="!ctrl.hasMultipleValues(ctrl.rawMetadata.specialInstructions)" |
251 |
| - class="image-info__special-instructions" |
252 |
| - >{{ctrl.metadata.specialInstructions}} |
253 |
| - </dd> |
| 241 | + <dd class="image-info__special-instructions" |
| 242 | + ng-class="{'editable-empty': !ctrl.metadata.specialInstructions}" |
| 243 | + ng-if="!ctrl.hasMultipleSpecialInstructions() && ctrl.metadata.usageInstructions" |
| 244 | + >{{ctrl.metadata.specialInstructions || "Click ✎ to add further instructions"}} |
| 245 | + </dd> |
| 246 | + </div> |
| 247 | + |
| 248 | + <div ng-if="!ctrl.userCanEdit"> |
| 249 | + <dd class="image-info__special-instructions" |
| 250 | + ng-if="ctrl.hasMultipleSpecialInstructions()" |
| 251 | + >Multiple special instructions |
| 252 | + </dd> |
| 253 | + |
| 254 | + <dd class="image-info__special-instructions" |
| 255 | + ng-class="{'editable-empty': !ctrl.metadata.specialInstructions}" |
| 256 | + ng-if="!ctrl.hasMultipleSpecialInstructions() && ctrl.metadata.usageInstructions" |
| 257 | + >{{ctrl.metadata.specialInstructions || ""}} |
| 258 | + </dd> |
| 259 | + |
| 260 | + <dd class="image-info__special-instructions" |
| 261 | + ng-class="{'editable-empty': !ctrl.metadata.specialInstructions}" |
| 262 | + ng-if="!ctrl.hasMultipleSpecialInstructions() && !ctrl.metadata.usageInstructions" |
| 263 | + >{{ctrl.metadata.specialInstructions || "Unknown"}} |
| 264 | + </dd> |
| 265 | + </div> |
| 266 | + </div> |
| 267 | + <div |
| 268 | + class="metadata-line__info" |
| 269 | + editable-textarea="ctrl.metadata.specialInstructions" |
| 270 | + ng-hide="specialInstructionsEditForm.$visible" |
| 271 | + e:msd-elastic |
| 272 | + e:ng-class="{'image-info__editor--error': $error, |
| 273 | + 'image-info__editor--saving': specialInstructionsEditForm.$waiting, |
| 274 | + 'text-input': true}" |
| 275 | + > |
254 | 276 | </div>
|
255 |
| - </div> |
| 277 | + <div ng-if="ctrl.userCanEdit && specialInstructionsEditForm.$visible" class="editable-buttons"> |
| 278 | + <button class="button-cancel" type="button" ng-click="specialInstructionsEditForm.$cancel()"> |
| 279 | + <gr-icon-label gr-icon="close">Cancel</gr-icon-label> |
| 280 | + </button> |
| 281 | + <button class="button-save" type="submit"> |
| 282 | + <gr-icon-label gr-icon="check">Save</gr-icon-label> |
| 283 | + </button> |
| 284 | + </div> |
| 285 | + </form> |
256 | 286 | </span>
|
257 |
| - </dl> |
| 287 | + </dl> |
258 | 288 | </div>
|
259 | 289 |
|
260 | 290 | <div class="image-info__group" role="region" aria-label="Image metadata">
|
|
0 commit comments