Mercurial > farol > farol
diff 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 |
line wrap: on
line diff
--- a/farol/templates/macros.j2 Mon Oct 06 14:09:57 2014 +0200 +++ b/farol/templates/macros.j2 Mon Oct 06 14:24:25 2014 +0200 @@ -78,14 +78,32 @@ {% macro textarea(name, label, placeholder="", value=None, rows=10, required=False) %} <div class="form-group"> - <label for="{{ name }}">{{ label }}:{% if required %}<span class="text-danger"> *</span>{% endif %}</label> + {% if caller %} + {% set content=caller () %} + {% call modal(name + "_modal", label) %} + {{ content }} + {% endcall %} + {% endif %} + <label for="{{ name }}"> + {{ label }}: + {% if required %}<span class="text-danger"> *</span>{% endif %} + {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %} + </label> <textarea class="form-control" rows={{ rows }} id="{{ name }}" name="{{ name }}" placeholder="{{ placeholder }}"{% if required %} required{% endif %}>{% if value %}{{ value }}{% endif %}</textarea> </div> {% endmacro %} {% macro selectinput(name, label, choices, value) %} <div class="form-group"> - <label for="{{ name }}">{{ label }}:</label> + {% if caller %} + {% set content=caller () %} + {% call modal(name + "_modal", label) %} + {{ content }} + {% endcall %} + {% endif %} + <label for="{{ name }}">{{ label }}: + {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %} + </label> <select class="form-control" name="{{name}}", id="{{ name }}"> {% for choice in choices %}<option{% if value==choice %} selected{% endif %}>{{ choice }}</option>{% endfor %} </select>