From 931d350296f2db3a07fadb35423424088e772c80 Mon Sep 17 00:00:00 2001 From: Ernest Warwas Date: Thu, 10 Mar 2022 13:16:02 +0100 Subject: [PATCH 1/2] [Admin][Shop] placehold.it replaced to local placeholders --- src/Sylius/Behat/Element/Admin/TopBarElement.php | 2 +- .../views/AdminUser/_avatarImage.html.twig | 2 +- .../views/Product/Show/_mainImage.html.twig | 2 +- .../views/Product/Show/_media.html.twig | 2 +- .../Resources/views/Product/_mainImage.html.twig | 2 +- .../views/Product/Show/_images.html.twig | 4 ++-- .../Resources/views/Product/_mainImage.html.twig | 2 +- .../UiBundle/Resources/private/img/200x200.png | Bin 0 -> 1365 bytes .../UiBundle/Resources/private/img/400x300.png | Bin 0 -> 2199 bytes .../UiBundle/Resources/private/img/50x50.png | Bin 0 -> 452 bytes 10 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 src/Sylius/Bundle/UiBundle/Resources/private/img/200x200.png create mode 100644 src/Sylius/Bundle/UiBundle/Resources/private/img/400x300.png create mode 100644 src/Sylius/Bundle/UiBundle/Resources/private/img/50x50.png diff --git a/src/Sylius/Behat/Element/Admin/TopBarElement.php b/src/Sylius/Behat/Element/Admin/TopBarElement.php index de7140e4aef..5de51c2ba8d 100644 --- a/src/Sylius/Behat/Element/Admin/TopBarElement.php +++ b/src/Sylius/Behat/Element/Admin/TopBarElement.php @@ -24,7 +24,7 @@ public function hasAvatarInMainBar(string $avatarPath): bool public function hasDefaultAvatarInMainBar(): bool { - return strpos($this->getAvatarImagePath(), '//placehold.it/50x50') !== false; + return strpos($this->getAvatarImagePath(), '/assets/admin/img/50x50.png') !== false; } private function getAvatarImagePath(): string diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig index f74845a70d5..4eb132c2209 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig @@ -1,7 +1,7 @@ {% if app.user.avatar is not empty and app.user.avatar.path is not empty %} {% set path = app.user.avatar.path|imagine_filter('sylius_admin_admin_user_avatar_thumbnail') %} {% else %} - {% set path = '//placehold.it/50x50' %} + {% set path = {{ asset('assets/admin/img/50x50.png') }} %} {% endif %} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig index e2bc1612364..913e348849e 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %} {% else %} - {% set path = '//placehold.it/200x200' %} + {% set path = {{ asset('assets/admin/img/200x200.png') }} %} {% endif %} {{ product.name }} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig index 25f80258ebd..3dee6c23b03 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig @@ -7,7 +7,7 @@ {% if product.images|length >= 1 %}
{% for image in product.images %} - {% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : '//placehold.it/200x200' %} + {% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : {{ asset('assets/admin/img/200x200.png') }} %}
{% if product.isConfigurable() and product.variants|length > 0 %} {% include '@SyliusAdmin/Product/Show/_imageVariants.html.twig' %} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig index 3fe65b825b3..f154386846e 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %} {% else %} - {% set path = '//placehold.it/50x50' %} + {% set path = {{ asset('assets/admin/img/50x50.png') }} %} {% endif %} diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig index ac1769d3814..f0ecda968b9 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig @@ -7,7 +7,7 @@ {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %} {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %} {% else %} - {% set original_path = '//placehold.it/400x300' %} + {% set original_path = {{ asset('assets/shop/img/400x300.png') }} %} {% set path = original_path %} {% endif %} @@ -22,7 +22,7 @@
{% for image in product.images %} - {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : '//placehold.it/200x200' %} + {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : {{ asset('assets/shop/img/200x200.png') }} %}
{% if product.isConfigurable() and product.enabledVariants|length > 0 %} {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %} diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig index fd1cf34fc63..5bd60ce2cca 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_shop_product_thumbnail')) %} {% else %} - {% set path = '//placehold.it/200x200' %} + {% set path = {{ asset('assets/shop/img/200x200.png') }} %} {% endif %} {{ product.name }} diff --git a/src/Sylius/Bundle/UiBundle/Resources/private/img/200x200.png b/src/Sylius/Bundle/UiBundle/Resources/private/img/200x200.png new file mode 100644 index 0000000000000000000000000000000000000000..8f7a516109be98b655acdeedd4318f890410988f GIT binary patch literal 1365 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yaTa()7Bet#3xhBt!>l*8o|0J>kxvxB3978G?-`=#I>>J6@_Aocgsi>&v2@rV1 z22GdP=ev*Bqx^zq&enI=8r<&i4HKar5kIcfEd42{h`{+uPfp z-rSr%J2!q`P2{_~ySLA=tu8ZOu|9tPzM4Nj3M>Eq`nt`r?)ka7PcJTZfBk!BSFPAgFSO4R~!(F=Hr)EF>r~Lc*j>2^{^JMDZ-rD-L zxbOVjzt5{}PO%uBY^eP3;NY+SJnLqg=dWX4ezI<2qbb|HySvM$KR-V|KdrB2dZV?N-#=g)0OL4%&-*Ug}e|^ck`~TzP8HABsS}?ry!kkvX=X}7`p=1sC6ABwT1gleY|g3r_~_`f=RAMT z$XLs_J$IbTG9=knWlA~c=KuZ>1lVorxiJ;E%^NWy!?+JE!*z< zNbG#RamwuXe^(ec%LLRho1`3gIy1RW;QX7(_cMAUHl=u`Jl>uNbbqJl_xJbLUqAbE zlg_E;e-Tw@y%)q3>%0^ykF%`*c0Ol<>Yb(D)64GG|Kq)0v-i&L+uQTSr#-!K?b@~T ztE-`)Qt{j(?}^cX2-c|4?#dWlKcq^GH99zd^)qffuMqWbkzLb6Mw< G&;$S!Ogl6H literal 0 HcmV?d00001 diff --git a/src/Sylius/Bundle/UiBundle/Resources/private/img/400x300.png b/src/Sylius/Bundle/UiBundle/Resources/private/img/400x300.png new file mode 100644 index 0000000000000000000000000000000000000000..187922a2e9772b3f487b4ecd7c475216dd611404 GIT binary patch literal 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wzVS>JF-pjY(o_I7M+lZ>*a5y2HO7va2#6(u%qwmxb2Be*~~AdQX%n HGK2ju0GtL2 literal 0 HcmV?d00001 diff --git a/src/Sylius/Bundle/UiBundle/Resources/private/img/50x50.png b/src/Sylius/Bundle/UiBundle/Resources/private/img/50x50.png new file mode 100644 index 0000000000000000000000000000000000000000..9d7b1800eccf883faf9acd5740561a3e3dc91265 GIT binary patch literal 452 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nC-&H|6fVg?3oVGw3ym^DWND9BhG z=SXS2LtENqvnvS46u zcwETvVj+8$1;dvM&ihyApA1xb+crh)(`13fHwQnzS<-3T_n7}~gZ?f~wMD$b7uz~B z4!dkgRJvs#m^-7x%*RCe}pkZAkEvn^NocwxpYwR6lJ5BCN!zdl}gVb{7necAWR_bonWt*5?8hx=*expEPK zfCcZX?GkQp3z_y*S^m(C<{B9vzV@0Y5A`-am#W~u_SoWC^J2xI-(9CW8`iz95PC7I zK`Fx7XIFc=h^tT0#ath!qK4;{_17j^d^_=E_Oi+~`yVg9&#_Bs@zH~Y0X|IGFSNSC zLXV0!v~(z_`v(8(Suga>*@sW(QbfJjl)tWldrUsq%ltkaB1yp0b&T(O*DpP(^~nzy O=nS5&elF{r5}E*^io4JN literal 0 HcmV?d00001 From 9ec1c11e031d9b4ae5f29ef3aa72d0438b5a7840 Mon Sep 17 00:00:00 2001 From: Ernest Warwas Date: Thu, 10 Mar 2022 13:27:28 +0100 Subject: [PATCH 2/2] fix asset path --- .../Resources/views/AdminUser/_avatarImage.html.twig | 2 +- .../Resources/views/Product/Show/_mainImage.html.twig | 2 +- .../AdminBundle/Resources/views/Product/Show/_media.html.twig | 2 +- .../AdminBundle/Resources/views/Product/_mainImage.html.twig | 2 +- .../ShopBundle/Resources/views/Product/Show/_images.html.twig | 4 ++-- .../ShopBundle/Resources/views/Product/_mainImage.html.twig | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig index 4eb132c2209..0ae1472d259 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/AdminUser/_avatarImage.html.twig @@ -1,7 +1,7 @@ {% if app.user.avatar is not empty and app.user.avatar.path is not empty %} {% set path = app.user.avatar.path|imagine_filter('sylius_admin_admin_user_avatar_thumbnail') %} {% else %} - {% set path = {{ asset('assets/admin/img/50x50.png') }} %} + {% set path = asset('assets/admin/img/50x50.png') %} {% endif %} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig index 913e348849e..324ce1aaa0a 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %} {% else %} - {% set path = {{ asset('assets/admin/img/200x200.png') }} %} + {% set path = asset('assets/admin/img/200x200.png') %} {% endif %} {{ product.name }} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig index 3dee6c23b03..128c9b62f31 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/Show/_media.html.twig @@ -7,7 +7,7 @@ {% if product.images|length >= 1 %}
{% for image in product.images %} - {% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : {{ asset('assets/admin/img/200x200.png') }} %} + {% set path = image.path is not null ? image.path|imagine_filter('sylius_admin_product_small_thumbnail') : asset('assets/admin/img/200x200.png') %}
{% if product.isConfigurable() and product.variants|length > 0 %} {% include '@SyliusAdmin/Product/Show/_imageVariants.html.twig' %} diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig index f154386846e..4550f53b258 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Product/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) %} {% else %} - {% set path = {{ asset('assets/admin/img/50x50.png') }} %} + {% set path = asset('assets/admin/img/50x50.png') %} {% endif %} diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig index f0ecda968b9..391520b8e18 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_images.html.twig @@ -7,7 +7,7 @@ {% set original_path = source_path|imagine_filter('sylius_shop_product_original') %} {% set path = source_path|imagine_filter(filter|default('sylius_shop_product_large_thumbnail')) %} {% else %} - {% set original_path = {{ asset('assets/shop/img/400x300.png') }} %} + {% set original_path = asset('assets/shop/img/400x300.png') %} {% set path = original_path %} {% endif %} @@ -22,7 +22,7 @@
{% for image in product.images %} - {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : {{ asset('assets/shop/img/200x200.png') }} %} + {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_small_thumbnail') : asset('assets/shop/img/200x200.png') %}
{% if product.isConfigurable() and product.enabledVariants|length > 0 %} {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %} diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig index 5bd60ce2cca..5f832e127c1 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Product/_mainImage.html.twig @@ -3,7 +3,7 @@ {% elseif product.images.first %} {% set path = product.images.first.path|imagine_filter(filter|default('sylius_shop_product_thumbnail')) %} {% else %} - {% set path = {{ asset('assets/shop/img/200x200.png') }} %} + {% set path = asset('assets/shop/img/200x200.png') %} {% endif %} {{ product.name }}