-
Notifications
You must be signed in to change notification settings - Fork 563
Expand file tree
/
Copy pathbitstream-attachment.component.html
More file actions
78 lines (67 loc) · 3.12 KB
/
Copy pathbitstream-attachment.component.html
File metadata and controls
78 lines (67 loc) · 3.12 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
@if (attachment) {
<div class="d-flex flex-row flex-wrap flex-lg-nowrap card-container mt-1 mb-3 gap-3" data-test="attachment-info">
<div class="order-lg-3 ml-auto">
<div class="d-flex flex-column align-items-end gap-3">
<div class="text-nowrap">
<ds-file-download-button [bitstream]="attachment" [item]="item"></ds-file-download-button>
</div>
@if (primaryBitstreamId === attachment.id) {
<span class="badge bg-primary">
{{ 'item.page.bitstreams.primary' | translate }}
</span>
}
</div>
</div>
<div class="order-lg-2 w-100 mb-3">
@for (attachmentConf of metadataConfig; track $index) {
@if (attachment.firstMetadataValue(attachmentConf.name) || attachmentConf.type === AdvancedAttachmentElementType.Attribute) {
<div class="content" [attr.data-test]="attachmentConf.name">
<strong>{{ 'layout.advanced-attachment.' + attachmentConf.name | translate }}</strong>
@if (attachmentConf.type === AdvancedAttachmentElementType.Metadata) {
@if(!attachmentConf.truncatable && attachmentConf.name === attachmentTypeMetadata) {
<p class="text-break m-0">
{{attachment.firstMetadataValue(attachmentConf.name) | titlecase}}
</p>
}
@if(!attachmentConf.truncatable && attachmentConf.name !== attachmentTypeMetadata) {
<p class="text-break m-0">
{{attachment.firstMetadataValue(attachmentConf.name)}}
</p>
}
@if (attachmentConf.truncatable) {
<ds-truncatable [id]=" attachment.id">
<ds-truncatable-part [id]="attachment.id" [minLines]="1">
{{attachment.firstMetadataValue(attachmentConf.name)}}
</ds-truncatable-part>
</ds-truncatable>
}
}
@if (attachmentConf.type === AdvancedAttachmentElementType.Attribute) {
@if (attachmentConf.name === 'format') {
@if ((bitstreamFormat$ | async) === null || (bitstreamFormat$ | async) === undefined) {
<p class="text-muted">
{{'layout.advanced-attachment.label.not-present' | translate}}
</p>
} @else {
<p class="word-break m-0">{{(bitstreamFormat$ | async)}}</p>
}
}
@if (attachmentConf.name === 'size' && bitstreamSize) {
<p class="word-break m-0">{{bitstreamSize | dsFileSize}}</p>
}
@if (attachmentConf.name === 'checksum') {
@if (checksumInfo?.value === null || checksumInfo?.value === undefined) {
<p class="text-muted">
{{'layout.advanced-attachment.label.not-present' | translate}}
</p>
} @else {
<p class="word-break m-0">({{checksumInfo.checkSumAlgorithm}}):{{ checksumInfo.value }}</p>
}
}
}
</div>
}
}
</div>
</div>
}