Lines 71-80
Link Here
|
71 |
<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> |
71 |
<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> |
72 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
72 |
<input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled --> |
73 |
<div class="age"> |
73 |
<div class="age"> |
74 |
<h5>Age in days</h5> |
74 |
<h5>Age</h5> |
75 |
<input class="age" type="number" value="[% rule.age | html %]" name="age_[% id | html %]" /> |
75 |
<input class="age" type="number" value="[% rule.age %]" name="age_[% id %]" /> |
76 |
</div> |
76 |
</div> |
77 |
<div class="blocks"> |
77 |
<div> |
|
|
78 |
<h5>Unit</h5> |
79 |
<p>Note: If the unit of 'Hours' is set then you cannot choose an age starting point, the item age starting point will default to the last item alteration event. The Age starting point selection will be hidden if you have set the unit to 'Hours'.</p> |
80 |
<select id="existing_rule_unit" name="unit_[% id %]" id="unit"> |
81 |
<option value="">Choose a unit</option> |
82 |
[% IF rule.unit == "hours" %] |
83 |
<option value="hours" selected="selected">Hours</option> |
84 |
<option value="days">Days</option> |
85 |
[% ELSIF rule.unit == "days" %] |
86 |
<option value="days" selected="selected">Days</option> |
87 |
<option value="hours">Hours</option> |
88 |
[% END %] |
89 |
</select> |
90 |
</div> |
91 |
[% IF rule.unit == "days" %] |
92 |
<div id="age_starting_point_div"> |
93 |
<h5>Age starting point (starting point from which the item age is calculated)</h5> |
94 |
<select name="age_starting_point_[% id %]" id="age_starting_point"> |
95 |
<option value="">Choose age starting point</option> |
96 |
[% IF rule.age_starting_point == "itemcreation" %] |
97 |
<option value="itemcreation" selected="selected">Created</option> |
98 |
<option value="itemaltered">Item last altered</option> |
99 |
[% ELSIF rule.age_starting_point == "itemaltered" %] |
100 |
<option value="itemaltered" selected="selected">Last altered</option> |
101 |
<option value="itemcreation">Item creation</option> |
102 |
[% END %] |
103 |
</select> |
104 |
</div> |
105 |
[% END %] |
106 |
<div class="blocks"> |
78 |
<h5>Conditions</h5> |
107 |
<h5>Conditions</h5> |
79 |
[% FOR condition IN rule.conditions %] |
108 |
[% FOR condition IN rule.conditions %] |
80 |
<div class="block"> |
109 |
<div class="block"> |
Lines 88-95
Link Here
|
88 |
[% END %] |
117 |
[% END %] |
89 |
[% END %] |
118 |
[% END %] |
90 |
</select> |
119 |
</select> |
91 |
= |
120 |
<input type="text" value="[% condition.value %]" name="condition_value_[% id%]" /> |
92 |
<input type="text" value="[% condition.value | html %]" name="condition_value_[% id | html %]" /> |
|
|
93 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a> |
121 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a> |
94 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a> |
122 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a> |
95 |
</div> |
123 |
</div> |
Lines 109-116
Link Here
|
109 |
[% END %] |
137 |
[% END %] |
110 |
[% END %] |
138 |
[% END %] |
111 |
</select> |
139 |
</select> |
112 |
= |
140 |
<input type="text" value="[% substitution.value %]" name="substitution_value_[% id %]" /> |
113 |
<input type="text" value="[% substitution.value | html %]" name="substitution_value_[% id | html %]" /> |
|
|
114 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a> |
141 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a> |
115 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a> |
142 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a> |
116 |
<span class="required">A field name is required</span> |
143 |
<span class="required">A field name is required</span> |
Lines 132-140
Link Here
|
132 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
159 |
<legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend> |
133 |
<input type="hidden" name="unique_id" /> |
160 |
<input type="hidden" name="unique_id" /> |
134 |
<div class="age"> |
161 |
<div class="age"> |
135 |
<h5>Age in days</h5> |
162 |
<h5>Age</h5> |
136 |
<input class="age" type="number" value="" name="age" /> |
163 |
<input class="age" type="number" value="" name="age" /> |
137 |
</div> |
164 |
</div> |
|
|
165 |
<div> |
166 |
<h5>Unit</h5> |
167 |
<p>Note: If the unit of 'Hours' is set then you cannot choose an age starting point, the item age starting point will default to the last item alteration event. The Age starting point selection will be hidden if you have set the unit to 'Hours'.</p> |
168 |
<select id="new_rule_unit" name="unit" /> |
169 |
<option value="">Choose an age unit</option> |
170 |
<option id="hours" value="hours">Hours</option> |
171 |
<option id="days" value="days">Days</option> |
172 |
</select> |
173 |
</div> |
174 |
<div id="new_rule_age_starting_point_div"> |
175 |
<h5>Age starting point (starting point from which the item age is calculated)</h5> |
176 |
<select name="age_starting_point"> |
177 |
<option value="">Choose age starting point</option> |
178 |
<option value="itemcreation">Created</option> |
179 |
<option value="itemaltered">Last altered</option> |
180 |
</select> |
181 |
</div> |
138 |
<div class="blocks"> |
182 |
<div class="blocks"> |
139 |
<h5>Conditions</h5> |
183 |
<h5>Conditions</h5> |
140 |
<div class="block"> |
184 |
<div class="block"> |
Lines 144-150
Link Here
|
144 |
<option value="[% field | html %]">[% field | html %]</option> |
188 |
<option value="[% field | html %]">[% field | html %]</option> |
145 |
[% END %] |
189 |
[% END %] |
146 |
</select> |
190 |
</select> |
147 |
= |
|
|
148 |
<input type="text" value="" name="condition_value" /> |
191 |
<input type="text" value="" name="condition_value" /> |
149 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a> |
192 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a> |
150 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a> |
193 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a> |
Lines 159-165
Link Here
|
159 |
<option value="[% field | html %]">[% field | html %]</option> |
202 |
<option value="[% field | html %]">[% field | html %]</option> |
160 |
[% END %] |
203 |
[% END %] |
161 |
</select> |
204 |
</select> |
162 |
= |
|
|
163 |
<input type="text" value="" name="substitution_value" /> |
205 |
<input type="text" value="" name="substitution_value" /> |
164 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a> |
206 |
<a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a> |
165 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a> |
207 |
<a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a> |
Lines 174-179
Link Here
|
174 |
<thead> |
216 |
<thead> |
175 |
<tr> |
217 |
<tr> |
176 |
<th>Age</th> |
218 |
<th>Age</th> |
|
|
219 |
<th>Age starting point</th> |
177 |
<th>Conditions</th> |
220 |
<th>Conditions</th> |
178 |
<th>Substitutions</th> |
221 |
<th>Substitutions</th> |
179 |
</tr> |
222 |
</tr> |
Lines 182-194
Link Here
|
182 |
[% FOR rule IN rules %] |
225 |
[% FOR rule IN rules %] |
183 |
<tr> |
226 |
<tr> |
184 |
<td> |
227 |
<td> |
185 |
[% IF rule.age.defined and rule.age.length > 0 %] |
228 |
[% IF rule.age.defined and rule.unit.defined and rule.age.length > 0 %] |
186 |
[% rule.age | html %] days |
229 |
[% IF rule.age == 1 %] |
|
|
230 |
[% IF rule.unit == "days" %] |
231 |
[% rule.age %] day |
232 |
[% ELSE %] |
233 |
[% rule.age %] hour |
234 |
[% END %] |
235 |
[% ELSE %] |
236 |
[% rule.age %] [% rule.unit %] |
237 |
[% END %] |
187 |
[% ELSE %] |
238 |
[% ELSE %] |
188 |
There is no age for this rule. |
239 |
There is no age for this rule. |
189 |
[% END %] |
240 |
[% END %] |
190 |
</td> |
241 |
</td> |
191 |
<td> |
242 |
<td> |
|
|
243 |
[% IF rule.age_starting_point.defined %] |
244 |
[% rule.age_starting_point %] |
245 |
[% ELSE %] |
246 |
There is no age starting point for this rule. |
247 |
[% END %] |
248 |
</td> |
249 |
<td> |
192 |
[% FOR condition IN rule.conditions %] |
250 |
[% FOR condition IN rule.conditions %] |
193 |
[% IF condition.field %] |
251 |
[% IF condition.field %] |
194 |
<div class="block"> |
252 |
<div class="block"> |