2023-09-14 14:03:28 -07:00
< pngx-page-header title = "{{ typeNamePlural | titlecase }}" >
2023-09-19 13:40:21 -07:00
< button class = "btn btn-sm btn-outline-secondary me-2" ( click ) = " clearSelection ( ) " [ hidden ] = " selectedObjects . size = == 0 " >
< svg class = "sidebaricon" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#x" / >
< / svg > < ng-container i18n > Clear selection< / ng-container >
< / button >
< button type = "button" class = "btn btn-sm btn-outline-primary me-5" ( click ) = " setPermissions ( ) " [ disabled ] = " ! userOwnsAll | | selectedObjects . size = == 0 " >
< svg width = "1em" height = "1em" viewBox = "0 0 16 16" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#person-fill-lock" / >
< / svg > < ng-container i18n > Permissions< / ng-container >
< / button >
2023-09-14 14:03:28 -07:00
< button type = "button" class = "btn btn-sm btn-outline-primary" ( click ) = " openCreateDialog ( ) " * pngxIfPermissions = "{ action: PermissionAction.Add, type: permissionType }" i18n > Create< / button >
< / pngx-page-header >
2020-10-27 01:10:18 +01:00
2023-05-03 19:37:36 -07:00
< div class = "row mb-3" >
2021-01-19 14:00:15 +01:00
< div class = "col-md mb-2 mb-xl-0" >
< div class = "form-inline d-flex align-items-center" >
2022-02-20 01:21:30 +01:00
< label class = "text-muted me-2 mb-0" i18n > Filter by:< / label >
2022-03-07 09:45:58 -08:00
< input class = "form-control form-control-sm flex-fill w-auto" type = "text" autofocus [ ( ngModel ) ] = " nameFilter " ( keyup ) = " onNameFilterKeyUp ( $ event ) " placeholder = "Name" i18n-placeholder >
2021-01-19 14:00:15 +01:00
< / div >
< / div >
2023-05-03 19:37:36 -07:00
< ngb-pagination class = "col-auto" [ pageSize ] = " 25 " [ collectionSize ] = " collectionSize " [ ( page ) ] = " page " [ maxSize ] = " 5 " ( pageChange ) = " reloadData ( ) " size = "sm" aria-label = "Pagination" > < / ngb-pagination >
2020-11-22 20:00:58 +01:00
< / div >
2020-10-27 01:10:18 +01:00
2022-02-19 23:48:49 -08:00
< table class = "table table-striped align-middle border shadow-sm" >
2020-10-27 01:10:18 +01:00
< thead >
< tr >
2023-09-19 13:40:21 -07:00
< th scope = "col" >
< div class = "form-check" >
< input type = "checkbox" class = "form-check-input" id = "all-objects" [ disabled ] = " data . length = == 0 " ( click ) = " toggleAll ( $ event ) ; $ event . stopPropagation ( ) ; " >
< label class = "form-check-label" for = "all-objects" > < / label >
< / div >
< / th >
2023-09-14 14:03:28 -07:00
< th scope = "col" pngxSortable = "name" [ currentSortField ] = " sortField " [ currentSortReverse ] = " sortReverse " ( sort ) = " onSort ( $ event ) " i18n > Name< / th >
< th scope = "col" class = "d-none d-sm-table-cell" pngxSortable = "matching_algorithm" [ currentSortField ] = " sortField " [ currentSortReverse ] = " sortReverse " ( sort ) = " onSort ( $ event ) " i18n > Matching< / th >
< th scope = "col" pngxSortable = "document_count" [ currentSortField ] = " sortField " [ currentSortReverse ] = " sortReverse " ( sort ) = " onSort ( $ event ) " i18n > Document count< / th >
< th scope = "col" * ngFor = "let column of extraColumns" pngxSortable = "{{column.key}}" [ currentSortField ] = " sortField " [ currentSortReverse ] = " sortReverse " ( sort ) = " onSort ( $ event ) " > {{column.name}}< / th >
2020-12-23 15:09:39 +01:00
< th scope = "col" i18n > Actions< / th >
2020-10-27 01:10:18 +01:00
< / tr >
< / thead >
< tbody >
2023-08-22 22:11:53 -07:00
< tr * ngIf = "isLoading" >
< td colspan = "5" >
< div class = "spinner-border spinner-border-sm me-2" role = "status" > < / div >
< ng-container i18n > Loading...< / ng-container >
< / td >
< / tr >
2023-09-19 13:40:21 -07:00
< tr * ngFor = "let object of data" ( click ) = " toggleSelected ( object , $ event ) ; $ event . stopPropagation ( ) ; " >
< td >
< div class = "form-check" >
< input type = "checkbox" class = "form-check-input" id = "{{typeName}}{{object.id}}" [ checked ] = " selectedObjects . has ( object . id ) " ( click ) = " toggleSelected ( object ) ; $ event . stopPropagation ( ) ; " >
< label class = "form-check-label" for = "{{typeName}}{{object.id}}" > < / label >
< / div >
< / td >
2022-03-22 22:01:46 -07:00
< td scope = "row" > {{ object.name }}< / td >
2022-05-03 13:00:42 -07:00
< td scope = "row" class = "d-none d-sm-table-cell" > {{ getMatching(object) }}< / td >
2022-03-22 22:01:46 -07:00
< td scope = "row" > {{ object.document_count }}< / td >
< td scope = "row" * ngFor = "let column of extraColumns" >
< div * ngIf = "column.rendersHtml; else colValue" [ innerHtml ] = " column . valueFn . call ( null , object ) | safeHtml " > < / div >
< ng-template # colValue > {{ column.valueFn.call(null, object) }}< / ng-template >
< / td >
2020-10-27 01:10:18 +01:00
< td scope = "row" >
2022-05-03 13:00:42 -07:00
< div class = "btn-group d-block d-sm-none" >
< div ngbDropdown class = "d-inline-block" >
< button type = "button" class = "btn btn-link" id = "actionsMenuMobile" ngbDropdownToggle >
< svg class = "toolbaricon" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#three-dots-vertical" / >
< / svg >
< / button >
< div ngbDropdownMenu aria-labelledby = "actionsMenuMobile" >
2023-09-14 14:03:28 -07:00
< button ( click ) = " filterDocuments ( object ) " * pngxIfPermissions = "{ action: PermissionAction.View, type: PermissionType.Document }" ngbDropdownItem i18n > Filter Documents< / button >
< button ( click ) = " openEditDialog ( object ) " * pngxIfPermissions = "{ action: PermissionAction.Change, type: permissionType }" ngbDropdownItem i18n > Edit< / button >
< button class = "text-danger" ( click ) = " openDeleteDialog ( object ) " * pngxIfPermissions = "{ action: PermissionAction.Delete, type: permissionType }" ngbDropdownItem i18n > Delete< / button >
2022-05-03 13:00:42 -07:00
< / div >
< / div >
< / div >
< div class = "btn-group d-none d-sm-block" >
2023-09-19 13:40:21 -07:00
< button class = "btn btn-sm btn-outline-secondary" ( click ) = " filterDocuments ( object ) ; $ event . stopPropagation ( ) ; " * pngxIfPermissions = "{ action: PermissionAction.View, type: PermissionType.Document }" >
2023-05-27 23:16:33 -07:00
< svg class = "buttonicon-sm" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#filter" / >
2020-12-23 15:09:39 +01:00
< / svg > < ng-container i18n > Documents< / ng-container >
2020-12-16 02:12:58 +01:00
< / button >
2023-09-19 13:40:21 -07:00
< button class = "btn btn-sm btn-outline-secondary" ( click ) = " openEditDialog ( object ) ; $ event . stopPropagation ( ) ; " * pngxIfPermissions = "{ action: PermissionAction.Change, type: permissionType }" [ disabled ] = " ! userCanEdit ( object ) " >
2023-05-27 23:16:33 -07:00
< svg class = "buttonicon-sm" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#pencil" / >
2020-12-23 15:09:39 +01:00
< / svg > < ng-container i18n > Edit< / ng-container >
2020-12-16 02:12:58 +01:00
< / button >
2023-09-19 13:40:21 -07:00
< button class = "btn btn-sm btn-outline-danger" ( click ) = " openDeleteDialog ( object ) ; $ event . stopPropagation ( ) ; " * pngxIfPermissions = "{ action: PermissionAction.Delete, type: permissionType }" [ disabled ] = " ! userCanDelete ( object ) " >
2023-05-27 23:16:33 -07:00
< svg class = "buttonicon-sm" fill = "currentColor" >
< use xlink:href = "assets/bootstrap-icons.svg#trash" / >
2020-12-23 15:09:39 +01:00
< / svg > < ng-container i18n > Delete< / ng-container >
2020-12-16 02:12:58 +01:00
< / button >
2020-10-27 01:10:18 +01:00
< / div >
< / td >
< / tr >
< / tbody >
2021-06-13 10:48:46 -04:00
< / table >
2022-03-15 10:17:19 -07:00
2023-09-19 13:40:21 -07:00
< div class = "d-flex mb-2" * ngIf = "!isLoading" >
< div * ngIf = "collectionSize > 0" >
< ng-container i18n > {collectionSize, plural, =1 {One {{typeName}}} other {{{collectionSize || 0}} total {{typeNamePlural}}}}< / ng-container >
< ng-container * ngIf = "selectedObjects.size > 0" > ({{selectedObjects.size}} selected)< / ng-container >
< / div >
2023-05-03 19:37:36 -07:00
< ngb-pagination * ngIf = "collectionSize > 20" class = "ms-auto" [ pageSize ] = " 25 " [ collectionSize ] = " collectionSize " [ ( page ) ] = " page " [ maxSize ] = " 5 " ( pageChange ) = " reloadData ( ) " size = "sm" aria-label = "Pagination" > < / ngb-pagination >
2022-03-15 10:17:19 -07:00
< / div >