Show sources on template list, update some translation strings Make filters and minor testing
36 lines
2.1 KiB
HTML
36 lines
2.1 KiB
HTML
<pngx-page-header title="Consumption Templates">
|
|
<button type="button" class="btn btn-sm btn-outline-primary ms-4" (click)="editTemplate()" *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.ConsumptionTemplate }">
|
|
<svg class="sidebaricon me-1" fill="currentColor">
|
|
<use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
|
|
</svg>
|
|
<ng-container i18n>Add Template</ng-container>
|
|
</button>
|
|
</pngx-page-header>
|
|
|
|
<table class="table table-striped align-middle border shadow-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" i18n>Name</th>
|
|
<th scope="col" i18n>Document Sources</th>
|
|
<th scope="col" i18n>File name filter</th>
|
|
<th scope="col" i18n>Path filter</th>
|
|
<th scope="col" i18n>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr *ngFor="let template of templates">
|
|
<td scope="row"><button class="btn btn-link p-0" type="button" (click)="editTemplate(template)" [disabled]="!permissionsService.currentUserCan(PermissionAction.Change, PermissionType.ConsumptionTemplate)">{{template.name}}</button></td>
|
|
<td scope="row">{{getSourceList(template)}}</td>
|
|
<td scope="row"><code>{{template.filter_filename}}</code></td>
|
|
<td scope="row"><code>{{template.filter_path}}</code></td>
|
|
<td scope="row">
|
|
<div class="btn-group">
|
|
<button *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.ConsumptionTemplate }" [disabled]="!userCanEdit(template)" class="btn btn-sm btn-primary" type="button" (click)="editTemplate(template)" i18n>Edit</button>
|
|
<button *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.ConsumptionTemplate }" [disabled]="!userIsOwner(template)" class="btn btn-sm btn-outline-danger" type="button" (click)="deleteTemplate(template)" i18n>Delete</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div *ngIf="templates.length === 0" i18n>No templates defined.</div>
|