</eg-combobox>
</div>
<div class="col-lg-6">
- <button class="btn btn-success"
+ <button class="btn btn-success" *ngIf="!templateInputMatch"
[disabled]="!selectedTemplate"
(click)="saveTemplate()" i18n>Save As New Template</button>
+ <button class="btn btn-success" *ngIf="templateInputMatch"
+ [disabled]="!selectedTemplate"
+ (click)="saveTemplate()" i18n>Modify Template</button>
<button class="btn btn-outline-primary ml-3"
[disabled]="!selectedTemplate"
(click)="markTemplateDefault()" i18n>Mark Template as Default</button>
</div>
</div>
<div class="row">
- <div class="col-lg-6 offset-lg-3">
+ <div class="col-lg-6 offset-lg-3" *ngIf="!importSelection()">
<button class="btn btn-success btn-lg btn-block font-weight-bold"
[disabled]="isUploading || !hasNeededData()"
(click)="upload()" i18n>Upload</button>
</div>
+ <div class="col-lg-6 offset-lg-3" *ngIf="importSelection()">
+ <button class="btn btn-success btn-lg btn-block font-weight-bold"
+ [disabled]="isUploading || !hasNeededData()"
+ (click)="upload()" i18n>Import</button>
+ </div>
</div>
<!-- hide instead of *ngIf so ViewChild can find the progress bars -->
<div class="row" [hidden]="!showProgress || importSelection()">
selectedTemplate: string;
formTemplates: {[name: string]: any};
newTemplateName: string;
+ templateInputMatch: boolean;
@ViewChild('fileSelector') private fileSelector;
@ViewChild('uploadProgress')
console.debug('Saving import profile', template);
this.formTemplates[this.selectedTemplate] = template;
+ this.templateInputMatch = true;
return this.store.setItem(TEMPLATE_SETTING_NAME, this.formTemplates);
}
this.selectedTemplate = entry.label; // label == name
if (entry.freetext) {
+ this.templateInputMatch = false;
// User is entering a new template name.
// Nothing to apply.
return;
}
// User selected an existing template, apply it to the form.
-
+ this.templateInputMatch = true;
const template = this.formTemplates[entry.id];
// Copy the template values into "this"