|
Lines 89-99
Link Here
|
| 89 |
<legend>Rule <span class="rulecount">[% loop.count | html %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
89 |
<legend>Rule <span class="rulecount">[% loop.count | html %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
| 90 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
90 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
| 91 |
<div class="age"> |
91 |
<div class="age"> |
| 92 |
<h5>Age in days</h5> |
92 |
<h5>Age</h5> |
| 93 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" /> |
93 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" /> |
|
|
94 |
<h5>Age unit</h5> |
| 95 |
<div class="block"> |
| 96 |
<select name="ageunit_[% id | html %]"> |
| 97 |
<option value="">Choose an age unit</option> |
| 98 |
[% FOR unit IN ageunits %] |
| 99 |
[% IF rule.ageunit == unit %] |
| 100 |
<option value="[% unit | html %]" selected="selected">[% unit | html %]</option> |
| 101 |
[% ELSE %] |
| 102 |
<option value="[% unit | html %]">[% unit | html %]</option> |
| 103 |
[% END %] |
| 104 |
[% END %] |
| 105 |
</select> |
| 106 |
<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> |
| 107 |
</div> |
| 108 |
|
| 94 |
<h5>Age field</h5> |
109 |
<h5>Age field</h5> |
| 95 |
<div class="blocks"> |
110 |
<div class="blocks"> |
| 96 |
<select name="agefield_[% id | html %]"> |
111 |
<select name="agefield_[% id | html %]" onchange="unit_display()"> |
| 97 |
<option value="">Choose an age field</option> |
112 |
<option value="">Choose an age field</option> |
| 98 |
[% FOR field IN agefields %] |
113 |
[% FOR field IN agefields %] |
| 99 |
[% IF rule.agefield == field %] |
114 |
[% IF rule.agefield == field %] |
|
Lines 164-174
Link Here
|
| 164 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
179 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
| 165 |
<input type="hidden" name="unique_id" /> |
180 |
<input type="hidden" name="unique_id" /> |
| 166 |
<div class="age"> |
181 |
<div class="age"> |
| 167 |
<h5>Age in days</h5> |
182 |
<h5>Age</h5> |
| 168 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" /> |
183 |
<input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" /> |
|
|
184 |
<h5>Age unit</h5> |
| 185 |
<div class="block"> |
| 186 |
<select name="ageunit"> |
| 187 |
<option value="">Choose an age unit</option> |
| 188 |
[% FOR unit IN ageunits %] |
| 189 |
<option value="[% unit | html %]">[% unit | html %]</option> |
| 190 |
[% END %] |
| 191 |
</select> |
| 192 |
<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> |
| 193 |
</div> |
| 169 |
<h5>Age field</h5> |
194 |
<h5>Age field</h5> |
| 170 |
<div class="block"> |
195 |
<div class="block"> |
| 171 |
<select name="agefield"> |
196 |
<select name="agefield" onchange="unit_display()"> |
| 172 |
<option value="">Choose an age field</option> |
197 |
<option value="">Choose an age field</option> |
| 173 |
[% FOR field IN agefields %] |
198 |
[% FOR field IN agefields %] |
| 174 |
<option value="[% field | html %]">[% field | html %]</option> |
199 |
<option value="[% field | html %]">[% field | html %]</option> |
|
Lines 216-221
Link Here
|
| 216 |
<thead> |
241 |
<thead> |
| 217 |
<tr> |
242 |
<tr> |
| 218 |
<th>Age</th> |
243 |
<th>Age</th> |
|
|
244 |
<th>Age unit</th> |
| 219 |
<th>Age field</th> |
245 |
<th>Age field</th> |
| 220 |
<th>Conditions</th> |
246 |
<th>Conditions</th> |
| 221 |
<th>Substitutions</th> |
247 |
<th>Substitutions</th> |
|
Lines 226-236
Link Here
|
| 226 |
<tr> |
252 |
<tr> |
| 227 |
<td> |
253 |
<td> |
| 228 |
[% IF rule.age.defined and rule.age.length > 0 %] |
254 |
[% IF rule.age.defined and rule.age.length > 0 %] |
| 229 |
<span>[% rule.age | html %] days</span> |
255 |
<span>[% rule.age | html %]</span> |
| 230 |
[% ELSE %] |
256 |
[% ELSE %] |
| 231 |
<span>There is no age for this rule.</span> |
257 |
<span>There is no age for this rule.</span> |
| 232 |
[% END %] |
258 |
[% END %] |
| 233 |
</td> |
259 |
</td> |
|
|
260 |
<td> |
| 261 |
[% IF rule.ageunit %] |
| 262 |
[% rule.ageunit | html %] |
| 263 |
[% ELSE %] |
| 264 |
<!-- In case old rules do not contain an ageunit value display that 'Days' will be used --> |
| 265 |
Days |
| 266 |
[% END %] |
| 267 |
</td> |
| 234 |
<td> |
268 |
<td> |
| 235 |
[% IF rule.agefield %] |
269 |
[% IF rule.agefield %] |
| 236 |
[% rule.agefield | html %] |
270 |
[% rule.agefield | html %] |