mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
185 lines
7.2 KiB
Twig
185 lines
7.2 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">
|
|
document.addEventListener('load', function(e) {
|
|
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">
|
|
document.addEventListener('load', function(e) {
|
|
chill.checkNullValuesInChoices("{{ form._choices.vars.full_name }}");
|
|
});
|
|
</script>
|
|
{% endspaceless %}
|
|
{% endblock choice_with_other_widget %}
|
|
|
|
{% block money_widget %}
|
|
<div class="chill-form-money">
|
|
{{ block('form_widget_simple') }}
|
|
<span class="chill-form-money__money">{{ money_pattern|form_encode_currency }}</span>
|
|
</div>
|
|
{% endblock money_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 chill-form__errors">
|
|
{% for error in errors %}
|
|
<li class="chill-form_errors__entry {% if 'severity' in error.cause.constraint.payload|keys %}chill-form__errors__entry--{{ error.cause.constraint.payload.severity }}{% endif %}">{{ 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 %}
|
|
|
|
{% block _formatter__aggregator_placement_spreadsheet_formatter_row %}
|
|
<h3>{{ form_label(form) }}</h3>
|
|
|
|
{{ form_row(form.order) }}
|
|
|
|
{% endblock %}
|
|
|
|
{% block chill_collection_widget %}
|
|
<div class="chill-collection">
|
|
<ul class="chill-collection__list" data-collection-name="{{ form.vars.name|escape('html_attr') }}" data-collection-identifier="{{ form.vars.identifier|escape('html_attr') }}" data-collection-button-remove-label="{{ form.vars.button_remove_label|trans|e }}" data-collection-allow-add="{{ form.vars.allow_add|escape('html_attr') }}" data-collection-allow-delete="{{ form.vars.allow_delete|escape('html_attr') }}" >
|
|
{% for entry in form %}
|
|
<li class="chill-collection__list__entry" data-collection-is-persisted="1">
|
|
<div>
|
|
{{ form_widget(entry) }}
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{% if form.vars.allow_add == 1 %}
|
|
<button class="chill-collection__button--add sc-button" data-collection-add-target="{{ form.vars.name|escape('html_attr') }}" data-form-prototype="{{ ('<div>' ~ form_widget(form.vars.prototype) ~ '</div>')|escape('html_attr') }}" >{{ form.vars.button_add_label|trans }}</button>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %} |