Project

General

Profile

1
<p-fieldset legend="Results"
2
            [toggleable]="_searchResultsPage?.data !== null"
3
            [collapsed]="_searchResultsPage?.data === null">
4
  <p-confirmDialog message="{{'DELETE-MESSAGE-TEMPLATE' | translate}}"
5
                   header="{{'DELETE-CONFIRMATION' | translate}}"
6
                   acceptLabel="{{'ACCEPT_LABEL' | translate}}"
7
                   rejectLabel="{{'REJECT_LABEL' | translate}}"
8
                   acceptButtonStyleClass="p-button-primary"
9
                   rejectButtonStyleClass="p-button-warning"
10
                   acceptIcon="null"
11
                   rejectIcon="null">
12
  </p-confirmDialog>
13
  <p-table [value]="_searchResultsPage?.data"
14
           [lazy]="true"
15
           (onLazyLoad)="onLazyLoad($event)"
16
           [paginator]="true"
17
           [rows]="rows"
18
           [totalRecords]="totalRecords"
19
           styleClass="p-datatable-gridlines"
20
           [rowHover]="true"
21
           [loading]="loading"
22
           [autoLayout]="true">
23
    <ng-template pTemplate="header">
24
      <tr>
25
        <th>Document Classification</th>
26
        <th>iPower Client Name</th>
27
        <th>iPower Client Code</th>
28
        <th>Category Name</th>
29
        <th>Sub-Classification Name</th>
30
        <th>ABBYY Template Code</th>
31
        <!-- TODO: Fix hacky way of locking the icon-columns in place -->
32
        <th class="two-buttons">Actions</th>
33
      </tr>
34
    </ng-template>
35
    <ng-template pTemplate="body" let-template>
36
      <tr>
37
        <td>{{template.documentClassification.classificationName}}</td>
38
        <td>{{template.client.name}}</td>
39
        <td>{{template.client.clientCode}}</td>
40
        <td>{{template.category.categoryName}}</td>
41
        <td>{{template.subCategoryCode}}</td>
42
        <td>{{template.abbyyTemplate}}</td>
43
        <!-- Edit & Delete icons -->
44
        <td>
45
          <button pButton [disabled]="!canEditTemplates()" (click)="edit(template)" icon="pi pi-pencil" pTooltip="{{'EDIT-TEMPLATE' | translate}}"
46
            class="p-button-secondary p-button-rounded p-button-outlined">
47
          </button>
48
          <button pButton [disabled]="!canDeleteTemplates()" (click)="delete(template)" icon="pi pi pi-trash" pTooltip="{{'DELETE-TEMPLATE' | translate}}"
49
            class="p-button-danger p-button-rounded p-button-outlined p-ml-2">
50
          </button>
51
        </td>
52
      </tr>
53
    </ng-template>
54
  </p-table>
55
</p-fieldset>
56

    
57
<app-create-template-dialog [displayDialog]="displayEditTemplateDialog"
58
                            [header]="header"
59
                            (cancelled)="cancelEditTemplate()"
60
                            [templateToEdit]="templateToEdit"
61
                            (valueChange)="passEvent($event)">
62
</app-create-template-dialog>
(1-1/4)