benoit@0: {# benoit@0: # Description: benoit@0: # Web Template used in Farol Design benoit@0: # benoit@0: # Authors: benoit@0: # BenoƮt Allard benoit@0: # benoit@0: # Copyright: benoit@0: # Copyright (C) 2014 Greenbone Networks GmbH benoit@0: # benoit@0: # This program is free software; you can redistribute it and/or benoit@0: # modify it under the terms of the GNU General Public License benoit@0: # as published by the Free Software Foundation; either version 2 benoit@0: # of the License, or (at your option) any later version. benoit@0: # benoit@0: # This program is distributed in the hope that it will be useful, benoit@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of benoit@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the benoit@0: # GNU General Public License for more details. benoit@0: # benoit@0: # You should have received a copy of the GNU General Public License benoit@0: # along with this program; if not, write to the Free Software benoit@0: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. benoit@0: -#} benoit@0: benoit@0: {% macro textinput(name, label, placeholder="", value=None, required=False, type="text", extras={}, help='') %} benoit@0:
benoit@34: {% if caller %} benoit@34: {% set content=caller () %} benoit@34: {% call modal(name + "_modal", label) %} benoit@34: {{ content }} benoit@34: {% endcall %} benoit@34: {% endif %} benoit@34: benoit@0: {% if type == "datetime" %}
{% endif %} benoit@0: benoit@0: {% if type == "datetime" %} benoit@0: benoit@0: benoit@0: benoit@0:
benoit@0: {% endif %} benoit@0: {% if help %} benoit@0: {{ help }} benoit@0: {% endif %} benoit@0:
benoit@0: {% endmacro %} benoit@0: benoit@34: {% macro modal(id, title, size=None) %} benoit@34: {# /.modal #} benoit@34: {% endmacro %} benoit@34: benoit@0: {% macro textarea(name, label, placeholder="", value=None, rows=10, required=False) %} benoit@0:
benoit@35: {% if caller %} benoit@35: {% set content=caller () %} benoit@35: {% call modal(name + "_modal", label) %} benoit@35: {{ content }} benoit@35: {% endcall %} benoit@35: {% endif %} benoit@35: benoit@0: benoit@0:
benoit@0: {% endmacro %} benoit@0: benoit@0: {% macro selectinput(name, label, choices, value) %} benoit@0:
benoit@35: {% if caller %} benoit@35: {% set content=caller () %} benoit@35: {% call modal(name + "_modal", label) %} benoit@35: {{ content }} benoit@35: {% endcall %} benoit@35: {% endif %} benoit@35: benoit@0: benoit@0:
benoit@0: {% endmacro %} benoit@0: benoit@0: {# Big difference with the one above is that the choices are tuple (name, value) #} benoit@0: {% macro selectinput2(name, label, choices, value, multiple=False) %} benoit@0: {% if not multiple %} benoit@0: {% set value= [value] %} benoit@0: {% endif %} benoit@0:
benoit@0: benoit@0: benoit@0:
benoit@0: {% endmacro %} benoit@0: benoit@32: {% macro panel(type="default", heading=None, badge=None, title=0, collapsible=True, extended=False) %} benoit@0: {% if not heading %} benoit@0: {% set collapsible = False %} benoit@0: {% endif %} benoit@0:
benoit@0: {% if heading %} benoit@0:
benoit@0: {%- if title %}{% endif -%} benoit@0: {%- if collapsible %}{% endif -%} benoit@32: {{ heading }}{% if badge is not none %}{{ badge }}{% endif %} benoit@0: {%- if collapsible %}{% endif -%} benoit@0: {%- if title %}{% endif -%} benoit@0:
benoit@0: {% endif %} benoit@0: {% if collapsible %}
{% endif %} benoit@0:
benoit@0: {{ caller() }} benoit@0:
benoit@0: {% if collapsible %}
{% endif %} benoit@0:
benoit@0: {% endmacro %} benoit@0: benoit@0: {# This should be placed inside a .form-horizontal #} benoit@0: {% macro label_value(label, value, left=2, right=10) %} benoit@0:
benoit@0: benoit@0:
benoit@0:

{{ value }}

benoit@0:
benoit@0:
benoit@0: {% endmacro %} benoit@34: benoit@34: {% macro examples(list) %} benoit@34: {% if False %} benoit@34:
benoit@34:
Example{{ 's' if list | length > 1 }}:
benoit@34: {% for elem in list %} benoit@34:
{{ elem }}
benoit@34: {% endfor %} benoit@34:
benoit@34: {% else %} benoit@34:

Example{{ 's' if list | length > 1 }}:

benoit@34: {% if list | length == 1 %} benoit@34: {{ list[0] }} benoit@34: {% else %} benoit@34: benoit@34: {% endif %} benoit@34: {% endif %} benoit@34: {% endmacro %}