Skip to content

Commit

Permalink
fix(templates): incorrect menu display
Browse files Browse the repository at this point in the history
* Changes the position of the load template.
* Changes the label of submit button to load.
* Fixes translation of form buttons.

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Feb 11, 2025
1 parent 8d35767 commit 0d51b13
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
36 changes: 17 additions & 19 deletions projects/rero/ng-core/src/lib/record/editor/editor.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
RERO angular core
Copyright (C) 2020-2024 RERO
Copyright (C) 2020-2025 RERO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand All @@ -26,40 +26,38 @@
</legend>
}
</div>
<div class="flex align-items-center justify-content-end">
<div class="flex align-items-center justify-content-end gap-1">
<!-- load from template button -->
@if (canLoadTemplate()) {
<p-button
id="editor-load-template-button"
[label]="'Load template…' | translate"
[outlined]="true"
icon="fa fa-upload"
(onClick)="showLoadTemplateDialog()"
/>
}
<!-- cancel button -->
<p-button
id="editor-cancel-button"
[label]="'Cancel' | translate"
icon="fa fa-times"
[outlined]="true"
severity="danger"
(onClick)="cancel()" />
<!-- load from template button -->
@if (canLoadTemplate()) {
<p-button
id="editor-load-template-button"
[label]="'Load template…' | translate"
id="editor-cancel-button"
[label]="'Cancel' | translate"
icon="fa fa-times"
[outlined]="true"
icon="fa fa-upload"
styleClass="ml-1"
(onClick)="showLoadTemplateDialog()"
severity="danger"
(onClick)="cancel()"
/>
}
<!-- save button -->
@if (saveAlternatives.length === 0) {
<p-button
id="editor-save-button"
[label]="'Save' | translate"
styleClass="ml-1"
(onClick)="submit()"
[disabled]="isSaveButtonDisabled"
/>
} @else {
<p-splitButton
id="editor-save-button-split"
[label]="'Save' | translate"
styleClass="ml-1"
(onClick)="submit()"
[model]="saveAlternatives"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ <h4 class="text-error" translate>Warning!</h4>
<div class="my-1 font-bold" translate>Select a template</div>
<formly-form [form]="form" [fields]="formFields" [model]="model"></formly-form>
<div class="flex justify-content-end gap-2">
<p-button label="Cancel" severity="secondary" (onClick)="closeDialog()" />
<p-button type="submit" label="Save" [disabled]="this.form.status !== 'VALID'" />
<p-button [label]="'Cancel'|translate" severity="secondary" (onClick)="closeDialog()" />
<p-button type="submit" [label]="'Load'|translate" [disabled]="this.form.status !== 'VALID'" />
</div>
</form>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* RERO angular core
* Copyright (C) 2020-2024 RERO
* Copyright (C) 2020-2025 RERO
* Copyright (C) 2020-2023 UCLouvain
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -59,6 +59,7 @@ export class LoadTemplateFormComponent implements OnInit {
key: 'template',
type: 'select',
props: {
appendTo: 'body',
required: true,
options: [],
attributes: {
Expand Down

0 comments on commit 0d51b13

Please sign in to comment.