Julien Fastré 5c0ca70ebf add api to add a validation on export elements
Exports elements should implements "ExportElementValidatedInterface"
2017-02-02 22:45:10 +01:00

105 lines
4.0 KiB
Twig

{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %}
{% block title %}{{ export.title|trans }}{% endblock %}
{% block js %}
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", chill.listenerDisplayCheckbox);
</script>
{% endblock js %}
{% block layout_wvm_content %}
<h1>{{ export.title|trans }}</h1>
<p>{{ export.description|trans }}</p>
{{ form_start(form) }}
{% if form.children.export.children.filters is not empty%}
<div style="clear:both; padding-top: 1.5em;">
<h2>{{ 'Filters'| trans }}</h2>
{% for filter_form in form.children.export.children.filters %}
<div>
<p>
{{ form_widget(filter_form.enabled, { 'attr' : { 'style' : 'vertical-align: middle;', 'data-display-target': filter_form.vars.id } }) }}
<span class="force-inline-label">{{ form_label(filter_form) }}</span>
</p>
<div data-display-show-hide="{{ filter_form.vars.id }}">
{{ form_widget(filter_form.form) }}
{{ form_errors(filter_form) }}
</div>
</div>
{% endfor %}
{{ form_errors(form.children.export.children.filters) }}
</div>
{% else %}
{# render the children, to mark the widget as 'rendered' #}
{{ form_widget(form.children.export.children.filters) }}
{% endif %}
{% if form.children.export.children.aggregators is not empty %}
<div style="clear:both; padding-top: 1.5em;">
<h2>{{ 'Aggregators'| trans }}</h2>
{% for aggregator_form in form.children.export.children.aggregators %}
<div>
<p>
{{ form_widget(aggregator_form.enabled, { 'attr' : { 'style' : 'vertical-align: middle;', 'data-display-target': aggregator_form.vars.id } }) }}
<span class="force-inline-label">{{ form_label(aggregator_form) }}</span>
</p>
<div data-display-show-hide="{{ aggregator_form.vars.id }}">
{{ form_widget(aggregator_form.form) }}
{{ form_errors(aggregator_form) }}
</div>
</div>
{% endfor %}
</div>
{% else %}
{# render the children, to mark the widget as 'rendered' #}
{{ form_widget(form.children.export.children.aggregators) }}
{% endif %}
{% if form.children.export.children.export.children|length > 0 %}
<div style="clear:both; padding-top: 1.5em;">
<h2>{{ 'Export parameters'|trans }}</h2>
{{ form_widget(form.children.export.children.export) }}
</div>
{% else %}
{# render the children, to mark the widget as 'rendered' #}
{{ form_widget(form.children.export.children.export) }}
{% endif %}
<div style="clear: both; padding-top: 1.5em;">
<h2>{{ 'Formatter'| trans }}</h2>
<p> {{ 'Choose the formatter'|trans }}</p>
{{ form_row(form.children.export.children.pick_formatter.children.alias, { 'label' : 'Formatter' }) }}
</div>
<p>{{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button btn-create' }, 'label' : 'Go to formatter options' } ) }}</p>
{{ form_end(form) }}
{% endblock layout_wvm_content %}