[Attribute] Bring back attribute types templates after BC break in 1.7

This commit is contained in:
Grzegorz Sadowski 2020-05-14 12:07:21 +02:00
parent 421ad359b7
commit 7ff09f93c6
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
21 changed files with 53 additions and 54 deletions

View file

@ -1,3 +1,7 @@
# UPGRADE FROM `v1.7.4` TO `v1.7.5`
We've brought back the attribute types templates to SyliusAttributeBundle after BC break in v1.7.0.
# UPGRADE FROM `v1.6.X` TO `v1.7.0`
1. Require upgraded Sylius version using Composer:

View file

@ -1,5 +1 @@
{% if attribute.value %}
{{ 'sylius.ui.yes_label'|trans }}
{% else %}
{{ 'sylius.ui.no_label'|trans }}
{% endif %}
{% extends '@SyliusAttribute/Types/checkbox.html.twig' %}

View file

@ -1,5 +1 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_date(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_date }}
{% endif %}
{% extends '@SyliusAttribute/Types/date.html.twig' %}

View file

@ -1,5 +1 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_datetime(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_datetime }}
{% endif %}
{% extends '@SyliusAttribute/Types/datetime.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value }}
{% extends '@SyliusAttribute/Types/default.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value|sylius_percentage }}
{% extends '@SyliusAttribute/Types/percent.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value|nl2br }}
{% extends '@SyliusAttribute/Types/textarea.html.twig' %}

View file

@ -0,0 +1,5 @@
{% if attribute.value %}
{{ 'sylius.ui.yes_label'|trans }}
{% else %}
{{ 'sylius.ui.no_label'|trans }}
{% endif %}

View file

@ -0,0 +1,5 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_date(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_date }}
{% endif %}

View file

@ -0,0 +1,5 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_datetime(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_datetime }}
{% endif %}

View file

@ -0,0 +1 @@
{{ attribute.value }}

View file

@ -0,0 +1 @@
{{ attribute.value|sylius_percentage }}

View file

@ -0,0 +1,18 @@
{% if attribute.value is not null %}
{% set values = attribute.attribute.configuration.choices %}
{% if attribute.value is iterable %}
{% for value in attribute.value %}
{% if locale in values[value]|keys and values[value][locale] is not empty %}
{{ values[value][locale] }}{% if loop.last == false %}, {% endif %}
{% else %}
{{ values[value][fallbackLocale] }}{% if loop.last == false %}, {% endif %}
{% endif %}
{% endfor %}
{% else %}
{% if values[attribute.value][locale] is not empty %}
{{ values[attribute.value][locale] }}
{% elseif values[attribute.value][fallbackLocale] is not empty %}
{{ values[attribute.value][fallbackLocale] }}
{% endif %}
{% endif %}
{% endif %}

View file

@ -0,0 +1 @@
{{ attribute.value|nl2br }}

View file

@ -1,5 +1 @@
{% if attribute.value %}
{{ 'sylius.ui.yes_label'|trans }}
{% else %}
{{ 'sylius.ui.no_label'|trans }}
{% endif %}
{% extends '@SyliusAttribute/Types/checkbox.html.twig' %}

View file

@ -1,5 +1 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_date(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_date }}
{% endif %}
{% extends '@SyliusAttribute/Types/date.html.twig' %}

View file

@ -1,5 +1 @@
{% if attribute.attribute.configuration['format'] is defined %}
{{ attribute.value|format_datetime(attribute.attribute.configuration['format']) }}
{% else %}
{{ attribute.value|format_datetime }}
{% endif %}
{% extends '@SyliusAttribute/Types/datetime.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value }}
{% extends '@SyliusAttribute/Types/default.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value|sylius_percentage }}
{% extends '@SyliusAttribute/Types/percent.html.twig' %}

View file

@ -1,18 +1 @@
{% if attribute.value is not null %}
{% set values = attribute.attribute.configuration.choices %}
{% if attribute.value is iterable %}
{% for value in attribute.value %}
{% if locale in values[value]|keys and values[value][locale] is not empty %}
{{ values[value][locale] }}{% if loop.last == false %}, {% endif %}
{% else %}
{{ values[value][fallbackLocale] }}{% if loop.last == false %}, {% endif %}
{% endif %}
{% endfor %}
{% else %}
{% if values[attribute.value][locale] is not empty %}
{{ values[attribute.value][locale] }}
{% elseif values[attribute.value][fallbackLocale] is not empty %}
{{ values[attribute.value][fallbackLocale] }}
{% endif %}
{% endif %}
{% endif %}
{% extends '@SyliusAttribute/Types/select.html.twig' %}

View file

@ -1 +1 @@
{{ attribute.value|nl2br }}
{% extends '@SyliusAttribute/Types/textarea.html.twig' %}