From c378f59f5a91ff26cc5fe78239c6e253c880938c Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Jun 2021 16:20:40 +0200 Subject: [PATCH] addresses: person address history --- .../Resources/public/vuejs/Address/App.vue | 4 +- .../Resources/public/sass/person.scss | 130 +++++++++--------- .../Resources/views/Address/list.html.twig | 122 ++++++++-------- .../views/Household/addresses.html.twig | 40 +++--- 4 files changed, 157 insertions(+), 139 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index 6fa12c1dc..a1ee92523 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -47,7 +47,7 @@ export default { }; if (address.selected.address.point !== undefined){ - createdAddress = Object.assign(createdAddress, { + newAddress = Object.assign(newAddress, { 'point': address.selected.address.point.coordinates }); } @@ -57,7 +57,7 @@ export default { newPostalCode = Object.assign(newPostalCode, { 'country': {'id': address.selected.country.id }, }); - createdAddress = Object.assign(createdAddress, { + newAddress = Object.assign(newAddress, { 'newPostalCode': newPostalCode }); } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss b/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss index b198f74eb..78a5cede4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/sass/person.scss @@ -92,75 +92,77 @@ div.person-view { * HOUSEHOLD */ -div.household { - div.household__address { - div.row { - height: 100px; - width: 100%; - position: relative; - & > div { - position: absolute; - display: table; + +div.household__address, div.person__address { + div.row { + height: 100px; + width: 100%; + position: relative; + & > div { + position: absolute; + display: table; + height: 100%; + border: 1px dotted #c3c3c3; + } + div.household__address--date, div.person__address--date { + width: 30%; + background-color: #c3c3c3; + height: 100%; + div.cell { + box-sizing: border-box; + position: relative; height: 100%; - border: 1px dotted #c3c3c3; - } - div.household__address--date { - width: 30%; - background-color: #c3c3c3; - height: 100%; - div.cell { + width: 100%; + margin-left: 50%; + div.pill { + position: absolute; box-sizing: border-box; - position: relative; - height: 100%; - width: 100%; - margin-left: 50%; - div.pill { - position: absolute; - box-sizing: border-box; - width: 120px; - height: 40px; - bottom: -20px; - background-color: white; - padding: 10px; - border-radius: 30px; - left: -60px; - text-align: center; - z-index: 10; - } - } - } - div.household__address--content { - width: 70%; - left: 30%; - text-align: left; - background-color: #ececec; - border: 1px solid #888; - div.cell { - display: table-cell; - padding: 5px 30px; - vertical-align: middle; - i.dot::before, i.dot::after { - position: absolute; - width: 20px; - height: 20px; - content: ''; - border: 0; - background-color: white; - border-radius: 50%; - border: 5px solid #c3c3c3; - z-index: 10; - left: -15px; - bottom: -15px; - } + width: 120px; + height: 40px; + bottom: -20px; + background-color: white; + padding: 10px; + border-radius: 30px; + left: -60px; + text-align: center; + z-index: 10; } } } - } - div.household__address-move { - div.household__address-move__create { - display: flex; - flex-direction: row; - + div.household__address--content, div.person__address--content { + width: 70%; + left: 30%; + text-align: left; + background-color: #ececec; + border: 1px solid #888; + div.cell { + display: table-cell; + padding: 5px 30px; + vertical-align: middle; + & > div { + display: flex; + justify-content: space-between; + } + i.dot::before, i.dot::after { + position: absolute; + width: 20px; + height: 20px; + content: ''; + border: 0; + background-color: white; + border-radius: 50%; + border: 5px solid #c3c3c3; + z-index: 10; + left: -15px; + bottom: -15px; + } + } } } } +div.household__address-move { + div.household__address-move__create { + display: flex; + flex-direction: row; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig index 8a2aeee42..698f1e9d0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Address/list.html.twig @@ -26,64 +26,76 @@

{{ 'Addresses\'history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}

- - - - - - - - - - {% if person.addresses|length == 0 %} - - - - {% else %} - {% for address in person.addresses %} - - + + + + + - + {% for address in person.addresses %} +
+
+
+
+ {% if address.validFrom is not empty %} + {{ address.validFrom|format_date('long') }} + {% endif %} +
+
+
+
+
+ +
+ {% if address.isNoAddress == true %} +
{{ 'address.consider homeless'|trans }}
+ {% else %} +
+ {% if address.street is not empty %} +
+ + {{ address.street }} + {% if address.streetNumber is not empty %} + , {{ address.streetNumber }} + {% endif %} +
+ {% endif %} + {% if address.postCode is not empty %} +
+ {{ address.postCode.code }} {{ address.postCode.name }} + ({{ address.postCode.country.name|localize_translatable_string }}) +
+ {% endif %} +
+ {% endif %} + +
+
+
+
+ {% endfor %} + - - + - {% endfor %} - {% endif %} - -
{{ 'Valid from'|trans }}{{ 'Address'|trans }} 
- {{ 'No address given'|trans }} - +
{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }} - {{ address_macros._render(address, { 'with_valid_from' : false, 'has_no_address': true } ) }} - -
    -
  • - -
  • -
-
- - - - - - - {% endblock personcontent %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index 26db143c0..db682e6b1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -12,7 +12,7 @@
- {{ 'Move household'|trans }} @@ -34,25 +34,29 @@
- {% if address.isNoAddress == true %} -
{{ 'address.consider homeless'|trans }}
- {% else %} - {% if address.street is not empty %} -
- - {{ address.street }} - {% if address.streetNumber is not empty %} - , {{ address.streetNumber }} +
+ {% if address.isNoAddress == true %} +
{{ 'address.consider homeless'|trans }}
+ {% else %} +
+ {% if address.street is not empty %} +
+ + {{ address.street }} + {% if address.streetNumber is not empty %} + , {{ address.streetNumber }} + {% endif %} +
+ {% endif %} + {% if address.postCode is not empty %} +
+ {{ address.postCode.code }} {{ address.postCode.name }} + ({{ address.postCode.country.name|localize_translatable_string }}) +
+ {% endif %} +
{% endif %}
- {% endif %} - {% if address.postCode is not empty %} -
- {{ address.postCode.code }} {{ address.postCode.name }} - ({{ address.postCode.country.name|localize_translatable_string }}) -
- {% endif %} - {% endif %}