Skip to content

Commit

Permalink
Templates: fix some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yannicka committed Feb 9, 2024
1 parent 20597c0 commit 53f3672
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 18 deletions.
14 changes: 8 additions & 6 deletions templates/catalog/_partials/category-header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

{if !empty($category.image.large.url)}
<div class="category-cover mb-4">
<img src="{$category.image.large.url}"
alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}"
fetchpriority="high"
class="img-fluid"
width="{$category.image.large.width}"
height="{$category.image.large.height}">
<img
src="{$category.image.large.url}"
alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}"
fetchpriority="high"
class="img-fluid"
width="{$category.image.large.width}"
height="{$category.image.large.height}"
>
</div>
{/if}
</div>
Expand Down
8 changes: 7 additions & 1 deletion templates/catalog/_partials/customization-modal.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<div id="product-customizations-modal-{$customization.id_customization}" class="modal fade product-customization-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div
id="product-customizations-modal-{$customization.id_customization}"
class="modal fade product-customization-modal"
tabindex="-1"
role="dialog"
aria-hidden="true"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
Expand Down
13 changes: 8 additions & 5 deletions templates/catalog/_partials/facets.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{if $facet.widgetType !== 'dropdown'}
{block name='facet_item_other'}
<ul id="facet_{$_expand_id}" class="collapse{if !$_collapse} in{/if}">
{foreach from=$facet.filters key=filter_key item="filter"}
{foreach from=$facet.filters key=filter_key item='filter'}
{if !$filter.displayed}
{continue}
{/if}
Expand All @@ -64,11 +64,13 @@
{if $filter.active }checked{/if}
>
{if isset($filter.properties.texture)}
<span class="color texture" style="background-image:url({$filter.properties.texture})"></span>
<span class="color texture" style="background-image: url({$filter.properties.texture});"></span>
{elseif isset($filter.properties.color)}
<span class="color" style="background-color:{$filter.properties.color}"></span>
<span class="color" style="background-color: {$filter.properties.color};"></span>
{else}
<span {if !$js_enabled} class="ps-shown-by-js" {/if}><i class="material-icons rtl-no-flip checkbox-checked">&#xE5CA;</i></span>
<span {if !$js_enabled}class="ps-shown-by-js"{/if}>
<i class="material-icons rtl-no-flip checkbox-checked">&#xE5CA;</i>
</span>
{/if}
</span>
{else}
Expand All @@ -80,7 +82,7 @@
name="filter {$facet.label}"
{if $filter.active }checked{/if}
>
<span {if !$js_enabled} class="ps-shown-by-js" {/if}></span>
<span {if !$js_enabled}class="ps-shown-by-js"{/if}></span>
</span>
{/if}

Expand All @@ -90,6 +92,7 @@
rel="nofollow"
>
{$filter.label}

{if $filter.magnitude}
<span class="magnitude">({$filter.magnitude})</span>
{/if}
Expand Down
1 change: 1 addition & 0 deletions templates/catalog/_partials/miniatures/brand.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<p>
<a class="brand__link" href="{$brand.url}">{$brand.name}</a>
</p>

{$brand.text nofilter}
</div>

Expand Down
18 changes: 13 additions & 5 deletions templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@

<div class="{$componentName}__infos__top">
{block name='product_name'}
<a href="{$product.url}"><p class="{$componentName}__title">{$product.name}</p></a>
<a href="{$product.url}">
<p class="{$componentName}__title">{$product.name}</p>
</a>
{/block}
</div>

Expand All @@ -149,7 +151,10 @@
{hook h='displayProductPriceBlock' product=$product type="before_price"}

<span class="{$componentName}__price" aria-label="{l s='Price' d='Shop.Theme.Catalog'}">
{capture name='custom_price'}{hook h='displayProductPriceBlock' product=$product type='custom_price' hook_origin='products_list'}{/capture}
{capture name='custom_price'}
{hook h='displayProductPriceBlock' product=$product type='custom_price' hook_origin='products_list'}
{/capture}

{if '' !== $smarty.capture.custom_price}
{$smarty.capture.custom_price nofilter}
{else}
Expand Down Expand Up @@ -179,17 +184,20 @@
{if $product.add_to_cart_url}
<form action="{$urls.pages.cart}" method="post" class="d-flex flex-wrap flex-md-nowrap gap-3 align-items-center mt-3">
<input type="hidden" value="{$product.id_product}" name="id_product">

<input type="hidden" name="token" value="{$static_token}" />

<div class="quantity-button js-quantity-button w-100 w-sm-auto">
{include file='components/qty-input.tpl'
attributes=[
"id"=>"quantity_wanted_{$product.id_product}",
"value"=>"{if $product.cart_quantity && $product.cart_quantity >= $product.minimal_quantity}1{else}{$product.minimal_quantity}{/if}",
"min"=>"{if $product.cart_quantity && $product.cart_quantity >= $product.minimal_quantity}1{else}{$product.minimal_quantity}{/if}"
'id' => "quantity_wanted_{$product.id_product}",
'value' => "{if $product.cart_quantity && $product.cart_quantity >= $product.minimal_quantity}1{else}{$product.minimal_quantity}{/if}",
'min' => "{if $product.cart_quantity && $product.cart_quantity >= $product.minimal_quantity}1{else}{$product.minimal_quantity}{/if}"
]
marginHelper="mb-0"
}
</div>

<button data-button-action="add-to-cart" class="btn btn-primary flex-grow-1 flex-md-grow-0">
<i class="material-icons" aria-hidden="true">&#xe854;</i>
<span class="visually-hidden">{l s='Add to cart' d='Shop.Theme.Actions'}</span>
Expand Down
2 changes: 1 addition & 1 deletion templates/catalog/_partials/product-accessories.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
<section class="product-accessories mt-3">
<section class="product-accessories mt-3">
{include file='components/section-title.tpl' title={l s='You might also like' d='Shop.Theme.Catalog'}}

{include file='catalog/_partials/productlist.tpl' products=$accessories productClass='col-6 col-lg-4 col-xl-3'}
Expand Down

0 comments on commit 53f3672

Please sign in to comment.