Lines 83-93
Link Here
|
83 |
<legend>Rule <span class="rulecount">[% loop.count | html %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash-can"></i> Remove this rule</a></legend> |
83 |
<legend>Rule <span class="rulecount">[% loop.count | html %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash-can"></i> Remove this rule</a></legend> |
84 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
84 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
85 |
<div class="age"> |
85 |
<div class="age"> |
86 |
<h5>Age in days</h5> |
86 |
<h5>Age</h5> |
87 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" /> |
87 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" /> |
|
|
88 |
<h5>Age unit</h5> |
89 |
<div class="block"> |
90 |
<select name="ageunit_[% id | html %]"> |
91 |
<option value="">Choose an age unit</option> |
92 |
[% FOR unit IN ageunits %] |
93 |
[% IF rule.ageunit == unit %] |
94 |
<option value="[% unit | html %]" selected="selected">[% unit | html %]</option> |
95 |
[% ELSE %] |
96 |
<option value="[% unit | html %]">[% unit | html %]</option> |
97 |
[% END %] |
98 |
[% END %] |
99 |
</select> |
100 |
<span class="hint">Only the items.damaged_on, items.itemlost_on and items.withdrawn_on age fields can use the 'Hours unit. If not set then days will be used.</span> |
101 |
</div> |
102 |
|
88 |
<h5>Age field</h5> |
103 |
<h5>Age field</h5> |
89 |
<div class="blocks"> |
104 |
<div class="blocks"> |
90 |
<select name="agefield_[% id | html %]"> |
105 |
<select name="agefield_[% id | html %]" onchange="unit_display()"> |
91 |
<option value="">Choose an age field</option> |
106 |
<option value="">Choose an age field</option> |
92 |
[% FOR field IN agefields %] |
107 |
[% FOR field IN agefields %] |
93 |
[% IF rule.agefield == field %] |
108 |
[% IF rule.agefield == field %] |
Lines 158-168
Link Here
|
158 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash-can"></i> Remove this rule</a></legend> |
173 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash-can"></i> Remove this rule</a></legend> |
159 |
<input type="hidden" name="unique_id" /> |
174 |
<input type="hidden" name="unique_id" /> |
160 |
<div class="age"> |
175 |
<div class="age"> |
161 |
<h5>Age in days</h5> |
176 |
<h5>Age</h5> |
162 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" /> |
177 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" /> |
|
|
178 |
<h5>Age unit</h5> |
179 |
<div class="block"> |
180 |
<select name="ageunit"> |
181 |
<option value="">Choose an age unit</option> |
182 |
[% FOR unit IN ageunits %] |
183 |
<option value="[% unit | html %]">[% unit | html %]</option> |
184 |
[% END %] |
185 |
</select> |
186 |
<span class="hint">Only items.damaged_on, items.itemlost_on and items.withdrawn_on age fields can use the 'Hours' unit. If not set then days will be used.</span> |
187 |
</div> |
163 |
<h5>Age field</h5> |
188 |
<h5>Age field</h5> |
164 |
<div class="block"> |
189 |
<div class="block"> |
165 |
<select name="agefield"> |
190 |
<select name="agefield" onchange="unit_display()"> |
166 |
<option value="">Choose an age field</option> |
191 |
<option value="">Choose an age field</option> |
167 |
[% FOR field IN agefields %] |
192 |
[% FOR field IN agefields %] |
168 |
<option value="[% field | html %]">[% field | html %]</option> |
193 |
<option value="[% field | html %]">[% field | html %]</option> |
Lines 212-217
Link Here
|
212 |
<thead> |
237 |
<thead> |
213 |
<tr> |
238 |
<tr> |
214 |
<th>Age</th> |
239 |
<th>Age</th> |
|
|
240 |
<th>Age unit</th> |
215 |
<th>Age field</th> |
241 |
<th>Age field</th> |
216 |
<th>Conditions</th> |
242 |
<th>Conditions</th> |
217 |
<th>Substitutions</th> |
243 |
<th>Substitutions</th> |
Lines 222-232
Link Here
|
222 |
<tr> |
248 |
<tr> |
223 |
<td> |
249 |
<td> |
224 |
[% IF rule.age.defined and rule.age.length > 0 %] |
250 |
[% IF rule.age.defined and rule.age.length > 0 %] |
225 |
<span>[% rule.age | html %] days</span> |
251 |
<span>[% rule.age | html %]</span> |
226 |
[% ELSE %] |
252 |
[% ELSE %] |
227 |
<span>There is no age for this rule.</span> |
253 |
<span>There is no age for this rule.</span> |
228 |
[% END %] |
254 |
[% END %] |
229 |
</td> |
255 |
</td> |
|
|
256 |
<td> |
257 |
[% IF rule.ageunit %] |
258 |
[% rule.ageunit | html %] |
259 |
[% ELSE %] |
260 |
<!-- In case old rules do not contain an ageunit value display that 'Days' will be used --> |
261 |
Days |
262 |
[% END %] |
263 |
</td> |
230 |
<td> |
264 |
<td> |
231 |
[% IF rule.agefield %] |
265 |
[% IF rule.agefield %] |
232 |
[% rule.agefield | html %] |
266 |
[% rule.agefield | html %] |