{% macro input(name, value, violations, property, type, size) %} {% if violations is none %} {% else %} {% set hasError = "false" %} {% for violation in violations %} {% if violation.getPropertyPath == property and hasError == "false" %} {% set hasError = "true" %}
{{ violation.getInvalidValue }} - {{violation.getMessage}}
{% endif %} {% endfor %} {% if hasError == "false" %} {% endif %} {% endif %} {% endmacro %} {% macro textarea(name, value, violations,property, rows, cols) %} {% if violations is none %} {% else %} {% set hasError = "false" %} {% for violation in violations %} {% if violation.getPropertyPath == property 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 = '', '', '', ''%} {% set app_type = 'web'%} {% else %} {% set name = form.name %} {% set description = form.description %} {% set website = form.website %} {% set callback = form.callback %} {% set app_type = form.type %} {% endif %} {% if app_type == "web" %} {% endif %}
{{ _self.input("name", name, violations, 'name') }}
{{ _self.textarea("description", description, 'description', violations, 5, 17) }}
{{ _self.input("website", website, violations, 'urlwebsite') }}
{% trans 'Application web' %} {% trans 'Application desktop' %}
{{ _self.input("callback", callback, violations, 'urlcallback') }}
{% endblock %}