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