uoa-repository-manager-service/app/features/administration/categories-management/categories-search-results/categories-search-results.c...

65 lines
2.6 KiB
HTML

<p-fieldset legend="Results"
[toggleable]="_searchResultsPage?.data !== null"
[collapsed]="_searchResultsPage?.data === null">
<p-confirmDialog message="{{'DELETE-MESSAGE-CATEGORY' | translate}}"
header="{{'DELETE-CONFIRMATION' | translate}}"
acceptLabel="{{'ACCEPT_LABEL' | translate}}"
rejectLabel="{{'REJECT_LABEL' | translate}}"
acceptButtonStyleClass="p-button-primary"
rejectButtonStyleClass="p-button-warning"
acceptIcon="null"
rejectIcon="null">
</p-confirmDialog>
<p-table [value]="_searchResultsPage?.data"
[lazy]="true"
(onLazyLoad)="onLazyLoad($event)"
[paginator]="true"
[rows]="rows"
[totalRecords]="totalRecords"
styleClass="p-datatable-gridlines"
[rowHover]="true"
[loading]="loading"
[autoLayout]="true">
<ng-template pTemplate="header">
<tr>
<th>Document Classification</th>
<th>Category Name</th>
<th>Category Code</th>
<!-- TODO: Fix hacky way of locking the icon-columns in place -->
<th class="two-buttons">Actions</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-category>
<tr>
<td>{{category.documentClassification.classificationName}}</td>
<td>{{category.categoryName}}</td>
<td>{{category.categoryCode}}</td>
<!-- Edit & Delete icons -->
<td>
<button pButton
[disabled]="!canEditCategories()"
(click)="edit(category)"
icon="pi pi-pencil"
pTooltip="{{'EDIT-CATEGORY' | translate}}"
class="p-button-secondary p-button-rounded p-button-outlined">
</button>
<button pButton
[disabled]="!canDeleteCategories()"
(click)="delete(category)"
icon="pi pi pi-trash"
pTooltip="{{'DELETE-CATEGORY' | translate}}"
class="p-button-danger p-button-rounded p-button-outlined p-ml-2">
</button>
</td>
</tr>
</ng-template>
</p-table>
</p-fieldset>
<app-create-category-dialog [displayDialog]="displayEditCategoryDialog"
[header]="header"
(cancelled)="cancelEditCategory()"
[categoryToEdit]="categoryToEdit"
(valueChange)="passEvent($event)">
</app-create-category-dialog>