home · contact · privacy
Add Todo/Process.blockers for Conditions that block rather than enable.
[plomtask] / templates / todo.html
index 44cdfa7eec24de0db04dd1eaa3984fa3abea41d4..a711568edf75c6291051cb300325b650ed57cb2e 100644 (file)
@@ -1,4 +1,5 @@
-{% extends 'base.html' %}
+{% extends '_base.html' %}
+{% import '_macros.html' as macros %}
 
 
 
 <td><input type="checkbox" name="done" {% if todo.is_done %}checked {% endif %} {% if not todo.is_doable %}disabled {% endif %}/><br /></td>
 </tr>
 
+<tr>
+<th>effort</th>
+<td><input type="number" name="effort" step=0.1 size=5 placeholder={{todo.process.effort.newest }} value={{ todo.effort }} /><br /></td>
+</tr>
+
 <tr>
 <th>comment</th>
 <td><input name="comment" value="{{todo.comment|e}}"/></td>
 </tr>
 
 <tr>
-<th>conditions</th>
-<td>
-<table>
-{% for condition in todo.conditions %}
+<th>calendarize</th>
+<td><input type="checkbox" name="calendarize" {% if todo.calendarize %}checked {% endif %}</td>
+</tr>
+
 <tr>
-<td>
-<input type="checkbox" name="condition" value="{{condition.id_}}" checked />
-</td>
-<td>
-<a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
-</td>
+<th>conditions</th>
+<td>{{ macros.simple_checkbox_table("condition", todo.conditions, "condition", "condition_candidates") }}</td>
 </tr>
-{% endfor %}
-</table>
-add: <input name="condition" list="condition_candidates" autocomplete="off" />
-</td>
+
+<tr>
+<th>blockers</th>
+<td>{{ macros.simple_checkbox_table("blocker", todo.blockers, "condition", "condition_candidates") }}</td>
 </tr>
 
 <tr>
 <th>enables</th>
-<td>
-<table>
-{% for condition in todo.enables %}
-<tr>
-<td>
-<input type="checkbox" name="enables" value="{{condition.id_}}" checked />
-</td>
-<td>
-<a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
-</td>
-</tr>
-{% endfor %}
-</table>
-add: <input name="enables" list="condition_candidates" autocomplete="off" />
-</td>
+<td>{{ macros.simple_checkbox_table("enables", todo.enables, "condition", "condition_candidates") }}</td>
 </tr>
 
 <tr>
 <th>disables</th>
-<td>
-<table>
-{% for condition in todo.disables%}
-<tr>
-<td>
-<input type="checkbox" name="disables" value="{{condition.id_}}" checked />
-</td>
-<td>
-<a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a>
-</td>
-</tr>
-{% endfor %}
-</table>
-add: <input name="disables" list="condition_candidates" autocomplete="off" />
-</td>
+<td>{{ macros.simple_checkbox_table("disables", todo.disables, "condition", "condition_candidates") }}</td>
 </tr>
 
 <tr>
@@ -95,34 +69,13 @@ add: <input name="disables" list="condition_candidates" autocomplete="off" />
 
 <tr>
 <th>children</th>
-<td>
-<table>
-{% for child in todo.children %}
-<tr>
-<td><input type="checkbox" name="adopt" value="{{child.id_}}" checked /></td>
-<td><a href="todo?id={{child.id_}}">{{child.process.title.newest|e}}</a></td>
-</tr>
-{% endfor %}
-</table>
-adopt: <input name="adopt" list="todo_candidates" autocomplete="off" />
-</td>
+<td>{{ macros.simple_checkbox_table("adopt", todo.children, "adopt", "todo_candidates", "adopt") }}</td>
 </tr>
 
 </table>
-<input class="btn-harmless" type="submit" name="update" value="update" />
-<div class="btn-to-right">
-<input class="btn-dangerous" type="submit" name="delete" value="delete" />
-</div>
+{{ macros.edit_buttons() }}
 </form>
 
-<datalist id="condition_candidates">
-{% for condition_candidate in condition_candidates %}
-<option value="{{condition_candidate.id_}}">{{condition_candidate.title.newest|e}}</option>
-{% endfor %}
-</datalist>
-<datalist id="todo_candidates">
-{% for candidate in todo_candidates %}
-<option value="{{candidate.id_}}">{{candidate.process.title.newest|e}} ({{candidate.id_}})</option>
-{% endfor %}
-</datalist>
+{{ macros.datalist_of_titles("condition_candidates", condition_candidates) }}
+{{ macros.datalist_of_titles("todo_candidates", todo_candidates) }}
 {% endblock %}