addresses: person address history

This commit is contained in:
nobohan 2021-06-11 16:20:40 +02:00
parent f3a7556bca
commit c378f59f5a
4 changed files with 157 additions and 139 deletions

View File

@ -47,7 +47,7 @@ export default {
}; };
if (address.selected.address.point !== undefined){ if (address.selected.address.point !== undefined){
createdAddress = Object.assign(createdAddress, { newAddress = Object.assign(newAddress, {
'point': address.selected.address.point.coordinates 'point': address.selected.address.point.coordinates
}); });
} }
@ -57,7 +57,7 @@ export default {
newPostalCode = Object.assign(newPostalCode, { newPostalCode = Object.assign(newPostalCode, {
'country': {'id': address.selected.country.id }, 'country': {'id': address.selected.country.id },
}); });
createdAddress = Object.assign(createdAddress, { newAddress = Object.assign(newAddress, {
'newPostalCode': newPostalCode 'newPostalCode': newPostalCode
}); });
} }

View File

@ -92,75 +92,77 @@ div.person-view {
* HOUSEHOLD * HOUSEHOLD
*/ */
div.household {
div.household__address { div.household__address, div.person__address {
div.row { div.row {
height: 100px; height: 100px;
width: 100%; width: 100%;
position: relative; position: relative;
& > div { & > div {
position: absolute; position: absolute;
display: table; 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%; height: 100%;
border: 1px dotted #c3c3c3; width: 100%;
} margin-left: 50%;
div.household__address--date { div.pill {
width: 30%; position: absolute;
background-color: #c3c3c3;
height: 100%;
div.cell {
box-sizing: border-box; box-sizing: border-box;
position: relative; width: 120px;
height: 100%; height: 40px;
width: 100%; bottom: -20px;
margin-left: 50%; background-color: white;
div.pill { padding: 10px;
position: absolute; border-radius: 30px;
box-sizing: border-box; left: -60px;
width: 120px; text-align: center;
height: 40px; z-index: 10;
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;
}
} }
} }
} }
} div.household__address--content, div.person__address--content {
div.household__address-move { width: 70%;
div.household__address-move__create { left: 30%;
display: flex; text-align: left;
flex-direction: row; 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;
}
}

View File

@ -26,64 +26,76 @@
<h1>{{ 'Addresses\'history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}</h1> <h1>{{ 'Addresses\'history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}</h1>
<table class="records_list"> <div class="person__address">
<thead>
<tr> <div class="row">
<th>{{ 'Valid from'|trans }}</th> <div class="person__address--date"></div>
<th>{{ 'Address'|trans }}</th> <div class="person__address--content">
<th>&nbsp;</th> <div class="cell">
</tr> <div>
</thead> {% if person.addresses|length == 0 %}
<tbody> <span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{% if person.addresses|length == 0 %} {% endif %}
<tr> <a class="sc-button bt-create"
<td colspan="3"> href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
{{ 'Add an address'|trans }} {{ 'Add an address'|trans }}
</a> </a>
</td> </div>
</tr> </div>
{% else %} </div>
{% for address in person.addresses %} </div>
<tr>
<td><strong>{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}</strong></td>
<td> {% for address in person.addresses %}
{{ address_macros._render(address, { 'with_valid_from' : false, 'has_no_address': true } ) }} <div class="row">
</td> <div class="person__address--date">
<div class="cell">
<div class="pill">
{% if address.validFrom is not empty %}
{{ address.validFrom|format_date('long') }}
{% endif %}
</div>
</div>
</div>
<div class="person__address--content">
<div class="cell">
<i class="dot"></i>
<div>
{% if address.isNoAddress == true %}
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
{% else %}
<div>
{% if address.street is not empty %}
<div class="street">
<i class="fa fa-fw fa-map-marker"></i>
<span class="streetNumber">{{ address.street }}</span>
{% if address.streetNumber is not empty %}
<span class="streetNumber">, {{ address.streetNumber }}</span>
{% endif %}
</div>
{% endif %}
{% if address.postCode is not empty %}
<div class="postCode">
<span>{{ address.postCode.code }}</span> <span>{{ address.postCode.name }}</span>
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
</div>
{% endif %}
</div>
{% endif %}
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<td> <ul class="record_actions">
<ul class="record_actions"> <li class="cancel">
<li> <a href="{{ path('chill_person_view', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a> {{ 'Back to the person details'|trans }}
</li> </a>
</ul> </li>
</td> </ul>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_person_view', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Back to the person details'|trans }}
</a>
</li>
<li>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="sc-button bt-create">
{{ 'Add an address'|trans }}
</a>
</li>
</ul>
{% endblock personcontent %} {% endblock personcontent %}

View File

@ -12,7 +12,7 @@
<div class="household__address--date"></div> <div class="household__address--date"></div>
<div class="household__address--content"> <div class="household__address--content">
<div class="cell"> <div class="cell">
<a class="sc-button bt-update" <a class="sc-button bt-create"
href="{{ chill_path_add_return_path('chill_person_household_address_move', { 'household_id': household.id }) }}"> href="{{ chill_path_add_return_path('chill_person_household_address_move', { 'household_id': household.id }) }}">
{{ 'Move household'|trans }} {{ 'Move household'|trans }}
</a> </a>
@ -34,25 +34,29 @@
<div class="household__address--content"> <div class="household__address--content">
<div class="cell"> <div class="cell">
<i class="dot"></i> <i class="dot"></i>
{% if address.isNoAddress == true %} <div>
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div> {% if address.isNoAddress == true %}
{% else %} <div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
{% if address.street is not empty %} {% else %}
<div class="street"> <div>
<i class="fa fa-fw fa-map-marker"></i> {% if address.street is not empty %}
<span class="streetNumber">{{ address.street }}</span> <div class="street">
{% if address.streetNumber is not empty %} <i class="fa fa-fw fa-map-marker"></i>
<span class="streetNumber">, {{ address.streetNumber }}</span> <span class="streetNumber">{{ address.street }}</span>
{% if address.streetNumber is not empty %}
<span class="streetNumber">, {{ address.streetNumber }}</span>
{% endif %}
</div>
{% endif %}
{% if address.postCode is not empty %}
<div class="postCode">
<span>{{ address.postCode.code }}</span> <span>{{ address.postCode.name }}</span>
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
</div>
{% endif %}
</div>
{% endif %} {% endif %}
</div> </div>
{% endif %}
{% if address.postCode is not empty %}
<div class="postCode">
<span>{{ address.postCode.code }}</span> <span>{{ address.postCode.name }}</span>
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
</div>
{% endif %}
{% endif %}
</div> </div>
</div> </div>
</div> </div>