fix bug with bootstrap form theme textarea (horizontal layout mode)

cfr issue https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/182
+ make chill fields theme more responsive
This commit is contained in:
Mathieu Jaumotte 2021-07-26 17:56:44 +02:00
parent a6266c5317
commit 376d8df55e
4 changed files with 47 additions and 43 deletions

View File

@ -108,8 +108,6 @@
{{ chill_pagination(paginator) }}
{% endif %}
{% form_theme form_add_event_participation_by_person 'bootstrap_4_layout.html.twig' %}
<div class="input-group mb-3">
{{ form_start(form_add_event_participation_by_person) }}
{#
@ -137,4 +135,4 @@
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -3,9 +3,7 @@
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
{% block title 'Participation creation'|trans %}
{% form_theme form _self %}
{% block _collection_row %}
<tr>
<td>
@ -28,10 +26,10 @@
</tr>
</tbody>
</table>
{% include 'ChillEventBundle:Participation:_ignored_participations.html.twig' with ignored_participations %}
{{ form_start(form) }}
{{ form_start(form) }}
<table>
<thead>
<tr>
@ -47,10 +45,10 @@
<td>{{ form_widget(participationField.role) }}</td>
<td>{{ form_widget(participationField.status) }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_event__event_show', { 'event_id' : participations[0].event.id } ) }}" class="btn btn-cancel">
@ -61,7 +59,7 @@
{{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-create' } } ) }}
</li>
</ul>
{{ form_end(form) }}
{% endblock %}

View File

@ -60,14 +60,22 @@
{{- form_errors(form) -}}
</div>
{%- else -%}
{{- form_label(form) -}}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% if form.vars.hideLabel is not defined or form.vars.hideLabel == false %}
{{- form_label(form) -}}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% else %}
<div class="col-sm">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% endif %}
{%- endif -%}
{##}</div>
</div>
{%- endif -%}
{%- endblock form_row %}

View File

@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* 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
@ -23,11 +23,11 @@
<div class="row">
<div class="{% apply spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
col-12
col-sm-12
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-md-4 clear
col-sm-2 col-md-4 clear
{% else %}
col-4 clear
col-sm-4 clear
{% endif %}
{% endapply %}">
{% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %}
@ -36,13 +36,13 @@
</div>
<div class="{% apply spaceless %}
{% if attr.class is defined and 'cf-title' in attr.class %}
col-12
col-sm-12
{% elseif attr.class is defined and 'cf-fields' in attr.class %}
col-12 parent
col-sm-12 parent
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-md-8 multiple-cf-inline
col-sm-2 col-md-8 multiple-cf-inline
{% else %}
col-8
col-sm-8
{% endif %}
{% endapply %}">
{{ form_widget(form) }}
@ -55,7 +55,7 @@
{% endif %}
{% endapply %}
{% endblock form_row %}
{% block choice_widget_expanded %}
{% apply spaceless %}
<div {{ block('widget_container_attributes') }} class="choice-widget-expanded">
@ -125,7 +125,7 @@
</div>
{%- endif -%}
{%- endblock time_widget -%}
{% block form_errors %}
{% apply spaceless %}
{% if errors|length > 0 %}
@ -140,27 +140,27 @@
{% 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="list-entry"
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') }}"
<ul class="list-entry"
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="entry" data-collection-is-persisted="1">
@ -172,14 +172,14 @@
</ul>
{% if form.vars.allow_add == 1 %}
<button class="add-entry btn btn-misc"
data-collection-add-target="{{ form.vars.name|escape('html_attr') }}"
<button class="add-entry btn btn-misc"
data-collection-add-target="{{ form.vars.name|escape('html_attr') }}"
data-form-prototype="{{ ('<div>' ~ form_widget(form.vars.prototype) ~ '</div>')|escape('html_attr') }}" >
<i class="fa fa-plus fa-fw"></i>
{{ form.vars.button_add_label|trans }}
</button>
{% endif %}
</div>
{% endblock %}