From 11a8406976efd4de8062f79b94bffd3833425c11 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 26 Mar 2024 15:17:05 +0100 Subject: [PATCH 1/3] IBX-7983: Handled previewing `ezimage` field with height of 0 --- .../ui/field_type/preview/content_fields.html.twig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index 350cf3ebbe..9f363c967b 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -433,10 +433,12 @@ {{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}: {{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }} - - {{ 'ezimage.ratio'|trans|desc('Ratio') }}: - {{ (field.value.width/field.value.height)|round(2) }} - + {% if (field.value.height is not same as '0') %} + + {{ 'ezimage.ratio'|trans|desc('Ratio') }}: + {{ (field.value.width/field.value.height)|round(2) }} + + {% endif %} From 8108b918551f27dcef98453cc8dcafce504ddc3f Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 16 Apr 2024 10:59:19 +0200 Subject: [PATCH 2/3] IBX-7983: Applied review remark --- .../themes/admin/ui/field_type/preview/content_fields.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index 9f363c967b..e7f3778b09 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -433,7 +433,7 @@ {{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}: {{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }} - {% if (field.value.height is not same as '0') %} + {% if (field.value.height != '0') %} {{ 'ezimage.ratio'|trans|desc('Ratio') }}: {{ (field.value.width/field.value.height)|round(2) }} From d3807c21d0ab2497062aeb3ab653110a261c6ced Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 16 Apr 2024 13:32:57 +0200 Subject: [PATCH 3/3] IBX-7983: CS --- .../themes/admin/ui/field_type/preview/content_fields.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index e7f3778b09..ae6ee466c8 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -433,7 +433,7 @@ {{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}: {{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }} - {% if (field.value.height != '0') %} + {% if field.value.height != '0' %} {{ 'ezimage.ratio'|trans|desc('Ratio') }}: {{ (field.value.width/field.value.height)|round(2) }}