]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html
LP 2061136 follow-up: ng lint --fix
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / admin / server / print-template.component.html
1
2 <eg-title i18n-prefix prefix="Print Template Administration"></eg-title>
3 <eg-staff-banner bannerText="Print Template Administration" i18n-bannerText>
4 </eg-staff-banner>
5
6 <eg-fm-record-editor #editDialog idlClass="cpt" 
7     [preloadLinkedValues]="true" hiddenFields="template">
8 </eg-fm-record-editor>
9
10 <eg-confirm-dialog #confirmDelete
11   i18n-dialogTitle i18n-dialogBody
12   dialogTitle="Confirm Delete?"
13   dialogBody="Delete Template '{{template ? template.label() : ''}}'?">
14 </eg-confirm-dialog>
15
16 <div class="row mb-3">
17   <div class="col-lg-5">
18     <eg-org-family-select
19       [selectedOrgId]="initialOrg"
20       [limitPerms]="['ADMIN_PRINT_TEMPLATE']"
21       ariaLabel="Owner" i18n-ariaLabel
22       (ngModelChange)="orgOnChange($event)"
23       ngModel #orgFamily="ngModel">
24     </eg-org-family-select>
25   </div>
26   <div class="col-lg-4">
27     <div class="input-group">
28       <span class="input-group-text" i18n>Template</span>
29       <ng-template #entryTemplate let-r="result" let-owner="getOwnerName">
30         {{r.label}} ({{getOwnerName(r.id)}})
31       </ng-template>
32       <eg-combobox #templateSelector
33         [entries]="entries" [displayTemplate]="entryTemplate"
34         (onChange)="selectTemplate($event ? $event.id : null)">
35       </eg-combobox>
36     </div>
37   </div>
38   <div class="col-lg-3" *ngIf="localeEntries.length > 0">
39     <div class="input-group">
40       <span class="input-group-text" i18n>Locale</span>
41       <eg-combobox [entries]="localeEntries"
42         [startId]="localeCode"
43         (onChange)="localeOnChange($event ? $event.id : null)">
44       </eg-combobox>
45     </div>
46   </div>
47 </div>
48
49 <ng-container *ngIf="template">
50   <ul ngbNav #tabs="ngbNav" [(activeId)]="selectedTab" [destroyOnHide]="false"
51         (navChange)="onNavChange($event)" [keyboard]="true" [roles]="false" role="tablist" class="nav-tabs">
52   
53     <li role="presentation" [ngbNavItem]="'template'">
54       <a i18n ngbNavLink role="tab">Template</a>
55       <ng-template ngbNavContent>
56         <div class="row">
57           <div class="col-lg-12 mt-3 d-flex">
58             <button type="button" class="btn btn-info" (click)="openEditDialog()" i18n>
59               Edit Template Attributes
60             </button>
61             <button type="button" class="btn btn-success ms-2" (click)="applyChanges()" i18n>
62               Save Template Changes
63             </button>
64             <button type="button" class="btn btn-info ms-2" (click)="cloneTemplate()" i18n>
65               Clone Template
66             </button>
67             <span class="ms-3 me-1" i18n>Force Print Context:</span>
68             <eg-combobox #printContextCbox (onChange)="forceContextChange($event)">
69               <eg-combobox-entry entryId="unset" entryLabel="<Unset>" i18n-entryLabel>
70               </eg-combobox-entry>
71               <eg-combobox-entry entryId="default" entryLabel="Default" i18n-entryLabel>
72               </eg-combobox-entry>
73               <eg-combobox-entry entryId="receipt" entryLabel="Receipt" i18n-entryLabel>
74               </eg-combobox-entry>
75               <eg-combobox-entry entryId="label" entryLabel="Label" i18n-entryLabel>
76               </eg-combobox-entry>
77               <eg-combobox-entry entryId="mail" entryLabel="Mail" i18n-entryLabel>
78               </eg-combobox-entry>
79               <eg-combobox-entry entryId="offline" entryLabel="Offline" i18n-entryLabel>
80               </eg-combobox-entry>
81               <eg-combobox-entry entryId="no-print" entryLabel="No-Print" i18n-entryLabel>
82               </eg-combobox-entry>
83             </eg-combobox>
84             <div class="flex-1"> </div>
85             <button type="button" class="btn btn-danger ms-2" (click)="deleteTemplate()" i18n>
86               Delete Template
87             </button>
88             <span *ngIf="invalidJson" class="badge badge-danger ms-2" i18n>
89               Invalid Sample JSON!
90             </span>
91           </div>
92         </div>
93         <div class="row mt-2">
94           <div class="col-lg-6">
95             <h4 i18n>
96               Template for "{{template.label()}} ({{getOwnerName(template.id())}})"
97               <span class="ps-2 text-warning" *ngIf="template.active() === 'f'">
98                 (Inactive)
99               </span>
100             </h4>
101            <textarea rows="{{templateRowCount()}}" class="form-control"
102              spellcheck="false"
103              [ngModel]="template.template()"
104              (ngModelChange)="template.template($event); template.ischanged(true)">
105            </textarea>
106           </div>
107           <div class="col-lg-6">
108             <h4 i18n>Preview</h4>
109             <div class="border border-dark w-100" id="template-preview-pane">
110             </div>
111             <h4 class="mt-3" i18n>Compiled Content</h4>
112             <div class="border border-dark w-100">
113               <pre class="p-1">{{compiledContent}}</pre>
114             </div>
115           </div>
116         </div>
117       </ng-template>
118     </li>
119     <li role="presentation" [ngbNavItem]="'data'">
120       <a i18n ngbNavLink role="tab">Sample Data</a>
121       <ng-template ngbNavContent>
122         <textarea rows="20" [(ngModel)]="sampleJson" 
123           spellcheck="false" class="form-control">
124         </textarea>
125       </ng-template>
126     </li>
127   </ul>
128   
129   <div [ngbNavOutlet]="tabs" class="mt-2"></div>
130 </ng-container>