2 <eg-title i18n-prefix prefix="Print Template Administration"></eg-title>
3 <eg-staff-banner bannerText="Print Template Administration" i18n-bannerText>
6 <eg-fm-record-editor #editDialog idlClass="cpt"
7 [preloadLinkedValues]="true" hiddenFields="template">
10 <eg-confirm-dialog #confirmDelete
11 i18n-dialogTitle i18n-dialogBody
12 dialogTitle="Confirm Delete?"
13 dialogBody="Delete Template '{{template ? template.label() : ''}}'?">
16 <div class="row mb-3">
17 <div class="col-lg-4">
19 [selectedOrgId]="initialOrg"
20 [limitPerms]="['ADMIN_PRINT_TEMPLATE']"
21 labelText="Owner" i18n-labelText
22 (ngModelChange)="orgOnChange($event)"
23 ngModel #orgFamily="ngModel">
24 </eg-org-family-select>
26 <div class="col-lg-3">
27 <div class="input-group">
28 <div class="input-group-prepend">
29 <span class="input-group-text" i18n>Template</span>
31 <ng-template #entryTemplate let-r="result" let-owner="getOwnerName">
32 {{r.label}} ({{getOwnerName(r.id)}})
34 <eg-combobox #templateSelector
35 [entries]="entries" [displayTemplate]="entryTemplate"
36 (onChange)="selectTemplate($event ? $event.id : null)">
40 <div class="col-lg-3" *ngIf="localeEntries.length > 0">
41 <div class="input-group">
42 <div class="input-group-prepend">
43 <span class="input-group-text" i18n>Locale</span>
45 <eg-combobox [entries]="localeEntries"
46 [startId]="localeCode"
47 (onChange)="localeOnChange($event ? $event.id : null)">
53 <ngb-tabset *ngIf="template" #tabs (tabChange)="onTabChange($event)">
54 <ngb-tab title="Template" i18n-title id='template'>
55 <ng-template ngbTabContent>
57 <div class="col-lg-12 mt-3 d-flex">
58 <button class="btn btn-info" (click)="openEditDialog()" i18n>
59 Edit Template Attributes
61 <button class="btn btn-success ml-2" (click)="applyChanges()" i18n>
64 <button class="btn btn-info ml-2" (click)="cloneTemplate()" i18n>
67 <span class="ml-3 mr-1" i18n>Force Print Context:</span>
68 <eg-combobox #printContextCbox (onChange)="forceContextChange($event)">
69 <eg-combobox-entry entryId="unset" entryLabel="<Unset>" i18n-entryLabel>
71 <eg-combobox-entry entryId="default" entryLabel="Default" i18n-entryLabel>
73 <eg-combobox-entry entryId="receipt" entryLabel="Receipt" i18n-entryLabel>
75 <eg-combobox-entry entryId="label" entryLabel="Label" i18n-entryLabel>
77 <eg-combobox-entry entryId="mail" entryLabel="Mail" i18n-entryLabel>
79 <eg-combobox-entry entryId="offline" entryLabel="Offline" i18n-entryLabel>
81 <eg-combobox-entry entryId="no-print" entryLabel="No-Print" i18n-entryLabel>
84 <div class="flex-1"> </div>
85 <button class="btn btn-danger ml-2" (click)="deleteTemplate()" i18n>
88 <span *ngIf="invalidJson" class="badge badge-danger ml-2" i18n>
93 <div class="row mt-2">
94 <div class="col-lg-6">
96 Template for "{{template.label()}} ({{getOwnerName(template.id())}})"
97 <span class="pl-2 text-warning" *ngIf="template.active() == 'f'">
101 <textarea rows="{{templateRowCount()}}" class="form-control"
103 [ngModel]="template.template()"
104 (ngModelChange)="template.template($event); template.ischanged(true)">
107 <div class="col-lg-6">
108 <h4 i18n>Preview</h4>
109 <div class="border border-dark w-100" id="template-preview-pane">
111 <h4 class="mt-3" i18n>Compiled Content</h4>
112 <div class="border border-dark w-100">
113 <pre class="p-1">{{compiledContent}}</pre>
119 <ngb-tab title="Sample Data" i18n-title id='data'>
120 <ng-template ngbTabContent>
121 <textarea rows="20" [(ngModel)]="sampleJson"
122 spellcheck="false" class="form-control">