From 2916babe1cd9f33521dd6d43f64b00d47de87bdf Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Sat, 20 Mar 2021 23:41:58 +0100 Subject: [PATCH] bootstrap content with vertical right person menu --- .../public/modules/bootstrap/_custom.scss | 25 +- .../modules/bootstrap/custom/_variables.scss | 8 +- .../Resources/views/layout.html.twig | 8 +- .../views/layoutWithVerticalMenu.html.twig | 10 +- .../Resources/views/Form/go_to_form.html.twig | 2 +- .../Resources/views/Person/view.html.twig | 495 ++++++++---------- .../Resources/views/layout.html.twig | 2 +- 7 files changed, 258 insertions(+), 292 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss index b881080c8..d3359a0fe 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/_custom.scss @@ -7,9 +7,32 @@ h1, h2, .h1, .h2 { } .open_sansbold { - + font-weight: bold; } +.chill-user-quote { + border-left: 10px solid #eec84a; + margin: 1.5em 10px; + padding: .5em 10px; + quotes: "\201C" "\201D" "\2018" "\2019"; + background-color: #e6e6e6; +} + +div.chill_address { + div.chill_address_address { + margin: .7em 0; + font-size: 98%; + font-variant: small-caps; + p { + display: inline-block; + margin: 0 0 0 1.5em; + text-indent: -1.5em; + } + } +} + + + html, body { min-height: 100%; height: 100%; diff --git a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/custom/_variables.scss b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/custom/_variables.scss index 60401fb8c..0b6bf2a82 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/custom/_variables.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/modules/bootstrap/custom/_variables.scss @@ -70,7 +70,7 @@ $colors: map-merge( ); $primary: $blue; -$secondary: $gray-600; +$secondary: $gray-200; $success: $green; $info: $yellow; $warning: $orange; @@ -128,7 +128,7 @@ $enable-hover-media-query: false !default; // Deprecated, no $enable-grid-classes: true !default; $enable-pointer-cursor-for-buttons: true !default; $enable-print-styles: true !default; -$enable-responsive-font-sizes: false !default; +$enable-responsive-font-sizes: true !default; $enable-validation-icons: true !default; $enable-deprecation-messages: true !default; @@ -996,9 +996,9 @@ $modal-scale-transform: scale(1.02) !default; $alert-padding-y: .75rem !default; $alert-padding-x: 1.25rem !default; $alert-margin-bottom: 1rem !default; -$alert-border-radius: $border-radius !default; +$alert-border-radius: 0 !default; $alert-link-font-weight: $font-weight-bold !default; -$alert-border-width: $border-width !default; +$alert-border-width: 0 !default; $alert-bg-level: -10 !default; $alert-border-level: -9 !default; diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index 5fa02d260..614add288 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -111,9 +111,10 @@
{% block sublayout_containter %}
+
{# Flash messages ! #} {% for flashMessage in app.session.flashbag.get('success') %} -
+
{{ flashMessage|raw }} @@ -121,7 +122,7 @@ {% endfor %} {% for flashMessage in app.session.flashbag.get('error') %} -
+
{{ flashMessage|raw }} @@ -129,7 +130,7 @@ {% endfor %} {% for flashMessage in app.session.flashbag.get('notice') %} -
+
{{ flashMessage|raw }} @@ -154,6 +155,7 @@ {{ chill_widget('homepage', {} ) }}
{% endblock %} +
{% endblock %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig index 70c91d109..9a5f27803 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig @@ -28,9 +28,10 @@
{# Flash messages ! #} -
+
+
{% for flashMessage in app.session.flashbag.get('success') %} -
+
{{ flashMessage|raw }} @@ -38,7 +39,7 @@ {% endfor %} {% for flashMessage in app.session.flashbag.get('error') %} -
+
{{ flashMessage|raw }} @@ -46,12 +47,13 @@ {% endfor %} {% for flashMessage in app.session.flashbag.get('notice') %} -
+
{{ flashMessage|raw }}
{% endfor %} +
{% block layout_wvm_content %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Form/go_to_form.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Form/go_to_form.html.twig index 8e72a48e2..78c65fc34 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Form/go_to_form.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Form/go_to_form.html.twig @@ -1 +1 @@ -{{ 'Edit'|trans|upper }} \ No newline at end of file +{{ 'Edit'|trans|upper }} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig index 76c6437d5..1cdae73b0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig @@ -39,298 +39,237 @@ This view should receive those arguments: {% block personcontent %}
+
-
- {% if person.memo is not empty and chill_person.fields.memo == 'visible' %} -
-
-

{{ 'Memo'|trans }}

-
+
+
+ {% if person.memo is not empty and chill_person.fields.memo == 'visible' %} +
+
+

{{ 'Memo'|trans }}

- {#

{{ person.memo|nl2br }}

#} -
- {{ person.memo|chill_markdown_to_html }} +
+ {{ person.memo|chill_markdown_to_html }} +
+ +
+
+ {% endif %} +
+
+

{{ 'General information'|trans }}

+ +
+
{{ 'First name'|trans }} :
+
{{ person.firstName }}
+ +
{{ 'Last name'|trans }} :
+
{{ person.lastName }}
+ {% for el in person.altNames %} + {% if el.key in alt_names|keys %} +
{{ alt_names[el.key]|localize_translatable_string }} :
+
{{ el.label }}
+ {% endif %} + {% endfor %} + +
{{ 'Gender'|trans }} :
+
{{ ( person.gender|default('Not given'))|trans }}
+
+ + + {% if is_granted('CHILL_PERSON_UPDATE', person) %} + {{ include(edit_tmp_name, edit_tmp_args) }} + {% endif %} +
+
+ +
+
+

 {{ 'Birth information'|trans }}

+ +
+
{{ 'Date of birth'|trans }} :
+
+ {%- if person.birthdate is not null -%} + {{ person.birthdate|format_date('long') }} + {%- else -%} + {{ 'Unknown date of birth'|trans }} + {%- endif -%} +
+ + {%- if chill_person.fields.place_of_birth == 'visible' -%} +
{{ 'Place of birth'|trans }} :
+ {% if person.placeOfBirth is not empty %} +
{{ person.placeOfBirth }}
+ {% else %} +
{{ 'Not given'|trans }}
+ {% endif %} + {%- endif -%} + {%- if chill_person.fields.country_of_birth == 'visible' -%} +
{{ 'Country of birth'|trans }} :
+
{% apply spaceless %} + {% if person.countryOfBirth is not null %} + {{ person.countryOfBirth.name|localize_translatable_string }} + {% else %} + {{ 'Unknown country of birth'|trans }} + {% endif %} + {% endapply %}
+ {%- endif -%} +
+ + {% if is_granted('CHILL_PERSON_UPDATE', person) %} + {{ include(edit_tmp_name, edit_tmp_args) }} + {% endif %} +
+
+
-
- {% endif %} -
-
-

{{ 'General information'|trans }}

+
+
+ {%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%} +
+
+

{{ 'Administrative information'|trans }}

-
-
{{ 'First name'|trans }} :
-
{{ person.firstName }}
+ {%- if chill_person.fields.nationality == 'visible' -%} +
+
{{ 'Nationality'|trans }} :
+
+ {% if person.nationality is not null %} + {{ person.nationality.name|localize_translatable_string }} + {% else %} + {{ 'Without nationality'|trans }} + {% endif %} +
+
+ {%- endif -%} + {%- if chill_person.fields.spoken_languages == 'visible' -%} +
+
{{'Spoken languages'|trans}} :
+
+ {% if person.spokenLanguages|length == 0 %} + {{ 'Unknown spoken languages'|trans }} + {% else %} + {% for lang in person.spokenLanguages %} + {{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %} + {% endfor %} + {% endif %} +
+
+ {%- endif -%} + {%- if chill_person.fields.marital_status == 'visible' -%} +
+
{{'Marital status'|trans}} :
+
+ {% if person.maritalStatus is not null %} + {{ person.maritalStatus.name|localize_translatable_string }} + {% else %} + {{ 'No data given'|trans }} + {% endif %} +
+
+ {%- endif -%} -
{{ 'Last name'|trans }} :
-
{{ person.lastName }}
- {% for el in person.altNames %} - {% if el.key in alt_names|keys %} -
{{ alt_names[el.key]|localize_translatable_string }} :
-
{{ el.label }}
- {% endif %} - {% endfor %} - -
{{ 'Gender'|trans }} :
-
{{ ( person.gender|default('Not given'))|trans }}
- - {% if not person.genderComment.isEmpty %} -
{{ 'Gender comment'|trans }} :
-
{{ person.genderComment|chill_entity_render_box }}
- {% endif %} - -
- -
-
- -
-
-

 {{ 'Birth information'|trans }}

- -
-
{{ 'Date of birth'|trans }} :
-
- {%- if person.birthdate is not null -%} - {{ person.birthdate|format_date('long') }} - {%- else -%} - {{ 'Unknown date of birth'|trans }} - {%- endif -%} -
- - {%- if chill_person.fields.place_of_birth == 'visible' -%} -
{{ 'Place of birth'|trans }} :
- {% if person.placeOfBirth is not empty %} -
{{ person.placeOfBirth }}
- {% else %} -
{{ 'Not given'|trans }}
- {% endif %} + {% if is_granted('CHILL_PERSON_UPDATE', person) %} + {{ include(edit_tmp_name, edit_tmp_args) }} + {% endif %} +
+
{%- endif -%} - {%- if chill_person.fields.country_of_birth == 'visible' -%} -
{{ 'Country of birth'|trans }} :
-
{% apply spaceless %} - {% if person.countryOfBirth is not null %} - {{ person.countryOfBirth.name|localize_translatable_string }} - {% else %} - {{ 'Unknown country of birth'|trans }} - {% endif %} - {% endapply %}
+ {%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' or chill_person.fields.mobilenumber == 'visible' or chill_person.fields.contact_info == 'visible' -%} +
+
+

 {{ 'Contact information'|trans }}

+ + {%- if chill_person.fields.address == 'visible' -%} +
+
{{ 'Address'|trans }}
+
+ {%- if person.lastAddress is not empty -%} + {{ address._render(person.lastAddress, {'has_no_address': true}) }} + + + + {%- else -%} + {{ 'No address given'|trans }} + + {{ 'Add an address'|trans }} + + {%- endif -%} +
+
+ {%- endif -%} + + + {%- if chill_person.fields.email == 'visible' -%} +
+
{{ 'Email'|trans }} :
+
{% if person.email is not empty %}
{{ person.email|nl2br }}
{% else %}{{ 'No data given'|trans }}{% endif %}
+
+ {%- endif -%} + {%- if chill_person.fields.phonenumber == 'visible' -%} +
+
{{ 'Phonenumber'|trans }} :
+
{% if person.phonenumber is not empty %}
{{ person.phonenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
+
+ {% endif %} + {%- if chill_person.fields.mobilenumber == 'visible' -%} +
+
{{ 'Mobilenumber'|trans }} :
+
{% if person.mobilenumber is not empty %}
{{ person.mobilenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
+
+ {% endif %} + {%- if chill_person.fields.contact_info == 'visible' -%} +
+
{{ 'Notes on contact information'|trans }} :
+
{% if person.contactInfo is not empty %}{{ person.contactInfo|nl2br }}{% else %}{{ 'No data given'|trans }}{% endif %}
+
+ {%- endif -%} + + {% if is_granted('CHILL_PERSON_UPDATE', person) %} + {{ include(edit_tmp_name, edit_tmp_args) }} + {% endif %} +
+
{%- endif -%} +
+
- {% if person.deathdate is not null %} -
{{ 'Date of death'|trans }} :
-
{{ person.deathdate|format_date('long') }}
- {% endif %} + {% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %} +
+
+
+
+ {{ chill_custom_fields_group_widget(person.cFData, cFGroup) }} +
+
+
+
- - -
-
-
- -
- {%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%} -
-
-

{{ 'Administrative information'|trans }}

- - {%- if chill_person.fields.nationality == 'visible' -%} -
-
{{ 'Nationality'|trans }} :
-
- {% if person.nationality is not null %} - {{ person.nationality.name|localize_translatable_string }} - {% else %} - {{ 'Without nationality'|trans }} - {% endif %} -
-
- {%- endif -%} - {%- if chill_person.fields.spoken_languages == 'visible' -%} -
-
{{'Spoken languages'|trans}} :
-
- {% if person.spokenLanguages|length == 0 %} - {{ 'Unknown spoken languages'|trans }} - {% else %} - {% for lang in person.spokenLanguages %} - {{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %} - {% endfor %} - {% endif %} -
-
- {%- endif -%} - - - {%-if chill_person.fields.number_of_children == 'visible' -%} -
-
{{'Number of children'|trans}} :
-
- {% if person.numberOfChildren is not null %} - {{ person.numberOfChildren }} - {% else %} - {{ 'No data given'|trans }} - {% endif %} -
-
- {%- endif -%} - - {%- if chill_person.fields.marital_status == 'visible' -%} -
-
{{'Marital status'|trans}} :
-
- {% if person.maritalStatus is not null %} - {{ person.maritalStatus.name|localize_translatable_string }} - {% else %} - {{ 'No data given'|trans }} - {% endif %} -
-
-
-
{{'Date of last marital status change'|trans}} :
- {% if person.maritalStatusDate is not null %} -
- {{ person.maritalStatusDate|format_date('long') }} -
- {% endif %} -
-
- {% if not person.maritalStatusComment.isEmpty %} -
{{'Comment on the marital status'|trans}} :
-
- {{ person.maritalStatusComment|chill_entity_render_box }} -
- {% endif %} -
- {%- endif -%} - -
-
- {%- endif -%} - {%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' or chill_person.fields.mobilenumber == 'visible' or chill_person.fields.contact_info == 'visible' -%} -
-
-

 {{ 'Contact information'|trans }}

- - {%- if chill_person.fields.address == 'visible' -%} -
-
{{ 'Address'|trans }}
-
- {%- if person.lastAddress is not empty -%} - {{ address._render(person.lastAddress, {'has_no_address': true}) }} - - - {%- else -%} - {{ 'No address given'|trans }} - - {{ 'Add an address'|trans }} - - {%- endif -%} -
-
- {%- endif -%} - - - {%- if chill_person.fields.email == 'visible' -%} -
-
{{ 'Email'|trans }} :
-
{% if person.email is not empty %}{{ person.email }}{% else %}{{ 'No data given'|trans }}{% endif %}
- {%- if person.email is not empty and person.acceptEmail -%} -
- - {{- 'Accept emails'|trans -}} - -
- {%- endif -%} -
- {%- endif -%} - {%- if chill_person.fields.phonenumber == 'visible' -%} -
-
{{ 'Phonenumber'|trans }} :
-
{% if person.phonenumber is not empty %}
{{ person.phonenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
-
- {% endif %} - {%- if chill_person.fields.mobilenumber == 'visible' -%} -
-
{{ 'Mobilenumber'|trans }} :
-
{% if person.mobilenumber is not empty %}
{{ person.mobilenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
- {%- if person.mobilenumber is not empty and person.acceptSMS -%} -
- - {{- 'Accept short text message'|trans -}} - -
- {%- endif -%} -
- {% endif %} - {% for pp in person.otherPhoneNumbers %} -
{{ 'Other phonenumber'|trans }} :
-
-
{{ pp.phoneNumber|chill_format_phonenumber }}
- {% if pp.description is not empty %} -
- {{ pp.description|nl2br }} - {% endif %} -
-
- {% endfor %} - {%- if chill_person.fields.contact_info == 'visible' -%} -
-
{{ 'Notes on contact information'|trans }} :
-
- {% if person.contactInfo is not empty %} -
- {{ person.contactInfo|chill_markdown_to_html }} -
- {% else %} - {{ 'No data given'|trans }} - {% endif %} -
-
- {%- endif -%} - -
-
- {%- endif -%} -
- -{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %} -
-
+
- {{ chill_custom_fields_group_widget(person.cFData, cFGroup) }} + {% if is_granted('CHILL_PERSON_UPDATE', person) %} + {{ include(edit_tmp_name, edit_tmp_args) }} + {% endif %}
+ {% endif %} +
- -
-
-
-
-{% endif %} - -{% if is_granted('CHILL_PERSON_UPDATE', person) %} - -{% endif %} -
{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/layout.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/layout.html.twig index 9ff7a5cf8..3c968f84c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/layout.html.twig @@ -124,7 +124,7 @@ {% endblock %} {% block layout_wvm_content %} -
+
{% block personcontent %}{%endblock%}
{% endblock %}