home · contact · privacy
Add foreign key restraints, expand and fix tests, add deletion and forking.
[misc] / todo_templates / macros.html
1
2
3
4 {% macro tagselection(submit_name, selected_tags, all_tags) %}
5 <input name="{{submit_name}}" value="" size=15 list="tags" autocomplete="off" />
6 {% for selected_tag in selected_tags | sort %}
7 <select name="{{submit_name}}">
8 <option></option>
9 {% for tag in all_tags | sort %}<option value="{{tag|e}}" {% if selected_tag == tag %}selected{% endif %}>{{tag|e}}</option>
10 {% endfor %}
11 </select>
12 {% endfor %}
13 <datalist id="tags">
14 {% for tag in all_tags %}<option value="{{tag}}">{{tag}}</option>
15 {% endfor %}
16 </datalist>
17 {% endmacro %}
18
19
20
21 {% macro sort_head(sort, name_internal, display_name, sort_key="sort") %}
22 <th {% if sort == name_internal %}class="desc"{% elif sort == '-' + name_internal %}class="asc"{% endif %}>
23 <a href="?{{sort_key}}={% if sort == name_internal %}-{% endif %}{{name_internal}}">{{display_name}}</a>
24 </th>
25 {% endmacro %}
26
27
28
29 {% macro doneness_string(todo, respect_cancelled=false, datalist_hack=false) %}
30 [{% if todo.done and not (respect_cancelled and "cancelled" in todo.tags) %}✓{% else %}{% if datalist_hack %}&nbsp;&nbsp;{% else %} {% endif %}{% endif %}]
31 {% endmacro %}
32
33
34
35 {% macro datalist_tasks(tasks, with_weight=false) %}
36 <datalist id="tasks">
37 {% for task in tasks %}
38 <option value="{{task.id_}}">{% if with_weight %}({{task.deps_weight}}) {% endif %}{{task.title.now}}</option>
39 {% endfor %}
40 </datalist>
41 {% endmacro %}
42
43
44
45 {% macro parenthood_selector(parenthood) %}parenthood: <select name="parenthood">
46 <option value="childless" {% if parenthood == "childless" %}selected{% endif %}>make childless</option>
47 <option value="adoption" {% if parenthood == "adoption" %}selected{% endif %}>favor adoption</option>
48 <option value="birth" {% if parenthood == "birth" %}selected{% endif %}>favor birth</option>
49 </select>{% endmacro %}