diff --git a/CHANGELOG.md b/CHANGELOG.md index 96703acad..38c4e1703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,4 +3,4 @@ branch master ============= * initial commit - +* add a render template for entity ThirdParty ; diff --git a/Entity/ThirdParty.php b/Entity/ThirdParty.php index 9c3a52ab5..2d01ff442 100644 --- a/Entity/ThirdParty.php +++ b/Entity/ThirdParty.php @@ -72,7 +72,7 @@ class ThirdParty * @var string|null * * @ORM\Column(name="email", type="string", length=255, nullable=true) - * @Assert\Email(checkMX=true) + * @Assert\Email(checkMX=false) */ private $email; diff --git a/Resources/config/services.yml b/Resources/config/services.yml index d66403324..c1c8fa77d 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -4,4 +4,5 @@ imports: - { resource: './services/security.yml' } - { resource: './services/3partytype.yml' } - { resource: './services/search.yml' } + - { resource: './services/templating.yml' } - { resource: './services/menu.yml' } diff --git a/Resources/config/services/templating.yml b/Resources/config/services/templating.yml new file mode 100644 index 000000000..690f6008d --- /dev/null +++ b/Resources/config/services/templating.yml @@ -0,0 +1,6 @@ +services: + Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender: + arguments: + $templating: '@templating.engine.twig' + tags: + - 'chill.render_entity' \ No newline at end of file diff --git a/Resources/views/Contact/macro.html.twig b/Resources/views/Contact/macro.html.twig index 9a7cb9343..6bcc6f553 100644 --- a/Resources/views/Contact/macro.html.twig +++ b/Resources/views/Contact/macro.html.twig @@ -1,49 +1,5 @@ {%- macro _render(contact, options) -%} - {%- set options = { 'with_valid_from' : true }|merge(options|default({})) -%} -
{{ contact.address.streetAddress1 }}
{% endif %} - {% if contact.address.streetAddress2 is not empty %}{{ contact.address.streetAddress2 }}
{% endif %} - {% if contact.address.postCode is not empty %} -{{ contact.address.postCode.code }} {{ contact.address.postCode.name }}
-{{ contact.address.postCode.country.name|localize_translatable_string }}
- {% endif %} -{{ contact.address.streetAddress1 }}
{% endif %} + {% if contact.address.streetAddress2 is not empty %}{{ contact.address.streetAddress2 }}
{% endif %} + {% if contact.address.postCode is not empty %} +{{ contact.address.postCode.code }} {{ contact.address.postCode.name }}
+{{ contact.address.postCode.country.name|localize_translatable_string }}
+ {% endif %} +