chill-bundles/Resources/views/Form/fields.html.twig
Julien Fastré 9d18581db1 add an interface for export which are lists
Lists does not supports aggregators.

The export manager will filter the aggregators applying on the export
depending on the interface implemented by the export: if the export implements
`Export\ListInterface`, no aggregators will be returned for this export.
2016-12-09 19:52:54 +01:00

147 lines
5.3 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/>.
#}
{% block form_row %}
{% spaceless %}
<div class="container">
<div class="{% spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
grid-12
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
grid-2 grid-mobile-4 grid-tablet-4 mobile-clear tablet-clear
{% else %}
grid-4 clear
{% endif %}
{% endspaceless %}">
{% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %}
{{ form_label(form) }}
{% endif %}
</div>
<div class="{% spaceless %}
{% if attr.class is defined and 'cf-title' in attr.class %}
grid-12
{% elseif attr.class is defined and 'cf-fields' in attr.class %}
grid-12 parent
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
grid-2 grid-mobile-8 grid-tablet-8 multiple-cf-inline
{% else %}
grid-8
{% endif %}
{% endspaceless %}">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
{% endspaceless %}
{% endblock form_row %}
{% block choice_widget_expanded %}
{% spaceless %}
<div {{ block('widget_container_attributes') }}>
{% for child in form %}
<span class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</span>
<br/>
{% endfor %}
</div>
<script type="text/javascript">chill.checkNullValuesInChoices("{{ form.vars.full_name }}");</script>
{% endspaceless %}
{% endblock choice_widget_expanded %}
{% block choice_with_other_widget %}
{% spaceless %}
{% for child in form._choices %}
{%- if child.vars.value != '_other' -%}
<div class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</div>
{%- else -%}
<div class="container">
<div class="grid-6 grid-tablet-12 gid-mobile-12 no-gutter">
<span class="inline-choice">
{{ form_widget(child) }}
{{ form_label(child, '', {'label_attr': { 'class' : 'inline'} }) }}
</span>
</div>
<div class="grid-6 grid-tablet-12 gid-mobile-12 no-gutter">
{{ form_widget(form._other, {'attr': {'class': 'input-text-other-value'} }) }}
</div>
</div>
{%- endif -%}
{% endfor %}
<script type="text/javascript">
chill.checkNullValuesInChoices("{{ form._choices.vars.full_name }}");
</script>
{% endspaceless %}
{% endblock choice_with_other_widget %}
{% block date_widget %}
{% spaceless %}
{% if widget == 'single_text' %}
{% set attr = {'class' : 'input datepicker'} %}
{{ block('form_widget_simple') }}
{% else %}
<div {{ block('widget_container_attributes') }}>
{{ date_pattern|replace({
'{{ year }}': form_widget(form.year ),
'{{ month }}': form_widget(form.month ),
'{{ day }}': form_widget(form.day ),
})|raw }}
</div>
{% endif %}
{% endspaceless %}
{% endblock date_widget %}
{%- block time_widget -%}
{%- if widget == 'single_text' -%}
{{ block('form_widget_simple') }}
{%- else -%}
{%- set vars = widget == 'text' ? { 'attr': { 'size': 1 }} : {} -%}
{% set attr = {'class' : 'time_compound ' ~ attr.class|default('') } %}
<div {{ block('widget_container_attributes') }}>
{{ form_widget(form.hour, vars) }}{% if with_minutes %}<span class="separator">:</span>{{ form_widget(form.minute, vars) }}{% endif %}{% if with_seconds %}<span class="separator">:</span>{{ form_widget(form.second, vars) }}{% endif %}
</div>
{%- endif -%}
{%- endblock time_widget -%}
{% block form_errors %}
{% spaceless %}
{% if errors|length > 0 %}
<ul class="errors">
{% for error in errors %}
<li>{{ error.message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endspaceless %}
{% endblock form_errors %}
{% block _formatter__aggregator_placement_csv_formatter_row %}
<h3>{{ form_label(form) }}</h3>
{{ form_row(form.order) }}
{{ form_row(form.position) }}
{% endblock %}