comparison farol/templates/macros.j2 @ 160:a7ce1660aaaf

Add a checkbox macro
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 14:10:50 +0100
parents 79abdecb2d0b
children
comparison
equal deleted inserted replaced
158:d66532e1909e 160:a7ce1660aaaf
104 {% for name, val in choices %}<option value="{{ val }}"{% if val in value %} selected{% endif %}>{{ name }}</option>{% endfor %} 104 {% for name, val in choices %}<option value="{{ val }}"{% if val in value %} selected{% endif %}>{{ name }}</option>{% endfor %}
105 </select> 105 </select>
106 </div> 106 </div>
107 {% endmacro %} 107 {% endmacro %}
108 108
109 {% macro checkbox(name, label, checked=False) %}
110 <div class="form-group">
111 <div class="checkbox">
112 <label>
113 <input name="{{ name }}" type="checkbox"{{ ' checked' if checked }}> {{ label }}
114 </label>
115 </div>
116 </div>
117 {% endmacro %}
118
109 {% macro panel(type="default", heading=None, badge=None, title=0, collapsible=True, extended=False) %} 119 {% macro panel(type="default", heading=None, badge=None, title=0, collapsible=True, extended=False) %}
110 {% if not heading %} 120 {% if not heading %}
111 {% set collapsible = False %} 121 {% set collapsible = False %}
112 {% endif %} 122 {% endif %}
113 <div class="{{ ["panel", "panel-" + type] | join(" ") }}"> 123 <div class="{{ ["panel", "panel-" + type] | join(" ") }}">

http://farol.wald.intevation.org