From 13feb3b212087b04318de2a394f3eea8d5ddbced Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 21 Apr 2023 19:25:24 +0200 Subject: [PATCH] [twig][templates] introduce an option in adress_entity_render to display or not the address details button --- .../Resources/public/chill/scss/render_box.scss | 1 + .../Resources/views/Entity/address.html.twig | 15 +++++++++++++-- .../Resources/views/Household/banner.html.twig | 3 ++- .../Resources/views/Household/summary.html.twig | 6 +++++- .../Resources/views/Person/banner.html.twig | 3 ++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss index 19da5aed3..57fa17648 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss @@ -64,6 +64,7 @@ section.chill-entity { margin: 0.7em 0; p { display: block; + margin-bottom: 0; } } &.delimiter { diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig index 7592e9a9a..f0967ef64 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/address.html.twig @@ -10,6 +10,7 @@ * has_no_address bool * multiline bool multiline display * extended_infos bool add extra informations (step, floor, etc.) DEPRECATED + * details_button bool add an address details button #} @@ -79,7 +80,12 @@ {% endif %} {{ _self.inline(address, options, streetLine, lines) }} - + {% if options['details_button'] is defined and options['details_button'] == true %} + + + {% endif %} {%- endif -%} @@ -112,7 +118,12 @@ {% endif %} {{ _self.raw(lines) }} -

+ {% if options['details_button'] is defined and options['details_button'] == true %}

+ +

+ {% endif %} {% endif %} {{ _self.validity(address, options) }} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig index 50822794c..ce9105795 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/banner.html.twig @@ -58,7 +58,8 @@ {% else %} {{ address|chill_entity_render_box({ - 'render': 'inline', 'multiline': false, 'with_picto': true, 'with_delimiter': true + 'render': 'inline', 'multiline': false, 'with_picto': true, 'with_delimiter': true, + 'details_button': false }) }} {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig index bdf06c0bd..4f4a0841d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig @@ -23,7 +23,11 @@ {% if address is empty %}

{{ 'household.Household does not have any address currently'|trans }}

{% else %} - {{ address|chill_entity_render_box({'multiline': true, 'extended_infos': true }) }} + {{ address|chill_entity_render_box({ + 'multiline': true, + 'extended_infos': true, + 'details_button': true + }) }} {% endif %}