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) %}
22 {% for item in items %}
25 <input type="checkbox" name="{{title}}" value="{{item.id_}}" checked />
28 <a href="{{type_name}}?id={{item.id_}}">{% if historical is true %}{{item.title_then}}{% else %}{{item.title.newest|e}}{% endif %}</a>
33 {{add_string}}: <input name="{{title}}" list="{{list_name}}" autocomplete="off" />
38 {% macro history_page(item_name, item, attribute_name, attribute, as_pre=false) %}
39 <h3>{{item_name}} {{attribute_name}} history</h3>
43 <th>{{item_name}}</th>
44 <td><a href="{{item_name}}?id={{item.id_}}">{{item.title.newest|e}}</a></td>
47 {% for date in attribute.history.keys() | sort(reverse=True) %}
49 <th>{{date | truncate(19, True, '') }}</th>
50 <td>{% if as_pre %}<pre>{% endif %}{{attribute.history[date]}}{% if as_pre %}</pre>{% endif %}</td>