blob: d7cd2fc18e0e3ee80b51b81820739c52d9d7b422 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
{# functions #}
{% macro left_arrow(target,label) %}
<a id="left" href="{{target}}">
<div>
<img class="arrow" src="{{ "images/arrow_left.png" | static_url }}">
<span class="navdate">{{label}}</span>
</div>
</a>
{% endmacro %}
{% macro right_arrow(target,label) %}
<a id="right" href="{{target}}">
<div>
<span class="navdate">{{label}}</span>
<img class="arrow" src="{{ "images/arrow_right.png" | static_url }}">
</div>
</a>
{% endmacro %}
{% macro colorize(fgcolor=None, bgcolor=None, tag='span') -%}
{% if not fgcolor and not bgcolor %}
{{ caller() }}
{% else %}
{% set style = "" %}
{% if fgcolor: %}{% set style = style ~ " color: " ~ fgcolor %}{% endif %}
{% if bgcolor: %}{% set style = style ~ " background: " ~ bgcolor %}{% endif %}
<{{tag}} style="{{style}}">{{caller()}}</{{tag}}>
{% endif %}
{% endmacro %}
{% macro render_form(form) %}
<table>
{% for field in form if not field is hidden %}
<tr><th>{{ field.label }}</th><td>{{ field(**kwargs.get(field.short_name, {})) }}</td><td>{{ field.description }}</td>
<td>{% if field.errors %}<span class="error">{{ field.errors[0] }}</span>{% endif %}</td></tr>
{% endfor %}
</table>
{{ form.hidden_tag() }}
{% endmacro %}
|