From b3792f67147daedf9ab4ca487c9ec7e4678b251e Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 18 Jun 2021 13:46:46 +0200 Subject: [PATCH] person: update person view/show twig --- .../DependencyInjection/Configuration.php | 3 +- .../Resources/views/Person/view.html.twig | 81 +++++++++++++++---- .../translations/messages.fr.yml | 3 + 3 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php index 3ebe3ceb1..927612d5f 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php @@ -78,6 +78,7 @@ class Configuration implements ConfigurationInterface ->append($this->addFieldNode('address')) ->append($this->addFieldNode('accompanying_period')) ->append($this->addFieldNode('memo')) + ->append($this->addFieldNode('number_of_children')) ->arrayNode('alt_names') ->defaultValue([]) ->arrayPrototype() @@ -130,7 +131,7 @@ class Configuration implements ConfigurationInterface { $tree = new TreeBuilder($key,'enum'); $node = $tree->getRootNode($key); - + switch($key) { case 'accompanying_period': $info = "If the accompanying periods are shown"; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig index 796a7f82e..6176864a0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig @@ -73,12 +73,14 @@ This view should receive those arguments:
{{ 'Gender'|trans }} :
{{ ( person.gender|default('Not given'))|trans }}
+ + {% if not person.genderComment.isEmpty %} +
{{ 'Gender comment'|trans }} :
+
{{ person.genderComment|chill_entity_render_box }}
+ {% endif %} + - - {% if is_granted('CHILL_PERSON_UPDATE', person) %} - {{ include(edit_tmp_name, edit_tmp_args) }} - {% endif %} @@ -114,11 +116,14 @@ This view should receive those arguments: {% endif %} {% endapply %} {%- endif -%} + + {% if person.deathdate is not null %} +
{{ 'Date of death'|trans }} :
+
{{ person.deathdate|format_date('long') }}
+ {% endif %} + - {% if is_granted('CHILL_PERSON_UPDATE', person) %} - {{ include(edit_tmp_name, edit_tmp_args) }} - {% endif %} @@ -155,6 +160,21 @@ This view should receive those arguments: {%- 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}} :
@@ -165,12 +185,21 @@ This view should receive those arguments: {{ '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 -%} - {% if is_granted('CHILL_PERSON_UPDATE', person) %} - {{ include(edit_tmp_name, edit_tmp_args) }} - {% endif %} {%- endif -%} @@ -213,6 +242,13 @@ This view should receive those arguments:
{{ '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' -%} @@ -225,6 +261,13 @@ This view should receive those arguments:
{{ '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 %} @@ -253,9 +296,6 @@ This view should receive those arguments: {%- endif -%} - {% if is_granted('CHILL_PERSON_UPDATE', person) %} - {{ include(edit_tmp_name, edit_tmp_args) }} - {% endif %} {%- endif -%} @@ -272,14 +312,21 @@ This view should receive those arguments:
- - {% if is_granted('CHILL_PERSON_UPDATE', person) %} - {{ include(edit_tmp_name, edit_tmp_args) }} - {% endif %}
{% endif %} +{% if is_granted('CHILL_PERSON_UPDATE', person) %} + +{% endif %} + {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index ee5812571..fbfc35f82 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -23,6 +23,7 @@ nationality: nationalité 'Without nationality': 'Sans nationalité' Gender: Genre gender: genre +Gender comment: Remarque sur le genre 'Creation date': 'Date d''ouverture' 'Not given': 'Non renseigné' 'Place of birth': 'Lieu de naissance' @@ -39,6 +40,7 @@ Comment on the marital status: Commentaires sur l'état civil 'National number': 'Numéro national' Email: 'Courrier électronique' Accept emails ?: Accepte les courriels? +Accept emails: Peut être contacté par email Address: Adresse Memo: Mémo Phonenumber: 'Numéro de téléphone' @@ -46,6 +48,7 @@ phonenumber: numéro de téléphone Mobilenumber: 'Numéro de téléphone portable' mobilenumber: numéro de téléphone portable Accept short text message ?: Accepte les SMS? +Accept short text message: Accepte les SMS Other phonenumber: Autre numéro de téléphone Description: description Add new phone: Ajouter un numéro de téléphone