From 360322bdbffb909833ae0d9e23b92d2e87724224 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Sat, 31 Jul 2021 14:49:01 +0200 Subject: [PATCH] missing comment fields on person details page --- .../Resources/public/chill/scss/forms.scss | 5 ++ .../Resources/views/Person/view.html.twig | 66 +++++++++++++++---- .../translations/messages.fr.yml | 4 +- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss index 078e43787..0ae568244 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/forms.scss @@ -22,6 +22,11 @@ form { } } + // customfields titles in form + span.cf-title { + @include title_in_form; + } + label { display: inline; &.required:after { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig index 255add35e..aeaaeac37 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig @@ -41,11 +41,9 @@ This view should receive those arguments:

{{ 'Memo'|trans }}

-
{{ person.memo|chill_markdown_to_html }}
-
{% endif %} @@ -68,6 +66,7 @@ This view should receive those arguments:
{{ 'Gender'|trans }} :
{{ ( person.gender|default('Not given'))|trans }}
+ @@ -93,6 +92,7 @@ This view should receive those arguments:
{{ 'Not given'|trans }}
{% endif %} {%- endif -%} + {%- if chill_person.fields.country_of_birth == 'visible' -%}
{{ 'Country of birth'|trans }} :
{% apply spaceless %} @@ -106,6 +106,17 @@ This view should receive those arguments: + + {% if person.genderComment is not empty %} +
+
+

{{ 'Gender comment'|trans }} :

+
+ {{ person.genderComment.comment|chill_markdown_to_html }} +
+
+
+ {% endif %}
@@ -116,14 +127,14 @@ This view should receive those arguments: {%- 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 %} -
+
{{ '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' -%} @@ -150,6 +161,15 @@ This view should receive those arguments: {{ 'No data given'|trans }} {% endif %}
+ + {% if person.maritalStatusComment is not empty %} +
{{ 'Comment on the marital status'|trans }} :
+
+
+ {{ person.maritalStatusComment.comment|chill_markdown_to_html }} +
+
+ {% endif %} {%- endif -%} @@ -201,35 +221,55 @@ This view should receive those arguments: {%- endif -%} - {%- if chill_person.fields.email == 'visible' -%}
{{ 'Email'|trans }} :
-
{% if person.email is not empty %}
{{ person.email|nl2br }}
{% else %}{{ 'No data given'|trans }}{% endif %}
+
{% if person.email is not empty %} + + {% 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 %} + + {# TODO + display collection of others phonenumbers + #} + {%- 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 %}
+
+ {% 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) %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 57b051d68..048d4a61a 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -23,7 +23,7 @@ nationality: nationalité 'Without nationality': 'Sans nationalité' Gender: Genre gender: genre -Gender comment: Remarque sur le genre +Gender comment: Remarques sur le genre 'Creation date': 'Date d''ouverture' 'Not given': 'Non renseigné' 'Place of birth': 'Lieu de naissance' @@ -34,7 +34,7 @@ countryOfBirth: 'Pays de naissance' 'Unknown country of birth': 'Pays inconnu' 'Marital status': 'État civil' Date of last marital status change: État civil depuis le -Comment on the marital status: Commentaires sur l'état civil +Comment on the marital status: Remarques sur l'état civil 'Number of children': 'Nombre d''enfants' '{0} No child|{1} One child | ]1,Inf] %nb% children': '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants' 'National number': 'Numéro national'