1 {% macro edit_buttons() %}
2 <div class="edit_buttons">
3 <input class="btn-harmless" type="submit" name="update" value="update" />
4 <div class="btn-to-right">
5 <input class="btn-dangerous" type="submit" name="delete" value="delete" />
12 {% macro datalist_of_titles(title, candidates, historical=false, with_comments=false) %}
13 <datalist id="{{title}}">
14 {% for candidate in candidates %}
15 <option value="{{candidate.id_}}">
16 {% if historical is true %}
17 {{candidate.title_then|e}}
19 {{candidate.title.newest|e}}
21 {% if with_comments and candidate.comment %}
22 / {{candidate.comment}}
31 {% macro simple_checkbox_table(title, items, type_name, list_name, add_string="add", historical=false) %}
32 {% if items|length > 0 %}
34 {% for item in items %}
37 <input type="checkbox" name="{{title}}" value="{{item.id_}}" checked />
40 <a href="{{type_name}}?id={{item.id_}}">{% if historical is true %}{{item.title_then}}{% else %}{{item.title.newest|e}}{% endif %}</a>
46 {{add_string}}: <input name="{{title}}" type="text" list="{{list_name}}" autocomplete="off" />
51 {% macro history_page(item_name, item, attribute_name, attribute, as_pre=false) %}
52 <h3>{{item_name}} {{attribute_name}} history</h3>
53 <form action="{{item_name}}_{{attribute_name}}s?id={{item.id_}}" method="POST">
57 <th>{{item_name}}</th>
58 <td><a href="{{item_name}}?id={{item.id_}}">{{item.title.newest|e}}</a></td>
62 {% for date in attribute.history.keys() | sort(reverse=True) %}
64 <td><input name="at:{{date}}" class="timestamp" value="{{date|truncate(19, True, '', 0)}}"></td>
65 <td>{% if as_pre %}<pre>{% endif %}{{attribute.history[date]}}{% if as_pre %}</pre>{% endif %}</td>
70 <input class="btn-harmless" type="submit" name="update" value="update" />