<eg-staff-banner bannerText="Print Template Administration" i18n-bannerText>
</eg-staff-banner>
+<eg-fm-record-editor #editDialog idlClass="cpt"
+ [preloadLinkedValues]="true" hiddenFields="template">
+</eg-fm-record-editor>
+
+
<div class="row mb-3">
<div class="col-lg-3">
<div class="input-group">
</div>
<ngb-tabset *ngIf="template" #tabs (tabChange)="onTabChange($event)">
- <ngb-tab title="Template Info" i18n-title id='info'>
- <ng-template ngbTabContent>
- </ng-template>
- </ngb-tab>
<ngb-tab title="Template" i18n-title id='template'>
<ng-template ngbTabContent>
<div class="row">
- <div class="col-lg-6 d-flex justify-content-end mt-3">
- <button class="btn btn-success" (click)="applyChanges()" i18n>
- Save and Refresh
+ <div class="col-lg-6 mt-3">
+ <button class="btn btn-success" (click)="openEditDialog()" i18n>
+ Edit Template Attributes
+ </button>
+ <button class="btn btn-info ml-2" (click)="applyChanges()" i18n>
+ Save Template and Refresh Preview
</button>
</div>
</div>
import {PrintService} from '@eg/share/print/print.service';
import {LocaleService} from '@eg/core/locale.service';
import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
const SAMPLE_JSON_DATA: any = {
patron: {
@ViewChild('templateSelector') templateSelector: ComboboxComponent;
@ViewChild('tabs') tabs: NgbTabset;
+ @ViewChild('editDialog') editDialog: FmRecordEditorComponent;
// Define some sample data that can be used for various templates
const data = SAMPLE_TEMPLATE_DATA[t.name()];
if (data) {
this.sampleJson = JSON.stringify(data, null, 2);
+ this.refreshPreview();
}
});
}
this.pcrud.update(this.template).toPromise()
.then(() =>this.refreshPreview());
}
+
+ openEditDialog() {
+ // TODO: PENDING EXTERNAL FIXES
+ //this.editDialog.record = this.template;
+ this.editDialog.recordId = this.template.id();
+ this.editDialog.mode = 'update';
+ this.editDialog.open({size: 'lg'});
+ }
}