bfa2c0e3db8845170f316cf467f4e08c2d187ff1
[Evergreen.git] /
1 <ng-template #dialogContent>
2   <div class="modal-header bg-info">
3     <h4 class="modal-title" i18n>Edit Setting</h4>
4     <button type="button" class="close" 
5       i18n-aria-label aria-label="Close" (click)="close()">
6       <span aria-hidden="true">&times;</span>
7     </button>
8   </div>
9   <div class="modal-body">
10     <div class="row justify-content-center">
11       <div class="col">
12         <h5 i18n>{{entry.label}}</h5>
13       </div>
14     </div>
15     <div class="row justify-content-center">
16         <div class="col">
17             <span i18n [innerHTML]="entry.description"></span>
18         </div>
19     </div>
20     <div class="row mt-3">
21         <div class="col-md-6">
22             <div class="input-group">
23                 <div class="input-group-prepend">
24                     <div class="input-group-text" i18n>Context</div>
25                     <eg-org-select [initialOrg]="entryContext"
26                       (onChange)="entryContext = $event"></eg-org-select>
27                 </div>
28             </div>
29         </div>
30     </div>
31     <div class="row mt-2">
32         <div class="col-md-6">
33             <ng-container [ngSwitch]="inputType()">
34
35               <ng-container *ngSwitchCase="'integer'">
36                 <div class="input-group">
37                   <div class="input-group-prepend">
38                     <div class="input-group-text" i18n>Value</div>
39                     <input
40                       class="form-control" type="number"
41                       name="entryValue"
42                       placeholder="Input a numerical value"
43                       i18n-placeholder
44                       [(ngModel)]="entryValue"/>
45                   </div>
46                 </div>
47               </ng-container>
48               <ng-container *ngSwitchCase="'currency'">
49                 <div class="input-group">
50                   <div class="input-group-prepend">
51                     <div class="input-group-text" i18n>Value</div>
52                     <div class="input-group-text" i18n>$</div>
53                     <input
54                       class="form-control" type="number"
55                       step="0.01"
56                       name="entryValue"
57                       placeholder="Input a monetary value"
58                       i18n-placeholder
59                       [(ngModel)]="entryValue"/>
60                   </div>
61                 </div>
62               </ng-container>
63               <ng-container *ngSwitchCase="'string'">
64                 <div class="input-group">
65                   <div class="input-group-prepend">
66                     <div class="input-group-text" i18n>Value</div>
67                     <input
68                       class="form-control" type="text"
69                       name="entryValue"
70                       placeholder="Input a value"
71                       i18n-placeholder
72                       [(ngModel)]="entryValue"/>
73                   </div>
74                 </div>
75               </ng-container>
76               <ng-container *ngSwitchCase="'interval'">
77                 <div class="input-group">
78                   <div class="input-group-prepend">
79                     <div class="input-group-text" i18n>Value</div>
80                     <input
81                       class="form-control" type="text"
82                       name="entryValue"
83                       placeholder="e.g. 1 day, 4 months"
84                       i18n-placeholder
85                       [(ngModel)]="entryValue"/>
86                   </div>
87                 </div>
88               </ng-container>
89               <ng-container *ngSwitchCase="'bool'">
90                 <div class="input-group">
91                   <div class="input-group-prepend">
92                     <div class="input-group-text" i18n>Value</div>
93                     <select
94                       class="custom-select" name="entryValue"
95                       placeholder="True or False" i18n-placeholder
96                       [(ngModel)]="entryValue">
97                       <option value='true' i18n>True</option>
98                       <option value='false' i18n>False</option>
99                     </select>
100                   </div>
101                 </div>
102               </ng-container>
103               <ng-container *ngSwitchCase="'array'">
104                 <div class="input-group">
105                   <div class="input-group-prepend">
106                     <div class="input-group-text" i18n>Value</div>
107                     <input
108                       class="form-control" type="text"
109                       name="entryValue"
110                       placeholder="Input a comma-separated list..."
111                       i18n-placeholder
112                       [(ngModel)]="entryValue"/>
113                   </div>
114                 </div>
115               </ng-container>
116               <ng-container *ngSwitchCase="'link'">
117                 <div class="input-group">
118                   <div class="input-group-prepend">
119                     <div class="input-group-text" i18n>Value</div>
120                       <ng-container [ngSwitch]="entry.fmClass">
121                         <ng-container *ngSwitchCase="'acpl'">
122                           <eg-item-location-select [permFilter]="entry.view_perm"
123                             [contextOrgId]="entryContext" (valueChange)="setInputValue($event ? $event.id() : null)">
124                           </eg-item-location-select>
125                         </ng-container>
126                         <ng-container *ngSwitchDefault>
127                           <eg-combobox placeholder="Select a value" [idlClass]="entry.fmClass" idlField="name"
128                             [asyncSupportsEmptyTermClick]="true" [displayTemplate]="fmClassLabel"
129                             (onChange)="setInputValue($event ? $event.id : null)">
130                           </eg-combobox>
131                         </ng-container>
132                       </ng-container><!-- fmClass ngSwitch -->
133                   </div>
134                 </div>
135               </ng-container>
136
137             </ng-container> <!-- input type ngSwitch -->
138         </div>
139     </div>
140   </div>
141   <div class="modal-footer">
142     <button type="button" class="btn btn-success" 
143       (click)="update()" i18n>Update Setting</button>
144     <button type="button" class="btn btn-warning" 
145       (click)="delete()" i18n>Delete Setting</button>
146   </div>
147 </ng-template>
148
149 <ng-template #fmClassLabel let-r="result" i18n>
150   {{r.label}}
151 </ng-template>