{% macro input(name, value, violations, type, size) %} {% if violations is none %} {% else %} {% set hasError = "false" %} {% for violation in violations %} {% if violation.getPropertyPath == name and hasError == "false" %} {% set hasError = "true" %}
{{violation.getMessage}}
{% endif %} {% endfor %} {% if hasError == "false" %} {% endif %} {% endif %} {% endmacro %} {% macro textarea(name, value, violations, rows, cols) %} {% if violations is none %} {% else %} {% set hasError = "false" %} {% for violation in violations %} {% if violation.getPropertyPath == name and hasError == "false" %} {% set hasError = "true" %}
{{violation.getMessage}}
{% endif %} {% endfor %} {% if hasError == "false" %} {% endif %} {% endif %} {% endmacro %} {% block dev %}
{% if form is none %} {% set name, description, website, callback = '', '', '', ''%} {% else %} {% set name = form.name %} {% set description = form.description %} {% set website = form.website %} {% set callback = form.callback %} {% endif %}
{{ _self.input("name", name, violations) }}
{{ _self.textarea("description", description, violations,5,17) }}
{{ _self.input("website", website|default("http://"), violations) }}
{% trans 'Application web' %} {% trans 'Application desktop' %}
{{ _self.input("callback", callback|default("http://"), violations) }}
{% endblock %}