mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Attribute] Bring back attribute types templates after BC break in 1.7
This commit is contained in:
parent
421ad359b7
commit
7ff09f93c6
21 changed files with 53 additions and 54 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -1,5 +1 @@
|
|||
{% if attribute.value %}
|
||||
{{ 'sylius.ui.yes_label'|trans }}
|
||||
{% else %}
|
||||
{{ 'sylius.ui.no_label'|trans }}
|
||||
{% endif %}
|
||||
{% extends '@SyliusAttribute/Types/checkbox.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value }}
|
||||
{% extends '@SyliusAttribute/Types/default.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value|sylius_percentage }}
|
||||
{% extends '@SyliusAttribute/Types/percent.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value|nl2br }}
|
||||
{% extends '@SyliusAttribute/Types/textarea.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
{% if attribute.value %}
|
||||
{{ 'sylius.ui.yes_label'|trans }}
|
||||
{% else %}
|
||||
{{ 'sylius.ui.no_label'|trans }}
|
||||
{% endif %}
|
||||
|
|
@ -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 %}
|
||||
|
|
@ -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 %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{{ attribute.value }}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{{ attribute.value|sylius_percentage }}
|
||||
|
|
@ -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 %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{{ attribute.value|nl2br }}
|
||||
|
|
@ -1,5 +1 @@
|
|||
{% if attribute.value %}
|
||||
{{ 'sylius.ui.yes_label'|trans }}
|
||||
{% else %}
|
||||
{{ 'sylius.ui.no_label'|trans }}
|
||||
{% endif %}
|
||||
{% extends '@SyliusAttribute/Types/checkbox.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value }}
|
||||
{% extends '@SyliusAttribute/Types/default.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value|sylius_percentage }}
|
||||
{% extends '@SyliusAttribute/Types/percent.html.twig' %}
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ attribute.value|nl2br }}
|
||||
{% extends '@SyliusAttribute/Types/textarea.html.twig' %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue