bootstrap style in form fields, bootstrap integration for select2

This commit is contained in:
2021-03-23 23:22:27 +01:00
parent 50727fc4b0
commit bc240a6754
5 changed files with 119 additions and 114 deletions

View File

@@ -23,122 +23,90 @@
{% block personcontent %}
<h1>{{ 'Update details for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName|capitalize } ) }}</h1>
{% form_theme form '@ChillMain/Form/fields.html.twig' %}
{% form_theme form '@ChillMain/Form/fields.html.twig' %}
{{ form_start(form) }}
{{ form_start(form) }}
{% if form.memo is defined %}
<fieldset>
<legend><h2>{{ 'Memo'|trans }}</h2></legend>
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
</fieldset>
{% endif %}
<fieldset>
<legend><h2>{{ 'General information'|trans }}</h2></legend>
{{ form_row(form.firstName, {'label' : 'First name'}) }}
{{ form_row(form.lastName, {'label' : 'Last name'}) }}
{% if form.altNames is defined %}
{{ form_widget(form.altNames, { 'label': 'Alternative names'}) }}
{% if form.memo is defined %}
<fieldset>
<legend><h2>{{ 'Memo'|trans }}</h2></legend>
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
</fieldset>
{% endif %}
{{ form_row(form.gender, {'label' : 'Gender'}) }}
{{ form_row(form.genderComment, { 'label' : 'Comment on the gender'} ) }}
</fieldset>
<fieldset>
<legend><h2>{{ 'Birth information'|trans }}</h2></legend>
{{ form_row(form.birthdate, {'label': 'Date of birth'} ) }}
{%- if form.placeOfBirth is defined -%}
{{ form_row(form.placeOfBirth, { 'label' : 'Place of birth'} ) }}
{%- endif -%}
{%- if form.countryOfBirth is defined -%}
{{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }}
{%- endif -%}
{%- if form.deathdate is defined -%}
{{ form_row(form.deathdate, { 'label' : 'Date of death' } ) }}
{%- endif -%}
</fieldset>
<fieldset>
<legend><h2>{{ 'General information'|trans }}</h2></legend>
{{ form_row(form.firstName, {'label' : 'First name'}) }}
{{ form_row(form.lastName, {'label' : 'Last name'}) }}
{% if form.altNames is defined %}
{{ form_widget(form.altNames, { 'label': 'Alternative names'}) }}
{% endif %}
{{ form_row(form.gender, {'label' : 'Gender'}) }}
</fieldset>
{%- if form.nationality is defined or form.spokenLanguages is defined -%}
<fieldset>
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
{%- if form.nationality is defined -%}
{{ form_row(form.nationality, { 'label' : 'Nationality'|trans} ) }}
{%- endif -%}
{%- if form.spokenLanguages is defined -%}
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
{%- endif -%}
</fieldset>
{%- endif -%}
<fieldset>
<legend><h2>{{ 'Birth information'|trans }}</h2></legend>
{{ form_row(form.birthdate, {'label': 'Date of birth'} ) }}
{%- if form.placeOfBirth is defined -%}
{{ form_row(form.placeOfBirth, { 'label' : 'Place of birth'} ) }}
{%- endif -%}
{%- if form.countryOfBirth is defined -%}
{{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }}
{%- endif -%}
</fieldset>
{%- if form.numberOfChildren is defined or form.maritalStatus is defined -%}
<fieldset>
<legend><h2>{{ 'Marital status'|trans }}</h2></legend>
{{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }}
{%- if form.maritalStatus is defined -%}
<div id="maritalStatus">
{%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%}
<fieldset>
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
{%- if form.nationality is defined -%}
{{ form_row(form.nationality, { 'label' : 'Nationality'|trans} ) }}
{%- endif -%}
{%- if form.spokenLanguages is defined -%}
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
{%- endif -%}
{%- if form.maritalStatus is defined -%}
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
</div>
<div id="maritalStatusDate">
{{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }}
{{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }}
</div>
{%- endif -%}
</fieldset>
{%- endif -%}
</fieldset>
{%- endif -%}
{%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contactInfo is defined-%}
<fieldset>
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{%- if form.email is defined -%}
<div id="personEmail">
{%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contactInfo is defined-%}
<fieldset>
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{%- if form.email is defined -%}
{{ form_row(form.email, {'label': 'Email'}) }}
</div>
<div id="personAcceptEmail">
{{ form_row(form.acceptEmail, {'label' : 'Accept emails ?'}) }}
</div>
{%- endif -%}
{%- if form.phonenumber is defined -%}
{{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }}
{%- endif -%}
{%- if form.mobilenumber is defined -%}
<div id="personPhoneNumber">
{%- endif -%}
{%- if form.phonenumber is defined -%}
{{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }}
{%- endif -%}
{%- if form.mobilenumber is defined -%}
{{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }}
</div>
<div id="personAcceptSMS">
{{ form_row(form.acceptSMS, {'label' : 'Accept short text message ?'}) }}
</div>
{%- endif -%}
{%- if form.contactInfo is defined -%}
{{ form_row(form.contactInfo, {'label': 'Notes on contact information'}) }}
{%- endif -%}
</fieldset>
{%- endif -%}
{%- if form.otherPhoneNumbers is defined -%}
{{ form_widget(form.otherPhoneNumbers) }}
{{ form_errors(form.otherPhoneNumbers) }}
{%- endif -%}
{%- if form.contactInfo is defined -%}
{{ form_row(form.contactInfo, {'label': 'Notes on contact information'}) }}
{%- endif -%}
</fieldset>
{%- endif -%}
{{ form_rest(form) }}
<ul class="col-12 list-inline sticky-form-buttons">
<li class="list-inline-item mr-auto">
<a href="{{ path('chill_person_view', {'person_id' : person.id}) }}" class="btn btn-secondary">
<i class="fa fa-arrow-left"></i>
{{ 'Return'|trans }}
</a>
</li>
<li class="list-inline-item">
<button class="btn btn-success" type="submit">
<i class="fa fa-fw fa-save"></i>
{{ 'Save'|trans }}
</button>
</li>
</ul>
{{ form_rest(form) }}
<ul class="col-12 list-inline sticky-form-buttons record_actions ">
<li class="list-inline-item justify-content-start">
<a href="{{ path('chill_person_view', {'person_id' : person.id}) }}" class="btn btn-secondary">
<i class="fa fa-arrow-left"></i>
{{ 'Return'|trans }}
</a>
</li>
<li class="list-inline-item justify-content-end">
<button class="btn btn-success" type="submit">{{ 'Save'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
{{ form_end(form) }}
{% endblock personcontent %}