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){
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
});
}

View File

@ -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;
}
}

View File

@ -26,64 +26,76 @@
<h1>{{ 'Addresses\'history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}</h1>
<table class="records_list">
<thead>
<tr>
<th>{{ 'Valid from'|trans }}</th>
<th>{{ 'Address'|trans }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% if person.addresses|length == 0 %}
<tr>
<td colspan="3">
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
<div class="person__address">
<div class="row">
<div class="person__address--date"></div>
<div class="person__address--content">
<div class="cell">
<div>
{% if person.addresses|length == 0 %}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{% endif %}
<a class="sc-button bt-create"
href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
{{ 'Add an address'|trans }}
</a>
</td>
</tr>
{% else %}
{% for address in person.addresses %}
<tr>
<td><strong>{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}</strong></td>
</a>
</div>
</div>
</div>
</div>
<td>
{{ address_macros._render(address, { 'with_valid_from' : false, 'has_no_address': true } ) }}
</td>
{% for address in person.addresses %}
<div class="row">
<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">
<li>
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
<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>
</ul>
{% 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 %}

View File

@ -12,7 +12,7 @@
<div class="household__address--date"></div>
<div class="household__address--content">
<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 }) }}">
{{ 'Move household'|trans }}
</a>
@ -34,25 +34,29 @@
<div class="household__address--content">
<div class="cell">
<i class="dot"></i>
{% if address.isNoAddress == true %}
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
{% else %}
{% 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>
<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 %}
</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>