1 {% macro edit_buttons() %}
2 <input class="btn-harmless" type="submit" name="update" value="update" />
3 <div class="btn-to-right">
4 <input class="btn-dangerous" type="submit" name="delete" value="delete" />
10 {% macro datalist_of_titles(title, candidates) %}
11 <datalist id="{{title}}">
12 {% for candidate in candidates %}
13 <option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
20 {% macro simple_checkbox_table(title, items, type_name, list_name, add_string="add", historical=false) %}
21 {% if items|length > 0 %}
23 {% for item in items %}
26 <input type="checkbox" name="{{title}}" value="{{item.id_}}" checked />
29 <a href="{{type_name}}?id={{item.id_}}">{% if historical is true %}{{item.title_then}}{% else %}{{item.title.newest|e}}{% endif %}</a>
35 {{add_string}}: <input name="{{title}}" type="text" list="{{list_name}}" autocomplete="off" />
40 {% macro history_page(item_name, item, attribute_name, attribute, as_pre=false) %}
41 <h3>{{item_name}} {{attribute_name}} history</h3>
45 <th>{{item_name}}</th>
46 <td><a href="{{item_name}}?id={{item.id_}}">{{item.title.newest|e}}</a></td>
49 {% for date in attribute.history.keys() | sort(reverse=True) %}
51 <th>{{date | truncate(19, True, '') }}</th>
52 <td>{% if as_pre %}<pre>{% endif %}{{attribute.history[date]}}{% if as_pre %}</pre>{% endif %}</td>