1-
21<!-- toolbar -->
3- < div class ="toolbar " *ngIf ="project " [class.deleted] ="deletedResource ">
2+ < div class ="toolbar " *ngIf ="project " [class.deleted] ="deletedResource || resource.res.isDeleted ">
43 <!-- resource info -->
54 < h3 class ="label mat-title ">
65 {{resource.res.label}} < span *ngIf ="deletedResource "> (deleted)</ span >
@@ -12,22 +11,23 @@ <h3 class="label mat-title">
1211 < span class ="action ">
1312
1413 <!-- Toggle list of properties: all or only the ones with value -->
15- < button mat-icon-button class ="toggle-props " [matTooltip] ="(showAllProps ? 'Hide empty' : 'Show all')+' properties' " matTooltipPosition ="above "
14+ < button mat-icon-button class ="toggle-props " *ngIf ="!resource.res.isDeleted "
15+ [matTooltip] ="(showAllProps ? 'Hide empty' : 'Show all')+' properties' " matTooltipPosition ="above "
1616 (click) ="toggleAllProps(showAllProps) ">
1717 < mat-icon > {{showAllProps ? 'unfold_less' : 'unfold_more'}}</ mat-icon >
1818 <!-- <span class="desktop-only">{{showAllProps ? 'Hide empty' : 'Show all'}} properties</span> -->
1919 </ button >
2020
2121 <!-- Share resource: copy ark url, add to favorites or open in new tab -->
22- < button mat-icon-button class ="share-res " matTooltip ="Share resource: {{resource.res.versionArkUrl}} " matTooltipPosition ="above "
23- [disabled] ="deletedResource "
24- [matMenuTriggerFor] ="share ">
22+ < button mat-icon-button class ="share-res " matTooltip ="Share resource: {{resource.res.versionArkUrl}} "
23+ matTooltipPosition ="above " [disabled] ="deletedResource " [matMenuTriggerFor] ="share ">
2524 < mat-icon > share</ mat-icon >
2625 <!-- <span class="desktop-only">Citation Link</span> -->
2726 </ button >
2827 < mat-menu #share ="matMenu " class ="res-share-menu ">
2928 < button mat-menu-item matTooltip ="Copy ARK url " matTooltipPosition ="above "
30- [cdkCopyToClipboard] ="resource.res.versionArkUrl " (click) ="openSnackBar('ARK URL copied to clipboard!') ">
29+ [cdkCopyToClipboard] ="resource.res.versionArkUrl "
30+ (click) ="openSnackBar('ARK URL copied to clipboard!') ">
3131 < mat-icon > content_copy</ mat-icon >
3232 Copy ARK url to clipboard
3333 </ button >
@@ -41,29 +41,33 @@ <h3 class="label mat-title">
4141 < mat-icon > open_in_new</ mat-icon >
4242 Open resource in new tab
4343 </ button >
44- <!-- TODO: activate favorite action to add resource to collection -->
45- <!--
44+ <!-- TODO: activate favorite action to add resource to collection -->
45+ <!--
4646 <button mat-button class="add-res-to-collection">
4747 <mat-icon>star_border</mat-icon>
4848 </button>
4949 -->
5050 </ mat-menu >
5151
5252 <!-- more menu with: delete, erase resource -->
53- < button *ngIf ="editPermissions && project?.status " mat-icon-button class ="more-menu " matTooltip ="More " matTooltipPosition ="above " [matMenuTriggerFor] ="more " [disabled] ="deletedResource ">
53+ < button *ngIf ="editPermissions && project?.status " mat-icon-button class ="more-menu " matTooltip ="More "
54+ matTooltipPosition ="above " [matMenuTriggerFor] ="more " [disabled] ="deletedResource ">
5455 < mat-icon > more_vert</ mat-icon >
5556 </ button >
5657 < mat-menu #more ="matMenu " class ="res-more-menu ">
57- < button mat-menu-item matTooltip ="Edit the label of this resource " matTooltipPosition ="above " (click) ="openDialog('edit') ">
58+ < button mat-menu-item matTooltip ="Edit the label of this resource " matTooltipPosition ="above "
59+ (click) ="openDialog('edit') ">
5860 < mat-icon > edit</ mat-icon >
5961 Edit label
6062 </ button >
61- < button mat-menu-item matTooltip ="Move resource to trash bin. " matTooltipPosition ="above " (click) ="openDialog('delete') ">
63+ < button mat-menu-item matTooltip ="Move resource to trash bin. " matTooltipPosition ="above "
64+ (click) ="openDialog('delete') ">
6265 < mat-icon > delete</ mat-icon >
6366 Delete resource
67+ <!-- TODO: or in case of already deleted resource: re-activate resource -->
6468 </ button >
65- < button *ngIf ="adminPermissions " mat-menu-item matTooltip ="Erase resource forever. This cannot be undone. " matTooltipPosition =" above "
66- (click) ="openDialog('erase') ">
69+ < button *ngIf ="adminPermissions " mat-menu-item matTooltip ="Erase resource forever. This cannot be undone. "
70+ matTooltipPosition =" above " (click) ="openDialog('erase') ">
6771 < mat-icon > delete_forever</ mat-icon >
6872 Erase resource
6973 </ button >
@@ -73,7 +77,7 @@ <h3 class="label mat-title">
7377
7478<!-- additional line with project and user information -->
7579< div class ="infobar mat-caption " *ngIf ="project && user ">
76- < span *ngIf ="displayProjectInfo "> This resource belongs to the project
80+ < span *ngIf ="displayProjectInfo "> This resource {{ resource.res.isDeleted ? 'belonged' : ' belongs' }} to the project
7781 < span class ="project link " (click) ="openProject(project) " (mouseover) ="previewProject(project) ">
7882 < strong > {{project?.shortname}}</ strong >
7983 < mat-icon inline > open_in_new</ mat-icon >
@@ -89,8 +93,7 @@ <h3 class="label mat-title">
8993
9094<!-- list of properties -->
9195< div class ="properties-container ">
92- < div class ="properties " *ngIf ="resource.resProps.length !== 0; else noProperties ">
93-
96+ < div class ="properties " *ngIf ="resource.resProps.length > 0; else noProperties ">
9497 <!-- list of properties -->
9598 < div *ngFor ="let prop of resource.resProps; let last = last ">
9699 <!-- show property; all in case of showAll === true or only the ones with prop.values -->
@@ -106,47 +109,35 @@ <h3 class="label mat-title">
106109 prop.propDef.subjectType === representationConstants.region &&
107110 prop.propDef.objectType !== representationConstants.color
108111 ))
109- ) "
110- [class.border-bottom] ="prop.values && !last "
111- class ="property ">
112+ ) " [class.border-bottom] ="prop.values && !last " class ="property ">
112113 < div class ="property-label ">
113114 <!-- label of the property -->
114- < h3 class ="label mat-subheading-1 "
115- [class.label-info] ="prop.propDef.comment "
116- [matTooltip] ="prop.propDef.comment "
117- matTooltipPosition ="above ">
115+ < h3 class ="label mat-subheading-1 " [class.label-info] ="prop.propDef.comment "
116+ [matTooltip] ="prop.propDef.comment " matTooltipPosition ="above ">
118117 {{prop.propDef.label}}
119118 </ h3 >
120119 </ div >
121120 < div class ="property-value ">
122121 <!-- the value(s) of the property -->
123122 < div *ngFor ="let val of prop.values ">
124- < app-display-edit *ngIf ="val "
125- #displayEdit
126- [parentResource] ="resource.res "
127- [displayValue] ="val "
128- [propArray] ="resource.resProps "
129- [canDelete] ="deleteValueIsAllowed(prop) "
130- [projectStatus] ="project?.status "
131- [valueUuidToHighlight] ="valueUuidToHighlight "
123+ < app-display-edit *ngIf ="val " #displayEdit [parentResource] ="resource.res " [displayValue] ="val "
124+ [propArray] ="resource.resProps " [canDelete] ="deleteValueIsAllowed(prop) "
125+ [projectStatus] ="project?.status " [valueUuidToHighlight] ="valueUuidToHighlight "
132126 (referredResourceClicked) ="openResource($event) "
133127 (referredResourceHovered) ="previewResource($event) ">
134128 </ app-display-edit >
135129 </ div >
136130 <!-- Add value form -->
137131 < div *ngIf ="addValueFormIsVisible && propID === prop.propDef.id && project?.status ">
138- < app-add-value #addValue
139- class ="add-value "
140- [parentResource] ="resource.res "
132+ < app-add-value #addValue class ="add-value " [parentResource] ="resource.res "
141133 [resourcePropertyDefinition] ="$any(resource.res.entityInfo.properties[prop.propDef.id]) "
142134 (operationCancelled) ="hideAddValueForm() ">
143135 </ app-add-value >
144136 </ div >
145137 <!-- Add button -->
146138 < div *ngIf ="addValueIsAllowed(prop) && project?.status ">
147139 < button mat-icon-button type ="button " class ="value-action create "
148- (click) ="showAddValueForm(prop, $event) "
149- title ="Add a new value ">
140+ (click) ="showAddValueForm(prop, $event) " title ="Add a new value ">
150141 < mat-icon > add_box</ mat-icon >
151142 </ button >
152143 </ div >
@@ -156,13 +147,11 @@ <h3 class="label mat-title">
156147 < app-progress-indicator *ngIf ="loading "> </ app-progress-indicator >
157148 < div *ngIf ="!loading ">
158149 <!-- the value(s) of the incoming links -->
159- < a class ="link link-value " *ngFor ="let inRes of incomingLinkResources " (click) ="openResource(inRes.id) "> {{inRes.label}}</ a >
160- < mat-paginator *ngIf ="numberOffAllIncomingLinkRes > 25 "
161- [length] =numberOffAllIncomingLinkRes
162- [pageSize] ="25 "
163- [hidePageSize] ="true "
164- [pageIndex] ="pageEvent.pageIndex "
165- (page) ="goToPage($event) ">
150+ < a class ="link link-value " *ngFor ="let inRes of incomingLinkResources "
151+ (click) ="openResource(inRes.id) "> {{inRes.label}}</ a >
152+ < mat-paginator *ngIf ="numberOffAllIncomingLinkRes > 25 " [length] =numberOffAllIncomingLinkRes
153+ [pageSize] ="25 " [hidePageSize] ="true " [pageIndex] ="pageEvent.pageIndex "
154+ (page) ="goToPage($event) ">
166155 </ mat-paginator >
167156 </ div >
168157 </ div >
@@ -171,7 +160,45 @@ <h3 class="label mat-title">
171160 </ div >
172161
173162 </ div >
163+
164+ <!-- deleted resource or resource without any defined properties -->
174165 < ng-template #noProperties >
175- The resource {{resource?.res.resourceClassLabel}} has no defined properties.
166+ < div *ngIf ="resource.res.isDeleted " class ="properties ">
167+ < div class ="property border-bottom ">
168+ < div class ="property-label ">
169+ <!-- delete date -->
170+ < h3 class ="label mat-subheading-1 ">
171+ Deleted on
172+ </ h3 >
173+ </ div >
174+ < div class ="property-value ">
175+ {{ resource.res.deleteDate | date }}
176+ </ div >
177+ </ div >
178+ < div class ="property ">
179+ < div class ="property-label ">
180+ <!-- Delete comment -->
181+ < h3 class ="label mat-subheading-1 ">
182+ Comment
183+ </ h3 >
184+ </ div >
185+ < div class ="property-value ">
186+ {{ resource.res.deleteComment }}
187+ </ div >
188+ </ div >
189+ </ div >
190+ <!-- no defined property -->
191+ < div *ngIf ="!resource.res.isDeleted " class ="properties ">
192+ < div class ="property border-bottom ">
193+ < div class ="property-label ">
194+ < h3 class ="label mat-subheading-1 ">
195+ Info
196+ </ h3 >
197+ </ div >
198+ < div class ="property-value ">
199+ This resource has no defined properties.
200+ </ div >
201+ </ div >
202+ </ div >
176203 </ ng-template >
177204</ div >
0 commit comments