1459072eb6abe1f6c712e48725e8e30221ba4f83
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / staff / admin / acq / currency / exchange-rates-dialog.component.html
1 <eg-string #successString i18n-text text="Exchange Rates Update Succeeded"></eg-string>
2 <eg-string #updateFailedString i18n-text text="Exchange Rates Update Failed"></eg-string>
3
4 <ng-template #dialogContent>
5   <div class="modal-header bg-info" *ngIf="doneLoading">
6     <h3 *ngIf="canUpdate" class="modal-title" i18n>Manage Exchange Rates for {{currency.code()}}: {{currency.label()}}</h3>
7     <h3 *ngIf="!canUpdate" class="modal-title" i18n>View Exchange Rates for {{currency.code()}}: {{currency.label()}}</h3>
8     <button type="button" class="close"
9       i18n-aria-label aria-label="Close" (click)="close()">
10       <span aria-hidden="true">&times;</span>
11     </button>
12   </div>
13   <div class="modal-body" [hidden]="!doneLoading">
14     <h4 i18n>Exchange rates to other currencies: 1 {{currency?.label()}} is equal to:</h4>
15     <div *ngIf="otherCurrencies?.length < 1" class="alert alert-warning" i18n>
16       No other currencies are currently defined, so cannot set any exchange rates.
17     </div>
18     <form #exrForm="ngForm" role="form" [hidden]="otherCurrencies?.length < 1" class="form-validated">
19       <div class="form-group row mt-2" *ngFor="let ratio of ratios">
20         <label for="exr-{{ratio.to_currency().code()}}" class="col-sm-4 col-form-label">
21           {{ratio.to_currency().code()}} ({{ratio.to_currency().label()}})
22         </label>
23         <div class="col-sm-3">
24           <input *ngIf="canUpdate" class="form-control" type="number" id="exr-{{ratio.to_currency().code()}}"
25             [disabled]="ratio.id() === -1"
26             [ngModel]="ratio.ratio()" name="ratio_{{ratio.to_currency().code()}}"
27             (ngModelChange)="ratio.ratio($event)">
28           <span class="form-control-plaintext" *ngIf="!canUpdate">
29             <ng-container *ngIf="ratio.ratio() !== undefined">{{ratio.ratio()}}</ng-container>
30             <ng-container *ngIf="ratio.ratio() === undefined" i18n>not set</ng-container>
31           </span>
32         </div>
33         <div class="col-sm-3">
34           <span *ngIf="ratio.id() === -1" class="alert-warning" i18n>(inverse; go to other currency to change)</span>
35         </div>
36       </div>
37     </form>
38   </div>
39   <div class="modal-footer">
40     <ng-container *ngIf="canUpdate">
41       <button type="button" class="btn btn-info" [disabled]="!(exrForm?.dirty)"
42         (click)="save()" i18n>Save</button>
43       </ng-container>
44     <button type="button" class="btn btn-warning" *ngIf="canUpdate"
45       (click)="close()" i18n>Cancel</button>
46     <button type="button" class="btn btn-warning" *ngIf="!canUpdate"
47       (click)="close()" i18n>Close</button>
48   </div>
49 </ng-template>