mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
update twig template and AddressType following the changes in Address entity
This commit is contained in:
parent
ebff36d257
commit
05d3d7f5c7
@ -367,12 +367,12 @@ class Address
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNumber(): ?string
|
public function getStreetNumber(): ?string
|
||||||
{
|
{
|
||||||
return $this->streetNumber;
|
return $this->streetNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNumber(string $streetNumber): self
|
public function setStreetNumber(string $streetNumber): self
|
||||||
{
|
{
|
||||||
$this->streetNumber = $streetNumber;
|
$this->streetNumber = $streetNumber;
|
||||||
|
|
||||||
|
@ -45,10 +45,10 @@ class AddressType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('streetAddress1', TextType::class, array(
|
->add('street', TextType::class, array(
|
||||||
'required' => !$options['has_no_address'] // true if has no address is false
|
'required' => !$options['has_no_address'] // true if has no address is false
|
||||||
))
|
))
|
||||||
->add('streetAddress2', TextType::class, array(
|
->add('streetNumber', TextType::class, array(
|
||||||
'required' => false
|
'required' => false
|
||||||
))
|
))
|
||||||
->add('postCode', PostalCodeType::class, array(
|
->add('postCode', PostalCodeType::class, array(
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
|
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="chill_address_address">
|
<div class="chill_address_address">
|
||||||
{% if address.streetAddress1 is not empty %}<p class="street street1">{{ address.streetAddress1 }}</p>{% endif %}
|
{% if address.street is not empty %}<p class="street street1">{{ address.street }}</p>{% endif %}
|
||||||
{% if address.streetAddress2 is not empty %}<p class="street street2">{{ address.streetAddress2 }}</p>{% endif %}
|
{% if address.streetNumber is not empty %}<p class="street street2">{{ address.streetNumber }}</p>{% endif %}
|
||||||
{% if address.postCode is not empty %}
|
{% if address.postCode is not empty %}
|
||||||
<p class="postalCode"><span class="code">{{ address.postCode.code }}</span> <span class="name">{{ address.postCode.name }}</span></p>
|
<p class="postalCode"><span class="code">{{ address.postCode.code }}</span> <span class="name">{{ address.postCode.name }}</span></p>
|
||||||
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
|
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
{{ form_row(form.isNoAddress) }}
|
{{ form_row(form.isNoAddress) }}
|
||||||
{{ form_row(form.streetAddress1) }}
|
{{ form_row(form.street) }}
|
||||||
{{ form_row(form.streetAddress2) }}
|
{{ form_row(form.streetNumber) }}
|
||||||
{{ form_row(form.postCode) }}
|
{{ form_row(form.postCode) }}
|
||||||
{{ form_row(form.validFrom) }}
|
{{ form_row(form.validFrom) }}
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
{{ form_row(form.isNoAddress) }}
|
{{ form_row(form.isNoAddress) }}
|
||||||
{{ form_row(form.streetAddress1) }}
|
{{ form_row(form.street) }}
|
||||||
{{ form_errors(form.streetAddress1) }}
|
{{ form_errors(form.street) }}
|
||||||
{{ form_row(form.streetAddress2) }}
|
{{ form_row(form.streetNumber) }}
|
||||||
{{ form_errors(form.streetAddress2) }}
|
{{ form_errors(form.streetNumber) }}
|
||||||
{{ form_row(form.postCode) }}
|
{{ form_row(form.postCode) }}
|
||||||
{{ form_errors(form.postCode) }}
|
{{ form_errors(form.postCode) }}
|
||||||
{{ form_row(form.validFrom) }}
|
{{ form_row(form.validFrom) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user