2020-11-08 00:07:31 +01:00
< app-page-header [ title ] = " getTitle ( ) " >
2020-10-27 01:10:18 +01:00
2022-05-11 23:09:22 -07:00
< div ngbDropdown class = "me-2 d-flex" >
< button class = "btn btn-sm btn-outline-primary" id = "dropdownSelect" ngbDropdownToggle >
2021-01-11 16:15:55 -08:00
< svg class = "toolbaricon" fill = "currentColor" >
2020-11-29 16:33:33 +01:00
< use xlink:href = "assets/bootstrap-icons.svg#text-indent-left" / >
2022-05-11 23:09:22 -07:00
< / svg >
< div class = "d-none d-sm-inline" > < ng-container i18n > Select< / ng-container > < / div >
2020-11-29 16:33:33 +01:00
< / button >
2020-12-14 23:14:19 -08:00
< div ngbDropdownMenu aria-labelledby = "dropdownSelect" class = "shadow" >
2020-12-28 15:39:53 +01:00
< button ngbDropdownItem ( click ) = " list . selectNone ( ) " i18n > Select none< / button >
< button ngbDropdownItem ( click ) = " list . selectPage ( ) " i18n > Select page< / button >
< button ngbDropdownItem ( click ) = " list . selectAll ( ) " i18n > Select all< / button >
2020-11-29 16:33:33 +01:00
< / div >
< / div >
2022-07-02 00:45:26 -07:00
< div class = "btn-group flex-fill" role = "group" >
< input type = "radio" class = "btn-check" [ ( ngModel ) ] = " displayMode " value = "details" ( ngModelChange ) = " saveDisplayMode ( ) " id = "displayModeDetails" >
< label for = "displayModeDetails" class = "btn btn-outline-primary btn-sm" >
2020-10-27 01:10:18 +01:00
< svg class = "toolbaricon" fill = "currentColor" >
2020-10-30 22:46:43 +01:00
< use xlink:href = "assets/bootstrap-icons.svg#list-ul" / >
2020-10-27 01:10:18 +01:00
< / svg >
< / label >
2022-07-02 00:45:26 -07:00
< input type = "radio" class = "btn-check" [ ( ngModel ) ] = " displayMode " value = "smallCards" ( ngModelChange ) = " saveDisplayMode ( ) " id = "displayModeSmall" >
< label for = "displayModeSmall" class = "btn btn-outline-primary btn-sm" >
2020-10-27 01:10:18 +01:00
< svg class = "toolbaricon" fill = "currentColor" >
2020-10-30 22:46:43 +01:00
< use xlink:href = "assets/bootstrap-icons.svg#grid" / >
2020-10-27 01:10:18 +01:00
< / svg >
< / label >
2022-07-02 00:45:26 -07:00
< input type = "radio" class = "btn-check" [ ( ngModel ) ] = " displayMode " value = "largeCards" ( ngModelChange ) = " saveDisplayMode ( ) " id = "displayModeLarge" >
< label for = "displayModeLarge" class = "btn btn-outline-primary btn-sm" >
2020-10-27 01:10:18 +01:00
< svg class = "toolbaricon" fill = "currentColor" >
2020-10-30 22:46:43 +01:00
< use xlink:href = "assets/bootstrap-icons.svg#hdd-stack" / >
2020-10-27 01:10:18 +01:00
< / svg >
< / label >
< / div >
2020-12-08 23:08:02 -08:00
2022-02-20 01:21:30 +01:00
< div ngbDropdown class = "btn-group ms-2 flex-fill" >
2021-01-11 12:52:42 -08:00
< button class = "btn btn-outline-primary btn-sm" id = "dropdownBasic1" ngbDropdownToggle i18n > Sort< / button >
< div ngbDropdownMenu aria-labelledby = "dropdownBasic1" class = "shadow dropdown-menu-right" >
2022-07-02 00:45:26 -07:00
< div class = "w-100 d-flex pb-2 mb-1 border-bottom" >
< input type = "radio" class = "btn-check" [ value ] = " false " [ ( ngModel ) ] = " listSortReverse " id = "listSortReverseFalse" >
< label class = "btn btn-outline-primary btn-sm mx-2 flex-fill" for = "listSortReverseFalse" >
2021-01-11 12:52:42 -08:00
< svg class = "toolbaricon" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#sort-alpha-down" / >
< / svg >
< / label >
2022-07-02 00:45:26 -07:00
< input type = "radio" class = "btn-check" [ value ] = " true " [ ( ngModel ) ] = " listSortReverse " id = "listSortReverseTrue" >
< label class = "btn btn-outline-primary btn-sm me-2 flex-fill" for = "listSortReverseTrue" >
2021-01-11 12:52:42 -08:00
< svg class = "toolbaricon" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#sort-alpha-up-alt" / >
< / svg >
< / label >
< / div >
< div >
2022-05-05 08:36:18 -07:00
< button * ngFor = "let f of getSortFields()" ngbDropdownItem ( click ) = " setSortField ( f . field ) "
2021-01-11 12:52:42 -08:00
[class.active]="list.sortField == f.field">{{f.name}}
< / button >
2020-10-27 01:10:18 +01:00
< / div >
< / div >
< / div >
2020-10-30 22:46:43 +01:00
2022-02-20 01:21:30 +01:00
< div class = "btn-group ms-2 flex-fill" ngbDropdown role = "group" >
2022-09-21 23:17:24 -07:00
< button class = "btn btn-sm btn-outline-primary dropdown-toggle flex-fill" tourAnchor = "tour.documents-views" ngbDropdownToggle i18n > Views< / button >
2021-01-11 12:52:42 -08:00
< div class = "dropdown-menu shadow dropdown-menu-right" ngbDropdownMenu >
2021-02-18 17:29:21 +01:00
< ng-container * ngIf = "!list.activeSavedViewId" >
2022-05-04 22:31:09 -07:00
< button ngbDropdownItem * ngFor = "let view of savedViewService.allViews" ( click ) = " loadViewConfig ( view . id ) " > {{view.name}}< / button >
2021-01-11 12:52:42 -08:00
< div class = "dropdown-divider" * ngIf = "savedViewService.allViews.length > 0" > < / div >
< / ng-container >
2020-12-08 23:08:02 -08:00
2021-02-18 17:29:21 +01:00
< button ngbDropdownItem ( click ) = " saveViewConfig ( ) " * ngIf = "list.activeSavedViewId" i18n > Save "{{list.activeSavedViewTitle}}"< / button >
2021-01-11 12:52:42 -08:00
< button ngbDropdownItem ( click ) = " saveViewConfigAs ( ) " i18n > Save as...< / button >
2020-10-30 22:46:43 +01:00
< / div >
< / div >
2020-12-08 23:08:02 -08:00
2020-10-27 01:10:18 +01:00
< / app-page-header >
2022-05-11 23:09:22 -07:00
< div class = "row sticky-top pt-3 pt-sm-4 pb-2 pb-lg-4 bg-body" >
2021-04-04 00:03:51 +02:00
< app-filter-editor [ hidden ] = " isBulkEditing " [ ( filterRules ) ] = " list . filterRules " [ unmodifiedFilterRules ] = " unmodifiedFilterRules " # filterEditor > < / app-filter-editor >
2020-12-30 23:34:21 +01:00
< app-bulk-editor [ hidden ] = " ! isBulkEditing " > < / app-bulk-editor >
2020-12-18 21:19:49 -08:00
< / div >
2022-09-21 21:44:15 -07:00
2022-03-15 00:58:58 -07:00
< ng-template # pagination >
2022-09-26 15:25:10 -07:00
< div class = "d-flex justify-content-between align-items-center" tourAnchor = "tour.documents" >
2022-03-15 00:58:58 -07:00
< p >
< ng-container * ngIf = "list.isReloading" >
< div class = "spinner-border spinner-border-sm me-2" role = "status" > < / div >
< ng-container i18n > Loading...< / ng-container >
< / ng-container >
< span i18n * ngIf = "list.selected.size > 0" > {list.collectionSize, plural, =1 {Selected {{list.selected.size}} of one document} other {Selected {{list.selected.size}} of {{list.collectionSize || 0}} documents}}< / span >
< ng-container * ngIf = "!list.isReloading" >
< span i18n * ngIf = "list.selected.size == 0" > {list.collectionSize, plural, =1 {One document} other {{{list.collectionSize || 0}} documents}}< / span > < span i18n * ngIf = "isFiltered" > (filtered)< / span >
< / ng-container >
< / p >
2022-08-08 00:03:15 -07:00
< ngb-pagination * ngIf = "list.collectionSize" [ pageSize ] = " list . currentPageSize " [ collectionSize ] = " list . collectionSize " [ ( page ) ] = " list . currentPage " [ maxSize ] = " 5 "
2022-03-15 00:58:58 -07:00
[rotate]="true" aria-label="Default pagination">< / ngb-pagination >
< / div >
< / ng-template >
< ng-container * ngTemplateOutlet = "pagination" > < / ng-container >
2020-12-14 23:14:19 -08:00
2021-04-03 21:02:33 +02:00
< ng-container * ngIf = "list.error ; else documentListNoError" >
2022-04-02 17:05:15 -07:00
< div class = "alert alert-danger" role = "alert" > < ng-container i18n > Error while loading documents< / ng-container > : {{list.error}}< / div >
2021-04-03 21:02:33 +02:00
< / ng-container >
2020-10-27 01:10:18 +01:00
2021-04-03 21:02:33 +02:00
< ng-template # documentListNoError >
< div * ngIf = "displayMode == 'largeCards'" >
2022-05-19 23:42:25 +02:00
< app-document-card-large [ selected ] = " list . isSelected ( d ) " ( toggleSelected ) = " toggleSelected ( d , $ event ) " * ngFor = "let d of list.documents; trackBy: trackByDocumentId" [ document ] = " d " ( clickTag ) = " clickTag ( $ event ) " ( clickCorrespondent ) = " clickCorrespondent ( $ event ) " ( clickDocumentType ) = " clickDocumentType ( $ event ) " ( clickStoragePath ) = " clickStoragePath ( $ event ) " ( clickMoreLike ) = " clickMoreLike ( d . id ) " >
2021-04-03 21:02:33 +02:00
< / app-document-card-large >
< / div >
2021-04-14 09:00:30 -07:00
2022-02-19 23:05:41 -08:00
< table class = "table table-sm align-middle border shadow-sm" * ngIf = "displayMode == 'details'" >
2021-04-03 21:02:33 +02:00
< thead >
< th > < / th >
< th class = "d-none d-lg-table-cell"
sortable="archive_serial_number"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>ASN< / th >
< th class = "d-none d-md-table-cell"
sortable="correspondent__name"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Correspondent< / th >
< th
sortable="title"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Title< / th >
< th class = "d-none d-xl-table-cell"
sortable="document_type__name"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Document type< / th >
2022-05-19 23:42:25 +02:00
< th class = "d-none d-xl-table-cell"
sortable="storage_path__name"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Storage path< / th >
2021-04-03 21:02:33 +02:00
< th
sortable="created"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Created< / th >
< th class = "d-none d-xl-table-cell"
sortable="added"
[currentSortField]="list.sortField"
[currentSortReverse]="list.sortReverse"
(sort)="onSort($event)"
i18n>Added< / th >
< / thead >
< tbody >
2022-03-13 08:41:36 -07:00
< tr * ngFor = "let d of list.documents; trackBy: trackByDocumentId" ( click ) = " toggleSelected ( d , $ event ) ; $ event . stopPropagation ( ) ; " [ ngClass ] = " list . isSelected ( d ) ? ' table-row-selected ' : ' ' " >
2021-04-03 21:02:33 +02:00
< td >
2022-02-19 23:05:41 -08:00
< div class = "form-check" >
2022-03-13 08:41:36 -07:00
< input type = "checkbox" class = "form-check-input" id = "docCheck{{d.id}}" [ checked ] = " list . isSelected ( d ) " ( click ) = " toggleSelected ( d , $ event ) ; $ event . stopPropagation ( ) ; " >
2022-02-19 23:05:41 -08:00
< label class = "form-check-label" for = "docCheck{{d.id}}" > < / label >
2021-04-03 21:02:33 +02:00
< / div >
< / td >
< td class = "d-none d-lg-table-cell" >
{{d.archive_serial_number}}
< / td >
< td class = "d-none d-md-table-cell" >
< ng-container * ngIf = "d.correspondent" >
2022-05-19 23:50:57 -07:00
< a ( click ) = " clickCorrespondent ( d . correspondent ) ; $ event . stopPropagation ( ) " title = "Filter by correspondent" i18n-title > {{(d.correspondent$ | async)?.name}}< / a >
2021-04-03 21:02:33 +02:00
< / ng-container >
< / td >
< td >
2022-05-19 23:50:57 -07:00
< a ( click ) = " openDocumentsService . openDocument ( d ) " title = "Edit document" i18n-title style = "overflow-wrap: anywhere;" > {{d.title | documentTitle}}< / a >
< app-tag [ tag ] = " t " * ngFor = "let t of d.tags$ | async" class = "ms-1" clickable = "true" linkTitle = "Filter by tag" i18n-linkTitle ( click ) = " clickTag ( t . id ) ; $ event . stopPropagation ( ) " > < / app-tag >
2021-04-03 21:02:33 +02:00
< / td >
< td class = "d-none d-xl-table-cell" >
< ng-container * ngIf = "d.document_type" >
2022-05-19 23:50:57 -07:00
< a ( click ) = " clickDocumentType ( d . document_type ) ; $ event . stopPropagation ( ) " title = "Filter by document type" i18n-title > {{(d.document_type$ | async)?.name}}< / a >
2021-04-03 21:02:33 +02:00
< / ng-container >
< / td >
2022-05-19 23:42:25 +02:00
< td class = "d-none d-xl-table-cell" >
< ng-container * ngIf = "d.storage_path" >
2022-05-19 23:50:57 -07:00
< a ( click ) = " clickStoragePath ( d . storage_path ) ; $ event . stopPropagation ( ) " title = "Filter by storage path" i18n-title > {{(d.storage_path$ | async)?.name}}< / a >
2022-05-19 23:42:25 +02:00
< / ng-container >
< / td >
2021-04-03 21:02:33 +02:00
< td >
2022-05-16 00:30:21 -07:00
{{d.created_date | customDate}}
2021-04-03 21:02:33 +02:00
< / td >
< td class = "d-none d-xl-table-cell" >
{{d.added | customDate}}
< / td >
< / tr >
< / tbody >
< / table >
2021-04-14 09:00:30 -07:00
2022-04-05 13:13:43 -07:00
< div class = "row row-cols-paperless-cards" * ngIf = "displayMode == 'smallCards'" >
2022-05-19 23:42:25 +02:00
< app-document-card-small class = "p-0" [ selected ] = " list . isSelected ( d ) " ( toggleSelected ) = " toggleSelected ( d , $ event ) " [ document ] = " d " * ngFor = "let d of list.documents; trackBy: trackByDocumentId" ( clickTag ) = " clickTag ( $ event ) " ( clickCorrespondent ) = " clickCorrespondent ( $ event ) " ( clickStoragePath ) = " clickStoragePath ( $ event ) " ( clickDocumentType ) = " clickDocumentType ( $ event ) " > < / app-document-card-small >
2021-04-03 21:02:33 +02:00
< / div >
2022-03-15 00:58:58 -07:00
< div * ngIf = "list.documents?.length > 15" class = "mt-3" >
< ng-container * ngTemplateOutlet = "pagination" > < / ng-container >
< / div >
2021-04-14 09:00:30 -07:00
2021-04-03 21:02:33 +02:00
< / ng-template >