Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates: fix formatting #593

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
* file that was distributed with this source code.
*}
<section class="best-sellers-products mt-3">
<div class="container">
{include file="components/section-title.tpl" title={l s="Best Sellers" d="Shop.Theme.Catalog"}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
<div class="best-sellers-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allBestSellers}">
{l s='All best sellers' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
<div class="container">
{include file='components/section-title.tpl' title={l s='Best Sellers' d='Shop.Theme.Catalog'}}

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

<div class="best-sellers-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allBestSellers}">
{l s='All best sellers' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
</div>
</section>
2 changes: 1 addition & 1 deletion modules/ps_brandlist/views/templates/hook/ps_brandlist.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div>
{if $brands}
{include file="module:ps_brandlist/views/templates/_partials/$brand_display_type.tpl" brands=$brands}
{include file='module:ps_brandlist/views/templates/_partials/$brand_display_type.tpl' brands=$brands}
{else}
<p class="mb-0">{l s='No brand' d='Shop.Theme.Catalog'}</p>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<section class="category-products mt-3">
<div class="container">
{if $products|@count == 1}
{include file="components/section-title.tpl" title={l s='%s other product in the same category' sprintf=[$products|@count] d='Shop.Theme.Catalog'}}
{include file='components/section-title.tpl' title={l s='%s other product in the same category' sprintf=[$products|@count] d='Shop.Theme.Catalog'}}
{else}
{include file="components/section-title.tpl" title={l s='%s other products in the same category' sprintf=[$products|@count] d='Shop.Theme.Catalog'}}
{include file='components/section-title.tpl' title={l s='%s other products in the same category' sprintf=[$products|@count] d='Shop.Theme.Catalog'}}
{/if}

{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<section class="featured-products mt-3">
<div class="container">
{include file="components/section-title.tpl" title={l s='Customers who bought this product also bought:' d='Shop.Theme.Catalog'}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
{include file='components/section-title.tpl' title={l s='Customers who bought this product also bought:' d='Shop.Theme.Catalog'}}

{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}
</div>
</section>
4 changes: 2 additions & 2 deletions modules/ps_customeraccountlinks/ps_customeraccountlinks.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
{if $configuration.return_enabled && !$configuration.is_catalog}
<li><a href="{$urls.pages.order_follow}" title="{l s='Merchandise returns' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Merchandise returns' d='Shop.Theme.Customeraccount'}</a></li>
{/if}
{hook h="displayMyAccountBlock"}
{hook h='displayMyAccountBlock'}
<li><a href="{$urls.actions.logout}" title="{l s='Log me out' d='Shop.Theme.Customeraccount'}" class="logout" rel="nofollow">{l s='Sign out' d='Shop.Theme.Actions'}</a></li>
{else}
<li><a href="{$urls.pages.guest_tracking}" title="{l s='Order tracking' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Order tracking' d='Shop.Theme.Customeraccount'}</a></li>
<li><a href="{$urls.pages.my_account}" title="{l s='Log in to your customer account' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Sign in' d='Shop.Theme.Actions'}</a></li>
<li><a href="{$urls.pages.register}" title="{l s='Create account' d='Shop.Theme.Customeraccount'}" rel="nofollow">{l s='Create account' d='Shop.Theme.Customeraccount'}</a></li>
{hook h="displayMyAccountBlock"}
{hook h='displayMyAccountBlock'}
{/if}
</ul>
</div>
4 changes: 2 additions & 2 deletions modules/ps_emailalerts/views/templates/hook/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

<div class="card card-body text-center js-mailalert mb-3 mt-3 bg-light" data-url="{url entity='module' name='ps_emailalerts' controller='actions' params=['process' => 'add']}">
{if isset($email) AND $email}
<p>{l s="Interested in this product? Drop us an email and we will let you know when it's available for order." d='Modules.Emailalerts.Shop'}</p>
<p>{l s='Interested in this product? Drop us an email and we will let you know when it\'s available for order.' d='Modules.Emailalerts.Shop'}</p>
<input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}"/>
{else}
<p>{l s="Interested in this product? Click below and we will let you know when it's available for order." d='Modules.Emailalerts.Shop'}</p>
<p>{l s='Interested in this product? Click below and we will let you know when it\'s available for order.' d='Modules.Emailalerts.Shop'}</p>
{/if}

{if !empty($id_module)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*}
<section class="featured-products">
<div class="container">
{include file="components/section-title.tpl" title={l s="Popular Products" d="Shop.Theme.Catalog"}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
{include file='components/section-title.tpl' title={l s='Popular Products' d='Shop.Theme.Catalog'}}
{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}
</div>

<div class="featured-products-footer text-center">
Expand Down
17 changes: 9 additions & 8 deletions modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
*}

<section class="new-products mt-3">
<div class="container">
{include file="components/section-title.tpl" title={l s="New products" d="Shop.Theme.Catalog"}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
<div class="new-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allNewProductsLink}">
{l s='All new products' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
<div class="container">
{include file='components/section-title.tpl' title={l s='New products' d='Shop.Theme.Catalog'}}
{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}

<div class="new-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allNewProductsLink}">
{l s='All new products' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
</div>
</section>
17 changes: 9 additions & 8 deletions modules/ps_specials/views/templates/hook/ps_specials.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
*}

<section class="sale-products mt-3">
<div class="container">
{include file="components/section-title.tpl" title={l s="On sale" d="Shop.Theme.Catalog"}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
<div class="sale-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allSpecialProductsLink}">
{l s='All sale products' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
<div class="container">
{include file='components/section-title.tpl' title={l s='On sale' d='Shop.Theme.Catalog'}}
{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}

<div class="sale-products-footer text-center">
<a class="all-product-link btn btn-outline-primary" href="{$allSpecialProductsLink}">
{l s='All sale products' d='Shop.Theme.Catalog'}<i class="material-icons rtl-flip" aria-hidden="true">&#xE315;</i>
</a>
</div>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div>
{if $suppliers}
{include file="module:ps_supplierlist/views/templates/_partials/$supplier_display_type.tpl" suppliers=$suppliers}
{include file='module:ps_supplierlist/views/templates/_partials/$supplier_display_type.tpl' suppliers=$suppliers}
{else}
<p>{l s='No supplier' d='Shop.Theme.Catalog'}</p>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*}
<section class="viewed-products mt-3">
<div class="container">
{include file="components/section-title.tpl" title={l s="Viewed products" d="Shop.Theme.Catalog"}}
{include file="catalog/_partials/productlist.tpl" products=$products productClass="col-6 col-lg-4 col-xl-3"}
{include file='components/section-title.tpl' title={l s='Viewed products' d='Shop.Theme.Catalog'}}

{include file='catalog/_partials/productlist.tpl' products=$products productClass='col-6 col-lg-4 col-xl-3'}
</div>
</section>
2 changes: 1 addition & 1 deletion modules/psgdpr/views/templates/hook/displayGDPRConsent.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="modules/psgdpr/views/templates/hook/displayGDPRConsent.tpl"}
{extends file='modules/psgdpr/views/templates/hook/displayGDPRConsent.tpl'}
{block name='gdpr_checkbox'}
<div id="gdpr_consent" class="mt-2 gdpr_module_{$psgdpr_id_module|escape:'htmlall':'UTF-8'}">
<span class="form-check">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useProgressRingContent from './useprogressring.html'

You can use the smarty file from `components/progress-circle.tpl`.

Example: `{include file="components/progress-circle.tpl" classes="text-success col-4" size=74 stroke=4 percent=50 text={l s='2 / 4' d='Shop.Theme.Checkout'}}`
Example: `{include file='components/progress-circle.tpl' classes="text-success col-4" size=74 stroke=4 percent=50 text={l s='2 / 4' d='Shop.Theme.Checkout'}}`

The progress ring use the text color for the ring color.

Expand Down
6 changes: 4 additions & 2 deletions templates/_partials/breadcrumb.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.
*}
{$componentName = 'breadcrumb'}
{$componentName = 'breadcrumb'}

<nav data-depth="{$breadcrumb.count}" class="{$componentName}__wrapper" aria-label="{$componentName}">
<div class="container">
Expand All @@ -12,7 +12,9 @@
{block name='breadcrumb_item'}
<li class="{$componentName}-item">
{if not $smarty.foreach.breadcrumb.last}
<a href="{$path.url}" class="{$componentName}-link"><span>{$path.title}</span></a>
<a href="{$path.url}" class="{$componentName}-link">
<span>{$path.title}</span>
</a>
{else}
<span>{$path.title}</span>
{/if}
Expand Down
2 changes: 2 additions & 0 deletions templates/_partials/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
{hook h='displayFooter'}
{/block}
</div>

<div class="footer__main__bottom row">
{block name='hook_footer_after'}
{hook h='displayFooterAfter'}
{/block}
</div>

<p class="copyright">
{block name='copyright_link'}
<a href="https://www.prestashop-project.org/" target="_blank" rel="noopener noreferrer nofollow">
Expand Down
27 changes: 14 additions & 13 deletions templates/_partials/form-errors.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
<div class="help-block">
{block name='form_errors'}
<div class="alert alert-danger mt-3">
{if $errors|count > 1}
<p class="mb-1">
{l s='There are %d% errors:' sprintf=['%d%' => $errors|count] d='Shop.Notifications.Error'}
</p>
<ol>
{foreach $errors as $error}
<li>{$error|nl2br nofilter}</li>
{/foreach}
</ol>
{else}
{$errors.0|nl2br nofilter}
{/if}
{if $errors|count > 1}
<p class="mb-1">
{l s='There are %d% errors:' sprintf=['%d%' => $errors|count] d='Shop.Notifications.Error'}
</p>

<ol>
{foreach $errors as $error}
<li>{$error|nl2br nofilter}</li>
{/foreach}
</ol>
{else}
{$errors.0|nl2br nofilter}
{/if}
</div>
{/block}
</div>
{/if}
{/if}
7 changes: 2 additions & 5 deletions templates/_partials/form-fields.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{if $field.type == 'hidden'}

{if $field.type === 'hidden'}
{block name='form_field_item_hidden'}
<input type="hidden" name="{$field.name}" value="{$field.value}">
{/block}

{else}

<div class="mb-3{if !empty($field.errors)} has-error{/if}">
{if ($field.type !== 'checkbox')}
{if $field.type !== 'checkbox'}
<label class="form-label{if $field.required} required{/if}" for="field-{$field.name}">
{if $field.type !== 'checkbox'}
{$field.label}
Expand Down
29 changes: 19 additions & 10 deletions templates/_partials/head.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,58 @@
{block name='head_charset'}
<meta charset="utf-8">
{/block}

{block name='head_ie_compatibility'}
<meta http-equiv="x-ua-compatible" content="ie=edge">
{/block}

{block name='head_seo'}
{block name='head_preload'}
{include file="_partials/preload.tpl"}
{include file='_partials/preload.tpl'}
{/block}

<title>{block name='head_seo_title'}{$page.meta.title}{/block}</title>

{block name='hook_after_title_tag'}
{hook h='displayAfterTitleTag'}
{/block}

<meta name="description" content="{block name='head_seo_description'}{$page.meta.description}{/block}">
<meta name="keywords" content="{block name='head_seo_keywords'}{$page.meta.keywords}{/block}">

{if $page.meta.robots !== 'index'}
<meta name="robots" content="{$page.meta.robots}">
{/if}

{if $page.canonical}
<link rel="canonical" href="{$page.canonical}">
{/if}

{block name='head_hreflang'}
{foreach from=$urls.alternative_langs item=pageUrl key=code}
<link rel="alternate" href="{$pageUrl}" hreflang="{$code}">
{/foreach}
{/block}

{block name='head_microdata'}
{include file="_partials/microdata/head-jsonld.tpl"}
{include file='_partials/microdata/head-jsonld.tpl'}
{/block}

{block name='head_microdata_special'}{/block}

{block name='head_pagination_seo'}
{include file="_partials/pagination-seo.tpl"}
{include file='_partials/pagination-seo.tpl'}
{/block}

{block name='head_open_graph'}
<meta property="og:title" content="{$page.meta.title}" />
<meta property="og:description" content="{$page.meta.description}" />
<meta property="og:url" content="{$urls.current_url}" />
<meta property="og:site_name" content="{$shop.name}" />
{if !isset($product) && $page.page_name != 'product'}<meta property="og:type" content="website" />{/if}
<meta property="og:title" content="{$page.meta.title}">
<meta property="og:description" content="{$page.meta.description}">
<meta property="og:url" content="{$urls.current_url}">
<meta property="og:site_name" content="{$shop.name}">

{if !isset($product) && $page.page_name !== 'product'}
<meta property="og:type" content="website">
{/if}
{/block}
{/block}

Expand All @@ -61,11 +70,11 @@
{/block}

{block name='stylesheets'}
{include file="_partials/stylesheets.tpl" stylesheets=$stylesheets}
{include file='_partials/stylesheets.tpl' stylesheets=$stylesheets}
{/block}

{block name='javascript_head'}
{include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars}
{include file='_partials/javascript.tpl' javascript=$javascript.head vars=$js_custom_vars}
{/block}

{block name='hook_header'}
Expand Down
Loading
Loading