mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
addresses: edit address for household (WIP)
This commit is contained in:
parent
06daf35e96
commit
5b72eeb147
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\Address;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@ -97,4 +98,26 @@ class HouseholdController extends AbstractController
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route(
|
||||||
|
* "/{household_id}/address/edit",
|
||||||
|
* name="chill_person_household_address_edit",
|
||||||
|
* methods={"GET", "HEAD", "POST"}
|
||||||
|
* )
|
||||||
|
* @ParamConverter("household", options={"id" = "household_id"})
|
||||||
|
*/
|
||||||
|
public function addressEdit(Request $request, Household $household)
|
||||||
|
{
|
||||||
|
// TODO ACL
|
||||||
|
//$address = $this->findAddressById($household, $address_id); //TODO
|
||||||
|
|
||||||
|
|
||||||
|
return $this->render('@ChillPerson/Household/address_edit.html.twig',
|
||||||
|
[
|
||||||
|
'household' => $household,
|
||||||
|
//'address' => $address,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,10 @@
|
|||||||
</add-address>
|
</add-address>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="newAddress.text">
|
<show-address
|
||||||
{{ newAddress.text }}
|
v-if="newAddress"
|
||||||
</div>
|
v-bind:address="newAddress">
|
||||||
<div v-if="newAddress.postcode">
|
</show-address>
|
||||||
{{ newAddress.postcode.name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='household__address-move__valid'>
|
<div class='household__address-move__valid'>
|
||||||
@ -45,14 +43,17 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
import AddAddress from 'ChillMainAssets/vuejs/_components/AddAddress.vue';
|
import AddAddress from 'ChillMainAssets/vuejs/_components/AddAddress.vue';
|
||||||
|
import ShowAddress from 'ChillMainAssets/vuejs/_components/ShowAddress.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
AddAddress,
|
AddAddress,
|
||||||
|
ShowAddress
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
edit: window.mode === 'edit',
|
||||||
householdId: window.householdId,
|
householdId: window.householdId,
|
||||||
backUrl: `/fr/person/household/${householdId}/addresses`, //TODO better way to pass this
|
backUrl: `/fr/person/household/${householdId}/addresses`, //TODO better way to pass this
|
||||||
validFrom: new Date().toISOString().split('T')[0]
|
validFrom: new Date().toISOString().split('T')[0]
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
{% extends '@ChillPerson/Household/layout.html.twig' %}
|
||||||
|
|
||||||
|
{% block title 'Edit household address'|trans %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{{ block('title') }}</h1>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div id="household-address"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% block stylesheets %}
|
||||||
|
<link href="{{ asset('build/address.css') }}" type="text/css" rel="stylesheet" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.householdId = {{ household.id|e('js') }};
|
||||||
|
window.addressId = {{ address.id|e('js') }};
|
||||||
|
window.mode = 'edit';
|
||||||
|
window.vueRootComponent = 'app';
|
||||||
|
</script>
|
||||||
|
{{ encore_entry_script_tags('household_address') }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -54,8 +54,10 @@
|
|||||||
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
|
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user