2023-09-14 14:03:28 -07:00
< pngx-page-header [ ( title ) ] = " title " >
2024-05-22 16:01:15 -07:00
@if (archiveContentRenderType === ContentRenderType.PDF & & !useNativePdfViewer) {
2024-04-07 15:41:45 -07:00
@if (previewNumPages) {
< div class = "input-group input-group-sm d-none d-md-flex" >
< div class = "input-group-text" i18n > Page< / div >
< input class = "form-control flex-grow-0 w-auto" type = "number" min = "1" [ max ] = " previewNumPages " [ ( ngModel ) ] = " previewCurrentPage " / >
< div class = "input-group-text" i18n > of {{previewNumPages}}< / div >
< / div >
}
2024-03-04 17:00:19 -08:00
< div class = "input-group input-group-sm me-md-5 d-none d-md-flex" >
2023-12-19 15:02:05 -08:00
< button class = "btn btn-outline-secondary" ( click ) = " decreaseZoom ( ) " i18n > -< / button >
2025-04-22 08:02:43 -07:00
< select class = "form-select" ( change ) = " setZoom ( $ event . target . value ) " [ ngModel ] = " currentZoom " >
2023-12-19 15:02:05 -08:00
@for (setting of zoomSettings; track setting) {
2025-04-22 08:02:43 -07:00
< option [ value ] = " setting " >
2023-12-19 15:02:05 -08:00
{{ getZoomSettingTitle(setting) }}
< / option >
}
< / select >
< button class = "btn btn-outline-secondary" ( click ) = " increaseZoom ( ) " i18n > +< / button >
< / div >
}
2020-12-18 14:31:09 -08:00
2024-03-04 17:00:19 -08:00
< button type = "button" class = "btn btn-sm btn-outline-danger me-md-4" ( click ) = " delete ( ) " [ disabled ] = " ! userIsOwner " * pngxIfPermissions = "{ action: PermissionAction.Delete, type: PermissionType.Document }" >
2024-01-17 16:27:38 -08:00
< i-bs width = "1.2em" height = "1.2em" name = "trash" > < / i-bs > < span class = "d-none d-lg-inline ps-1" i18n > Delete< / span >
2024-01-13 13:40:22 -08:00
< / button >
2020-11-25 18:01:43 +01:00
2024-03-04 17:00:19 -08:00
< div class = "btn-group" >
2025-01-30 08:31:52 -08:00
< button ( click ) = " download ( ) " class = "btn btn-sm btn-outline-primary" [ disabled ] = " downloading " >
@if (downloading) {
< div class = "spinner-border spinner-border-sm" role = "status" > < / div >
} @else {
< i-bs width = "1.2em" height = "1.2em" name = "download" > < / i-bs >
}
< span class = "d-none d-lg-inline ps-1" i18n > Download< / span >
< / button >
2020-12-11 14:22:02 -08:00
2024-01-13 13:40:22 -08:00
@if (metadata?.has_archive_version) {
< div class = "btn-group" ngbDropdown role = "group" >
2025-01-30 08:31:52 -08:00
< button class = "btn btn-sm btn-outline-primary dropdown-toggle" [ disabled ] = " downloading " ngbDropdownToggle > < / button >
2024-01-13 13:40:22 -08:00
< div class = "dropdown-menu shadow" ngbDropdownMenu >
2025-01-30 08:31:52 -08:00
< button ngbDropdownItem ( click ) = " download ( true ) " [ disabled ] = " downloading " i18n > Download original< / button >
2024-01-13 13:40:22 -08:00
< / div >
2023-12-19 15:02:05 -08:00
< / div >
2024-01-13 13:40:22 -08:00
}
< / div >
2020-11-25 18:01:43 +01:00
2024-01-13 13:40:22 -08:00
< div class = "ms-auto" ngbDropdown >
2024-03-04 17:00:19 -08:00
< button class = "btn btn-sm btn-outline-primary" id = "actionsDropdown" ngbDropdownToggle >
2024-01-17 16:27:38 -08:00
< i-bs name = "three-dots" > < / i-bs >
2024-01-13 13:40:22 -08:00
< div class = "d-none d-sm-inline" > < ng-container i18n > Actions< / ng-container > < / div >
< / button >
< div ngbDropdownMenu aria-labelledby = "actionsDropdown" class = "shadow" >
2024-12-11 01:05:23 -08:00
< button ngbDropdownItem ( click ) = " reprocess ( ) " [ disabled ] = " ! userCanEdit | | ! userIsOwner " >
2024-05-31 11:41:52 -07:00
< i-bs width = "1em" height = "1em" name = "arrow-counterclockwise" > < / i-bs > < span i18n > Reprocess< / span >
2024-01-13 13:40:22 -08:00
< / button >
2020-10-28 20:21:00 +01:00
2025-09-11 19:59:11 +02:00
< button ngbDropdownItem ( click ) = " printDocument ( ) " [ hidden ] = " useNativePdfViewer | | isMobile " >
< i-bs width = "1em" height = "1em" name = "printer" > < / i-bs > < span i18n > Print< / span >
< / button >
2024-01-13 13:40:22 -08:00
< button ngbDropdownItem ( click ) = " moreLike ( ) " >
2024-03-25 18:41:24 -07:00
< i-bs width = "1em" height = "1em" name = "diagram-3" > < / i-bs > < span i18n > More like this< / span >
< / button >
2025-08-11 10:29:48 -07:00
< button ngbDropdownItem ( click ) = " editPdf ( ) " [ disabled ] = " ! userIsOwner | | ! userCanEdit | | originalContentRenderType ! = = ContentRenderType . PDF " >
< i-bs name = "pencil" > < / i-bs > < ng-container i18n > PDF Editor< / ng-container >
2024-05-22 16:01:15 -07:00
< / button >
2024-01-13 13:40:22 -08:00
< / div >
< / div >
2020-10-28 20:21:00 +01:00
2024-01-13 13:40:22 -08:00
< pngx-custom-fields-dropdown
*pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.CustomField }"
[documentId]="documentId"
2025-02-10 18:58:45 -08:00
[disabled]="!userCanEdit"
2024-01-13 13:40:22 -08:00
[existingFields]="document?.custom_fields"
(created)="refreshCustomFields()"
(added)="addField($event)">
< / pngx-custom-fields-dropdown >
2023-11-05 17:26:51 -08:00
2025-02-21 08:44:03 -08:00
< div class = "ms-auto" ngbDropdown >
< button class = "btn btn-sm btn-outline-primary" id = "sendDropdown" ngbDropdownToggle >
< i-bs name = "send" > < / i-bs >
< div class = "d-none d-sm-inline" > < ng-container i18n > Send< / ng-container > < / div >
< / button >
< div ngbDropdownMenu aria-labelledby = "actionsDropdown" class = "shadow" >
< button ngbDropdownItem ( click ) = " openShareLinks ( ) " * pngxIfPermissions = "{ action: PermissionAction.Add, type: PermissionType.ShareLink }" >
< i-bs name = "link" > < / i-bs > < span i18n > Share Links< / span >
< / button >
@if (emailEnabled) {
< button ngbDropdownItem ( click ) = " openEmailDocument ( ) " >
< i-bs name = "envelope" > < / i-bs > < span i18n > Email< / span >
< / button >
}
< / div >
< / div >
2024-01-13 13:40:22 -08:00
< / pngx-page-header >
2023-11-05 17:26:51 -08:00
2024-01-13 13:40:22 -08:00
< div class = "row" >
< div class = "col-md-6 col-xl-4 mb-4" >
2023-12-17 16:11:12 -08:00
2024-01-13 13:40:22 -08:00
< form [ formGroup ] = ' documentForm ' ( ngSubmit ) = " save ( ) " >
2020-12-07 23:42:18 +01:00
2024-01-16 21:44:41 -08:00
< div class = "btn-toolbar mb-1 border-bottom" >
< div class = "btn-group pb-3" >
2024-01-13 13:40:22 -08:00
< button type = "button" class = "btn btn-sm btn-outline-secondary" i18n-title title = "Close" ( click ) = " close ( ) " >
2024-01-17 16:27:38 -08:00
< i-bs width = "1.2em" height = "1.2em" name = "x" > < / i-bs >
2024-01-13 13:40:22 -08:00
< / button >
< button type = "button" class = "btn btn-sm btn-outline-secondary" i18n-title title = "Previous" ( click ) = " previousDoc ( ) " [ disabled ] = " ! hasPrevious ( ) " >
2024-01-17 16:27:38 -08:00
< i-bs width = "1.2em" height = "1.2em" name = "arrow-left" > < / i-bs >
2024-01-13 13:40:22 -08:00
< / button >
< button type = "button" class = "btn btn-sm btn-outline-secondary" i18n-title title = "Next" ( click ) = " nextDoc ( ) " [ disabled ] = " ! hasNext ( ) " >
2024-01-17 16:27:38 -08:00
< i-bs width = "1.2em" height = "1.2em" name = "arrow-right" > < / i-bs >
2024-01-13 13:40:22 -08:00
< / button >
< / div >
2020-12-07 23:42:18 +01:00
2024-01-13 13:40:22 -08:00
< ng-container * ngTemplateOutlet = "saveButtons" > < / ng-container >
< / div >
2020-12-08 15:28:09 +01:00
feat: Complete AI Suggestions Panel integration with document detail component
- Added AI Suggestions Panel component with TypeScript, HTML, SCSS, and tests
- Integrated panel into document detail component
- Added conversion logic from DocumentSuggestions to AISuggestion format
- Implemented apply/reject handlers for suggestions
- Added @angular/animations package and configured animations
- Added missing Bootstrap icons (magic, clock, chevron-down/up, etc.)
- Added visual confidence indicators (high/medium/low with colors)
- Implemented responsive design for mobile and desktop
- Added animations for apply/reject actions
- Component shows suggestions grouped by type (tags, correspondent, document type, storage path, date)
- All builds and lints pass successfully
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-14 18:08:47 +00:00
< pngx-ai-suggestions-panel
[suggestions]="aiSuggestions"
[disabled]="!userCanEdit"
(apply)="onApplySuggestion($event)"
(reject)="onRejectSuggestion($event)">
< / pngx-ai-suggestions-panel >
2024-01-13 13:40:22 -08:00
< ul ngbNav # nav = "ngbNav" class = "nav-underline flex-nowrap flex-md-wrap overflow-auto" ( navChange ) = " onNavChange ( $ event ) " [ ( activeId ) ] = " activeNavID " >
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Details " >
< a ngbNavLink i18n > Details< / a >
< ng-template ngbNavContent >
< div >
< pngx-input-text # inputTitle i18n-title title = "Title" formControlName = "title" [ horizontal ] = " true " ( keyup ) = " titleKeyUp ( $ event ) " [ error ] = " error ? . title " > < / pngx-input-text >
< pngx-input-number i18n-title title = "Archive serial number" [ error ] = " error ? . archive_serial_number " [ horizontal ] = " true " formControlName = 'archive_serial_number' > < / pngx-input-number >
2025-05-19 09:38:01 -07:00
< pngx-input-date i18n-title title = "Date created" formControlName = "created" [ suggestions ] = " suggestions ? . dates " [ showFilter ] = " true " [ horizontal ] = " true " ( filterDocuments ) = " filterDocuments ( $ event ) "
[error]="error?.created">< / pngx-input-date >
2024-05-22 16:15:58 -07:00
< pngx-input-select [ items ] = " correspondents " i18n-title title = "Correspondent" formControlName = "correspondent" [ allowNull ] = " true " [ showFilter ] = " true " [ horizontal ] = " true " ( filterDocuments ) = " filterDocuments ( $ event , DataType . Correspondent ) "
2024-08-05 16:45:48 -07:00
(createNew)="createCorrespondent($event)" [hideAddButton]="createDisabled(DataType.Correspondent)" [suggestions]="suggestions?.correspondents" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.Correspondent }">< / pngx-input-select >
2024-05-22 16:15:58 -07:00
< pngx-input-select [ items ] = " documentTypes " i18n-title title = "Document type" formControlName = "document_type" [ allowNull ] = " true " [ showFilter ] = " true " [ horizontal ] = " true " ( filterDocuments ) = " filterDocuments ( $ event , DataType . DocumentType ) "
2024-08-05 16:45:48 -07:00
(createNew)="createDocumentType($event)" [hideAddButton]="createDisabled(DataType.DocumentType)" [suggestions]="suggestions?.document_types" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.DocumentType }">< / pngx-input-select >
2024-05-22 16:15:58 -07:00
< pngx-input-select [ items ] = " storagePaths " i18n-title title = "Storage path" formControlName = "storage_path" [ allowNull ] = " true " [ showFilter ] = " true " [ horizontal ] = " true " ( filterDocuments ) = " filterDocuments ( $ event , DataType . StoragePath ) "
2024-08-05 16:45:48 -07:00
(createNew)="createStoragePath($event)" [hideAddButton]="createDisabled(DataType.StoragePath)" [suggestions]="suggestions?.storage_paths" i18n-placeholder placeholder="Default" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.StoragePath }">< / pngx-input-select >
< pngx-input-tags formControlName = "tags" [ suggestions ] = " suggestions ? . tags " [ showFilter ] = " true " [ horizontal ] = " true " ( filterDocuments ) = " filterDocuments ( $ event , DataType . Tag ) " [ hideAddButton ] = " createDisabled ( DataType . Tag ) " * pngxIfPermissions = "{ action: PermissionAction.View, type: PermissionType.Tag }" > < / pngx-input-tags >
2024-04-19 01:08:46 -07:00
@for (fieldInstance of document?.custom_fields; track fieldInstance.field; let i = $index) {
2024-01-13 13:40:22 -08:00
< div [ formGroup ] = " customFieldFormFields . controls [ i ] " >
@switch (getCustomFieldFromInstance(fieldInstance)?.data_type) {
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.String) {
2024-01-13 13:40:22 -08:00
< pngx-input-text formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[error]="getCustomFieldError(i)">< / pngx-input-text >
2023-12-19 15:02:05 -08:00
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Date) {
2024-01-13 13:40:22 -08:00
< pngx-input-date formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[error]="getCustomFieldError(i)">< / pngx-input-date >
2023-12-19 15:02:05 -08:00
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Integer) {
2024-01-13 13:40:22 -08:00
< pngx-input-number formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[showAdd]="false"
[error]="getCustomFieldError(i)">< / pngx-input-number >
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Float) {
2024-01-13 13:40:22 -08:00
< pngx-input-number formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[showAdd]="false"
[step]=".1"
[error]="getCustomFieldError(i)">< / pngx-input-number >
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Monetary) {
2024-02-27 08:26:06 -08:00
< pngx-input-monetary formControlName = "value"
2024-01-13 13:40:22 -08:00
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2024-08-05 17:02:03 -07:00
[defaultCurrency]="getCustomFieldFromInstance(fieldInstance)?.extra_data?.default_currency"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
2024-02-27 08:26:06 -08:00
[error]="getCustomFieldError(i)">< / pngx-input-monetary >
2024-01-13 13:40:22 -08:00
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Boolean) {
2024-01-13 13:40:22 -08:00
< pngx-input-check formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true">< / pngx-input-check >
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.Url) {
2024-01-13 13:40:22 -08:00
< pngx-input-url formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[error]="getCustomFieldError(i)">< / pngx-input-url >
}
2024-01-20 08:26:24 -08:00
@case (CustomFieldDataType.DocumentLink) {
2024-01-13 13:40:22 -08:00
< pngx-input-document-link formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
[parentDocumentID]="documentId"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-01-13 13:40:22 -08:00
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[error]="getCustomFieldError(i)">< / pngx-input-document-link >
2023-12-19 15:02:05 -08:00
}
2024-07-09 07:57:07 -07:00
@case (CustomFieldDataType.Select) {
< pngx-input-select formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
2024-12-01 20:15:38 -08:00
[items]="getCustomFieldFromInstance(fieldInstance)?.extra_data.select_options"
bindLabel="label"
2024-07-09 07:57:07 -07:00
[allowNull]="true"
[horizontal]="true"
2025-02-10 18:58:45 -08:00
[removable]="userCanEdit"
2024-07-09 07:57:07 -07:00
(removed)="removeField(fieldInstance)"
[error]="getCustomFieldError(i)">< / pngx-input-select >
}
2025-09-13 21:19:00 -06:00
@case (CustomFieldDataType.LongText) {
< pngx-input-textarea formControlName = "value"
[title]="getCustomFieldFromInstance(fieldInstance)?.name"
[removable]="userCanEdit"
(removed)="removeField(fieldInstance)"
[horizontal]="true"
[error]="getCustomFieldError(i)">< / pngx-input-textarea >
}
2023-12-19 15:02:05 -08:00
}
2024-01-13 13:40:22 -08:00
< / div >
}
< / div >
2022-12-07 00:36:31 -08:00
2024-01-13 13:40:22 -08:00
< div class = "d-flex border-top pt-3" >
< ng-container * ngTemplateOutlet = "saveButtons" > < / ng-container >
< / div >
< / ng-template >
< / li >
2022-12-07 00:36:31 -08:00
2024-01-13 13:40:22 -08:00
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Content " >
< a ngbNavLink i18n > Content< / a >
< ng-template ngbNavContent >
< div >
< textarea class = "form-control" id = "content" rows = "20" formControlName = 'content' [ class . rtl ] = " isRTL " > < / textarea >
< / div >
< / ng-template >
< / li >
2020-10-27 01:10:18 +01:00
2024-01-13 13:40:22 -08:00
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Metadata " >
< a ngbNavLink i18n > Metadata< / a >
< ng-template ngbNavContent >
2020-10-27 01:10:18 +01:00
2024-01-13 13:40:22 -08:00
@if (document) {
< table class = "table table-borderless" >
< tbody >
< tr >
< td i18n > Date modified< / td >
< td > {{document.modified | customDate}}< / td >
< / tr >
< tr >
< td i18n > Date added< / td >
< td > {{document.added | customDate}}< / td >
< / tr >
< tr >
< td i18n > Media filename< / td >
< td > {{metadata?.media_filename}}< / td >
< / tr >
< tr >
< td i18n > Original filename< / td >
< td > {{metadata?.original_filename}}< / td >
< / tr >
< tr >
< td i18n > Original MD5 checksum< / td >
< td > {{metadata?.original_checksum}}< / td >
< / tr >
< tr >
< td i18n > Original file size< / td >
< td > {{metadata?.original_size | fileSize}}< / td >
< / tr >
< tr >
< td i18n > Original mime type< / td >
< td > {{metadata?.original_mime_type}}< / td >
< / tr >
@if (metadata?.has_archive_version) {
< tr >
< td i18n > Archive MD5 checksum< / td >
< td > {{metadata?.archive_checksum}}< / td >
< / tr >
}
@if (metadata?.has_archive_version) {
< tr >
< td i18n > Archive file size< / td >
< td > {{metadata?.archive_size | fileSize}}< / td >
< / tr >
}
< / tbody >
< / table >
}
2022-03-29 10:35:42 -07:00
2024-01-13 13:40:22 -08:00
@if (metadata?.original_metadata?.length > 0) {
< pngx-metadata-collapse i18n-title title = "Original document metadata" [ metadata ] = " metadata . original_metadata " > < / pngx-metadata-collapse >
2023-12-19 15:02:05 -08:00
}
2024-01-13 13:40:22 -08:00
@if (metadata?.archive_metadata?.length > 0) {
< pngx-metadata-collapse i18n-title title = "Archived document metadata" [ metadata ] = " metadata . archive_metadata " > < / pngx-metadata-collapse >
2023-12-19 15:02:05 -08:00
}
2023-12-17 16:11:12 -08:00
2024-01-13 13:40:22 -08:00
< / ng-template >
< / li >
2023-12-19 15:02:05 -08:00
2024-01-13 13:40:22 -08:00
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Preview " class = "d-md-none" >
< a ngbNavLink i18n > Preview< / a >
@if (!pdfPreview.offsetParent) {
< ng-template ngbNavContent >
2024-01-20 08:26:24 -08:00
< div class = "position-relative" >
< ng-container * ngTemplateOutlet = "previewContent" > < / ng-container >
< / div >
2024-01-13 13:40:22 -08:00
< / ng-template >
2023-12-19 15:02:05 -08:00
}
2024-01-13 13:40:22 -08:00
< / li >
@if (notesEnabled) {
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Notes " >
< a class = "text-nowrap" ngbNavLink i18n > Notes @if (document?.notes.length) {
< span class = "badge text-bg-secondary ms-1" > {{document.notes.length}}< / span >
}< / a >
< ng-template ngbNavContent >
< pngx-document-notes [ documentId ] = " documentId " [ notes ] = " document ? . notes " [ addDisabled ] = " ! userCanEdit " ( updated ) = " notesUpdated ( $ event ) " > < / pngx-document-notes >
< / ng-template >
< / li >
}
2024-04-23 08:16:28 -07:00
@if (historyEnabled) {
< li [ ngbNavItem ] = " DocumentDetailNavIDs . History " >
< a ngbNavLink i18n > History< / a >
< ng-template ngbNavContent >
< div class = "mb-3" >
< pngx-document-history [ documentId ] = " documentId " > < / pngx-document-history >
< / div >
< / ng-template >
< / li >
}
2024-01-13 13:40:22 -08:00
@if (showPermissions) {
< li [ ngbNavItem ] = " DocumentDetailNavIDs . Permissions " >
< a ngbNavLink i18n > Permissions< / a >
< ng-template ngbNavContent >
< div class = "mb-3" >
< pngx-permissions-form [ users ] = " users " formControlName = "permissions_form" > < / pngx-permissions-form >
2023-12-19 15:02:05 -08:00
< / div >
2024-01-13 13:40:22 -08:00
< / ng-template >
< / li >
}
< / ul >
< div [ ngbNavOutlet ] = " nav " class = "mt-3" > < / div >
< / form >
< / div >
< div class = "col-md-6 col-xl-8 mb-3 d-none d-md-block position-relative" # pdfPreview >
< ng-container * ngTemplateOutlet = "previewContent" > < / ng-container >
< / div >
< / div >
< ng-template # saveButtons >
2024-01-16 21:44:41 -08:00
< div class = "btn-group pb-3 ms-auto" >
2024-01-13 13:40:22 -08:00
< ng-container * pngxIfPermissions = "{ action: PermissionAction.Change, type: PermissionType.Document }" >
< button type = "submit" class = "order-3 btn btn-sm btn-primary" i18n [ disabled ] = " ! userCanEdit | | networkActive | | ( isDirty $ | async ) ! = = true " > Save< / button >
@if (hasNext()) {
< button type = "button" class = "order-1 btn btn-sm btn-outline-primary" ( click ) = " saveEditNext ( ) " i18n [ disabled ] = " ! userCanEdit | | networkActive | | ( isDirty $ | async ) ! = = true " > Save & next< / button >
}
@if (!hasNext()) {
< button type = "button" class = "order-2 btn btn-sm btn-outline-primary" ( click ) = " save ( true ) " i18n [ disabled ] = " ! userCanEdit | | networkActive | | ( isDirty $ | async ) ! = = true " > Save & close< / button >
}
2024-10-17 14:31:24 -07:00
< button type = "button" class = "order-0 btn btn-sm btn-outline-secondary" ( click ) = " discard ( ) " i18n [ disabled ] = " ! userCanEdit | | networkActive | | ( isDirty $ | async ) ! = = true " > Discard< / button >
2024-01-13 13:40:22 -08:00
< / ng-container >
< / div >
< / ng-template >
< ng-template # previewContent >
2025-02-03 21:54:18 -08:00
< div class = "thumb-preview position-absolute pe-none text-center" [ class . fade ] = " previewLoaded " >
2025-01-01 22:26:53 -08:00
@if (showThumbnailOverlay) {
2025-02-03 21:54:18 -08:00
< img [ src ] = " thumbUrl | safeUrl " class = "mx-auto" [ attr . width ] = " previewZoomScale = == ' page-fit ' ? ' auto ' : ' 100 % ' " [ attr . height ] = " previewZoomScale = == ' page-fit ' ? ' 100 % ' : ' auto ' " alt = "Document loading..." i18n-alt / >
2025-01-01 22:26:53 -08:00
}
2024-11-12 16:20:52 -08:00
< div class = "position-absolute top-0 start-0 m-2 p-2 d-flex align-items-center justify-content-center" >
2024-01-13 13:40:22 -08:00
< div >
< div class = "spinner-border spinner-border-sm me-2" role = "status" > < / div >
< ng-container i18n > Loading...< / ng-container >
< / div >
< / div >
2024-11-12 16:20:52 -08:00
< / div >
@if (document) {
2024-05-22 16:01:15 -07:00
@switch (archiveContentRenderType) {
2024-01-25 13:22:03 -08:00
@case (ContentRenderType.PDF) {
@if (!useNativePdfViewer) {
< div class = "preview-sticky pdf-viewer-container" >
2024-05-16 11:12:19 -07:00
< pdf-viewer
2024-01-25 13:22:03 -08:00
[src]="{ url: previewUrl, password: password }"
[original-size]="false"
[show-borders]="true"
[show-all]="true"
[(page)]="previewCurrentPage"
[zoom-scale]="previewZoomScale"
[zoom]="previewZoomSetting"
(error)="onError($event)"
(after-load-complete)="pdfPreviewLoaded($event)">
2024-05-16 11:12:19 -07:00
< / pdf-viewer >
2024-01-25 13:22:03 -08:00
< / div >
} @else {
2024-06-21 11:22:18 -07:00
< object [ data ] = " previewUrl | safeUrl " class = "preview-sticky" width = "100%" > < / object >
2024-01-25 13:22:03 -08:00
}
}
@case (ContentRenderType.Text) {
2024-10-13 10:45:05 -07:00
< div class = "preview-sticky bg-light p-3 overflow-auto whitespace-preserve" width = "100%" > {{previewText}}< / div >
2024-01-25 13:22:03 -08:00
}
@case (ContentRenderType.Image) {
< div class = "preview-sticky" >
< img [ src ] = " previewUrl | safeUrl " width = "100%" height = "100%" alt = "{{title}}" / >
2024-01-20 08:26:24 -08:00
< / div >
2024-01-25 13:22:03 -08:00
}
2024-12-01 11:46:19 -08:00
@case (ContentRenderType.TIFF) {
@if (!tiffError) {
< div class = "preview-sticky" >
< img [ src ] = " tiffURL " width = "100%" height = "100%" alt = "{{title}}" / >
< / div >
} @else {
< div class = "preview-sticky bg-light p-3 overflow-auto whitespace-preserve" width = "100%" > {{tiffError}}< / div >
}
}
2024-01-25 13:22:03 -08:00
@case (ContentRenderType.Other) {
2024-01-20 08:26:24 -08:00
< object [ data ] = " previewUrl | safeUrl " class = "preview-sticky" width = "100%" > < / object >
}
}
2024-01-25 13:22:03 -08:00
@if (requiresPassword) {
< div class = "password-prompt" >
< form >
< input autocomplete = "" autofocus = "true" class = "form-control" i18n-placeholder placeholder = "Enter Password" type = "password" ( keyup ) = " onPasswordKeyUp ( $ event ) " / >
< / form >
2024-01-13 13:40:22 -08:00
< / div >
2024-01-20 08:26:24 -08:00
}
2024-01-13 13:40:22 -08:00
}
< / ng-template >