paperless-ngx/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html

110 lines
5.9 KiB
HTML
Raw Normal View History

<div class="col p-2 h-100">
2021-02-06 14:54:36 -08:00
<div class="card h-100 shadow-sm document-card" [class.card-selected]="selected" [class.popover-hidden]="popoverHidden" (mouseleave)="mouseLeaveCard()">
2023-03-28 22:10:12 -07:00
<div class="border-bottom doc-img-container" [class.doc-img-background-selected]="selected" (click)="this.toggleSelected.emit($event)" (dblclick)="dblClickDocument.emit(this)">
2021-02-25 15:35:15 +01:00
<img class="card-img doc-img rounded-top" [class.inverted]="getIsThumbInverted()" [src]="getThumbUrl()">
2022-02-19 21:38:29 -08:00
<div class="border-end border-bottom bg-light py-1 px-2 document-card-check">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="smallCardCheck{{document.id}}" [checked]="selected" (click)="this.toggleSelected.emit($event)">
<label class="form-check-label" for="smallCardCheck{{document.id}}"></label>
</div>
</div>
2022-05-23 11:24:13 -07:00
<div class="tags d-flex flex-column text-end position-absolute me-1 fs-6">
2023-12-19 15:02:05 -08:00
@for (t of getTagsLimited$() | async; track t) {
<pngx-tag [tag]="t" (click)="clickTag.emit(t.id);$event.stopPropagation()" [clickable]="true" linkTitle="Toggle tag filter" i18n-linkTitle></pngx-tag>
}
@if (moreTags) {
<div>
<span class="badge text-dark">+ {{moreTags}}</span>
</div>
}
2020-11-22 21:06:48 +01:00
</div>
</div>
2023-12-19 15:02:05 -08:00
@if (notesEnabled && document.notes.length) {
<a routerLink="/documents/{{document.id}}/notes" class="document-card-notes py-2 px-1">
<span class="badge rounded-pill bg-light border text-primary">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="ms-1 me-1" name="chat-left-text"></i-bs>
2023-12-19 15:02:05 -08:00
{{document.notes.length}}</span>
</a>
}
2023-03-16 00:42:24 -07:00
2023-03-17 16:36:08 -07:00
<div class="card-body bg-light p-2">
2020-11-22 22:07:55 +01:00
<p class="card-text">
2023-12-19 15:02:05 -08:00
@if (document.correspondent) {
<a title="Toggle correspondent filter" i18n-title (click)="clickCorrespondent.emit(document.correspondent);$event.stopPropagation()" class="fw-bold btn-link">{{(document.correspondent$ | async)?.name ?? privateName}}</a>:
2023-12-19 15:02:05 -08:00
}
2021-03-11 15:54:30 -08:00
{{document.title | documentTitle}}
2020-11-22 22:07:55 +01:00
</p>
2020-10-27 01:10:18 +01:00
</div>
2021-03-11 15:54:30 -08:00
<div class="card-footer pt-0 pb-2 px-2">
2021-03-12 07:15:00 -08:00
<div class="list-group list-group-flush border-0 pt-1 pb-2 card-info">
2023-12-19 15:02:05 -08:00
@if (document.document_type) {
<button type="button" class="list-group-item list-group-item-action bg-transparent ps-0 p-1 border-0" title="Toggle document type filter" i18n-title
(click)="clickDocumentType.emit(document.document_type);$event.stopPropagation()">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="file-earmark"></i-bs>
2023-12-19 15:02:05 -08:00
<small>{{(document.document_type$ | async)?.name ?? privateName}}</small>
</button>
}
@if (document.storage_path) {
<button type="button" class="list-group-item list-group-item-action bg-transparent ps-0 p-1 border-0" title="Toggle storage path filter" i18n-title
(click)="clickStoragePath.emit(document.storage_path);$event.stopPropagation()">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="folder"></i-bs>
2023-12-19 15:02:05 -08:00
<small>{{(document.storage_path$ | async)?.name ?? privateName}}</small>
</button>
}
2021-03-12 20:12:00 -08:00
<div class="list-group-item bg-transparent p-0 border-0 d-flex flex-wrap-reverse justify-content-between">
2021-04-02 14:59:02 +02:00
<ng-template #dateTooltip>
<div class="d-flex flex-column text-light">
2022-05-19 23:50:57 -07:00
<span i18n>Created: {{ document.created | customDate }}</span>
<span i18n>Added: {{ document.added | customDate }}</span>
<span i18n>Modified: {{ document.modified | customDate }}</span>
2021-04-02 14:59:02 +02:00
</div>
</ng-template>
<div class="ps-0 p-1" placement="top" [ngbTooltip]="dateTooltip">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="calendar-event"></i-bs>
2022-05-16 00:30:21 -07:00
<small>{{document.created_date | customDate:'mediumDate'}}</small>
2021-03-12 20:00:23 -08:00
</div>
</div>
2023-12-19 15:02:05 -08:00
@if (document.archive_serial_number | isNumber) {
<div class="ps-0 p-1">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="upc-scan"></i-bs>
2023-12-19 15:02:05 -08:00
<small>#{{document.archive_serial_number}}</small>
</div>
}
@if (document.owner && document.owner !== settingsService.currentUser.id) {
<div class="ps-0 p-1">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="person-fill-lock"></i-bs>
2023-12-19 15:02:05 -08:00
<small>{{document.owner | username}}</small>
</div>
}
@if (document.is_shared_by_requester) {
<div class="ps-0 p-1">
2024-01-17 16:27:38 -08:00
<i-bs width="0.9rem" height="0.9rem" class="me-2 text-muted" name="people-fill"></i-bs>
2023-12-19 15:02:05 -08:00
<small i18n>Shared</small>
</div>
}
2021-03-11 15:54:30 -08:00
</div>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group w-100">
2023-09-14 14:03:28 -07:00
<a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary" title="Edit" i18n-title *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n-title>
2024-01-17 16:27:38 -08:00
<i-bs name="pencil"></i-bs>
2020-10-27 01:10:18 +01:00
</a>
<a [href]="previewUrl" target="_blank" class="btn btn-sm btn-outline-secondary"
2023-12-19 15:02:05 -08:00
[ngbPopover]="previewContent" [popoverTitle]="document.title | documentTitle"
autoClose="true" popoverClass="shadow popover-preview" (mouseenter)="mouseEnterPreview()" (mouseleave)="mouseLeavePreview()" #popover="ngbPopover">
2024-01-17 16:27:38 -08:00
<i-bs name="eye"></i-bs>
</a>
2021-02-06 00:40:18 -08:00
<ng-template #previewContent>
<pngx-preview-popup [document]="document"></pngx-preview-popup>
2021-02-06 00:40:18 -08:00
</ng-template>
2022-05-19 23:50:57 -07:00
<a [href]="getDownloadUrl()" class="btn btn-sm btn-outline-secondary" title="Download" i18n-title (click)="$event.stopPropagation()">
2024-01-17 16:27:38 -08:00
<i-bs name="download"></i-bs>
2020-10-27 01:10:18 +01:00
</a>
</div>
</div>
</div>
</div>
</div>