diff --git a/package.json.txt b/package.json.txt new file mode 100644 index 000000000..58f21ac5d --- /dev/null +++ b/package.json.txt @@ -0,0 +1,3 @@ +add npm/yarn dependency in package.json : + +"select2-bootstrap-theme": "0.1.0-beta.10", diff --git a/src/Bundle/ChillMainBundle/Resources/public/main.js b/src/Bundle/ChillMainBundle/Resources/public/main.js index 41618d245..88bfbf224 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/main.js +++ b/src/Bundle/ChillMainBundle/Resources/public/main.js @@ -23,6 +23,7 @@ require('./js/collection/collections.js'); // from node-modules require('select2/dist/css/select2.css'); +require('select2-bootstrap-theme/dist/select2-bootstrap.css'); require('./modules/breadcrumb/index.js'); require('./modules/download-report/index.js'); diff --git a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss index cce66d271..24a73e933 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss @@ -15,7 +15,7 @@ h1, h2, .h1, .h2 { margin: 1.5em 10px; padding: .5em 15px; quotes: "\201C" "\201D" "\2018" "\2019"; - background-color: $gray-100; + background-color: $gray-200; blockquote { border-left: 0.4em solid $gray-400; padding-left: 0.9em; @@ -23,17 +23,47 @@ h1, h2, .h1, .h2 { font-style: italic; } } -form fieldset { - margin-top: 1em; - & > legend { - font-size: 1.438em; - font-weight: 700; - width: 100%; - border-bottom: 3px solid $gray-200; - margin-bottom: 1em; - h2 { + +@mixin title_in_form { + font-size: 1.438em; + font-weight: 700; + width: 100%; + border-bottom: 3px solid $gray-200; + margin-bottom: 1em; + display: block; +} + +form { + fieldset { + margin-top: 1em; + & > legend { + @include title_in_form; } } + /* avoid useless html in first level of the custom fields row loop in forms + * (better should to improve the loop) + */ + & > div.container-fluid { + & > div.row > .parent { + padding: 0; + & div.cf-fields span.cf-title { + margin: 1em -15px 0; + width: calc(100% + 30px); + @include title_in_form; + } + } + } +} + +.sticky-form-buttons { + margin-top: 4em; + background-color: $beige; + position: sticky; + bottom: 0.3em; + text-align: center; + display: flex; + padding: 0.8em 1.6em; + border-radius: 0; } div.chill_address { @@ -75,7 +105,7 @@ nav.navbar { } .dropdown-menu { .dropdown-item { - width: 120%; + width: 120%; i { float: right; } diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index 363073960..9732b70a5 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -172,7 +172,10 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig index 507f9e160..0904a1065 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig @@ -23,122 +23,90 @@ {% block personcontent %}

{{ 'Update details for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName|capitalize } ) }}

+ {% 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 %} -
-

{{ 'Memo'|trans }}

- {{ form_row(form.memo, {'label' : 'Memo'} ) }} -
-{% endif %} - -
-

{{ 'General information'|trans }}

- {{ 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 %} +
+

{{ 'Memo'|trans }}

+ {{ form_row(form.memo, {'label' : 'Memo'} ) }} +
{% endif %} - {{ form_row(form.gender, {'label' : 'Gender'}) }} - {{ form_row(form.genderComment, { 'label' : 'Comment on the gender'} ) }} -
-
-

{{ 'Birth information'|trans }}

- {{ 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 -%} -
+
+

{{ 'General information'|trans }}

+ {{ 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'}) }} +
-{%- if form.nationality is defined or form.spokenLanguages is defined -%} -
-

{{ 'Administrative information'|trans }}

- {%- 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 -%} -
-{%- endif -%} +
+

{{ 'Birth information'|trans }}

+ {{ 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.numberOfChildren is defined or form.maritalStatus is defined -%} -
-

{{ 'Marital status'|trans }}

- {{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }} - {%- if form.maritalStatus is defined -%} -
+ {%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%} +
+

{{ 'Administrative information'|trans }}

+ {%- 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'} ) }} -
-
- {{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }} - {{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }} -
+ {%- endif -%} +
{%- endif -%} - -{%- endif -%} -{%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contactInfo is defined-%} -
-

{{ 'Contact information'|trans }}

- {%- if form.email is defined -%} -
+ {%- if form.email is defined or form.phonenumber is defined or form.mobilenumber is defined or form.contactInfo is defined-%} +
+

{{ 'Contact information'|trans }}

+ {%- if form.email is defined -%} {{ form_row(form.email, {'label': 'Email'}) }} -
-
- {{ form_row(form.acceptEmail, {'label' : 'Accept emails ?'}) }} -
- {%- endif -%} - - {%- if form.phonenumber is defined -%} - {{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }} - {%- endif -%} - {%- if form.mobilenumber is defined -%} -
+ {%- endif -%} + {%- if form.phonenumber is defined -%} + {{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }} + {%- endif -%} + {%- if form.mobilenumber is defined -%} {{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }} -
-
- {{ form_row(form.acceptSMS, {'label' : 'Accept short text message ?'}) }} -
+ {%- endif -%} + {%- if form.contactInfo is defined -%} + {{ form_row(form.contactInfo, {'label': 'Notes on contact information'}) }} + {%- endif -%} +
{%- 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 -%} - -{%- endif -%} + + {{ form_rest(form) }} + + -{{ form_rest(form) }} - - - - - -{{ form_end(form) }} + {{ form_end(form) }} {% endblock personcontent %}