comparison farol/templates/macros.j2 @ 35:537d25b1593c

Add Descriptions to the fields of the edit_publisher page
author Benoît Allard <benoit.allard@greenbone.net>
date Mon, 06 Oct 2014 14:24:25 +0200
parents 22d89f53e34c
children df5182d0787f
comparison
equal deleted inserted replaced
34:22d89f53e34c 35:537d25b1593c
76 </div>{# /.modal #} 76 </div>{# /.modal #}
77 {% endmacro %} 77 {% endmacro %}
78 78
79 {% macro textarea(name, label, placeholder="", value=None, rows=10, required=False) %} 79 {% macro textarea(name, label, placeholder="", value=None, rows=10, required=False) %}
80 <div class="form-group"> 80 <div class="form-group">
81 <label for="{{ name }}">{{ label }}:{% if required %}<span class="text-danger"> *</span>{% endif %}</label> 81 {% if caller %}
82 {% set content=caller () %}
83 {% call modal(name + "_modal", label) %}
84 {{ content }}
85 {% endcall %}
86 {% endif %}
87 <label for="{{ name }}">
88 {{ label }}:
89 {% if required %}<span class="text-danger"> *</span>{% endif %}
90 {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %}
91 </label>
82 <textarea class="form-control" rows={{ rows }} id="{{ name }}" name="{{ name }}" placeholder="{{ placeholder }}"{% if required %} required{% endif %}>{% if value %}{{ value }}{% endif %}</textarea> 92 <textarea class="form-control" rows={{ rows }} id="{{ name }}" name="{{ name }}" placeholder="{{ placeholder }}"{% if required %} required{% endif %}>{% if value %}{{ value }}{% endif %}</textarea>
83 </div> 93 </div>
84 {% endmacro %} 94 {% endmacro %}
85 95
86 {% macro selectinput(name, label, choices, value) %} 96 {% macro selectinput(name, label, choices, value) %}
87 <div class="form-group"> 97 <div class="form-group">
88 <label for="{{ name }}">{{ label }}:</label> 98 {% if caller %}
99 {% set content=caller () %}
100 {% call modal(name + "_modal", label) %}
101 {{ content }}
102 {% endcall %}
103 {% endif %}
104 <label for="{{ name }}">{{ label }}:
105 {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %}
106 </label>
89 <select class="form-control" name="{{name}}", id="{{ name }}"> 107 <select class="form-control" name="{{name}}", id="{{ name }}">
90 {% for choice in choices %}<option{% if value==choice %} selected{% endif %}>{{ choice }}</option>{% endfor %} 108 {% for choice in choices %}<option{% if value==choice %} selected{% endif %}>{{ choice }}</option>{% endfor %}
91 </select> 109 </select>
92 </div> 110 </div>
93 {% endmacro %} 111 {% endmacro %}

http://farol.wald.intevation.org