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

CIF-1315 - JS of CIF Core Components should be loaded via theme clientlib #233

Merged
merged 3 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
limitations under the License.
*/-->

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.category="com.adobe.cq.commerce.core.components.models.categorylist.FeaturedCategoryList"
<sly data-sly-use.category="com.adobe.cq.commerce.core.components.models.categorylist.FeaturedCategoryList"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html" />

<div data-sly-test.hasCategories="${category.categories.size}" class="cmp-categorylist">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.minicart.v1'}"/>
<div id="minicart"></div>
</sly>
<div id="minicart"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.variantsTpl="variantselector.html"
<sly data-sly-use.variantsTpl="variantselector.html"
data-sly-use.galleryTpl="gallery.html"
data-sly-use.actionsTpl="actions.html"
data-sly-use.quantityTpl="quantity.html"
data-sly-use.product="com.adobe.cq.commerce.core.components.models.product.Product"
data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">

<sly data-sly-call="${clientlib.all @ categories='core.cif.components.product.v1'}"/>
<form class="productFullDetail__root"
data-configurable="${product.configurable}"
data-cmp-is="product"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-call="${clientlib.all @ categories='core.cif.components.productcarousel.v1'}"
data-sly-use.carousel="${'com.adobe.cq.commerce.core.components.models.productcarousel.ProductCarousel' @productSkuList=properties.product}"
<sly data-sly-use.carousel="${'com.adobe.cq.commerce.core.components.models.productcarousel.ProductCarousel' @productSkuList=properties.product}"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
data-sly-use.productTpl="productcard.html" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.titleTemplate="title.html"
<sly data-sly-use.titleTemplate="title.html"
data-sly-use.imageTemplate="image.html"
data-sly-use.itemTemplate="item.html"
data-sly-use.paginationTemplate="paginationbar.html"
data-sly-use.productList="com.adobe.cq.commerce.core.components.models.productlist.ProductList"
data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.productlist.v1'}"/>

<article class="category__root" data-sly-use.itemTemplate="item.html" data-locale="${page.language}" data-cmp-is="productlist" data-load-client-price="${productList.loadClientPrice}">
<sly data-sly-test="${productList.showTitle && productList.title}" data-sly-call="${titleTemplate.listTitle @ productList = productList}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@
limitations under the License.
*/-->

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.product="com.adobe.cq.commerce.core.components.models.productteaser.ProductTeaser"
<sly data-sly-use.product="com.adobe.cq.commerce.core.components.models.productteaser.ProductTeaser"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
data-sly-use.actionsTpl="actions.html"
data-sly-test.isConfigured="${properties.selection}"
data-sly-test.hasProduct="${product.url}">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.productteaser.v1'}" />
data-sly-test.hasProduct="${product.url}" />

<div data-sly-test="${isConfigured && hasProduct}" class="item__root" data-cmp-is="productteaser">
<a class="item__images" href=${product.url}>
<img class="item__image" width="100%" height="100%" src="${product.image}" alt="${product.image}" />
</a>
<a class="item__name" href=${product.url}><span>${product.name}</span></a>
<sly data-sly-use.template="core/cif/components/commons/v1/price.html"
data-sly-call="${template.price @ priceRange=product.priceRange, displayYouSave=false}"/>
<sly data-sly-call="${actionsTpl.actions @ product=product}"/>
</div>
</sly>
<div data-sly-test="${isConfigured && hasProduct}" class="item__root" data-cmp-is="productteaser">
<a class="item__images" href=${product.url}>
<img class="item__image" width="100%" height="100%" src="${product.image}" alt="${product.image}" />
</a>
<a class="item__name" href=${product.url}><span>${product.name}</span></a>
<sly data-sly-use.template="core/cif/components/commons/v1/price.html"
data-sly-call="${template.price @ priceRange=product.priceRange, displayYouSave=false}"/>
<sly data-sly-call="${actionsTpl.actions @ product=product}"/>
</div>

<sly data-sly-call="${templates.placeholder @ isEmpty = !isConfigured}" />
<sly data-sly-call="${templates.placeholder @ isEmpty = isConfigured && !hasProduct, emptyTextAppend = 'Configured, but no product to display'}" />
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.searchbar="${'com.adobe.cq.commerce.core.components.models.searchbar.Searchbar'}">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.searchbar.v1'}"/>
<sly data-sly-use.searchbar="${'com.adobe.cq.commerce.core.components.models.searchbar.Searchbar'}" />

<div class="searchBar__root" role="search">
<div class="searchBar__searchInner">
<form class="searchBar__form" autocomplete="off" _lpchecked="1" action="${searchbar.searchResultsPageUrl}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.searchResults="com.adobe.cq.commerce.core.components.models.searchresults.SearchResults">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.productlist.v1'}"/>
<sly data-sly-use.searchResults="com.adobe.cq.commerce.core.components.models.searchresults.SearchResults" />

<article class="category__root" data-sly-use.itemTemplate="item.html">
<section data-sly-test.results="${searchResults.products}">
<div class="gallery__root">
<div class="gallery__items" data-sly-list.product="${searchResults.products}">
<div class="item__root" data-sly-call="${itemTemplate.item @ item = product}"></div>
</div>
<article class="category__root" data-sly-use.itemTemplate="item.html">
<section data-sly-test.results="${searchResults.products}">
<div class="gallery__root">
<div class="gallery__items" data-sly-list.product="${searchResults.products}">
<div class="item__root" data-sly-call="${itemTemplate.item @ item = product}"></div>
</div>
</section>
<h2 class="category__root-message" data-sly-test="${!results}">${'No results to display' @ i18n}</h2>
</article>
</sly>
</div>
</section>
<h2 class="category__root-message" data-sly-test="${!results}">${'No results to display' @ i18n}</h2>
</article>
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-use.header="${'com.adobe.cq.commerce.core.components.models.header.Header' @ minicartNodeName = 'minicart'}">
<sly data-sly-call="${clientlib.all @ categories='core.cif.components.header.v1'}"/>
<header class="header__root header__closed">
<div class="header__toolbar">
<a href="${header.navigationRootPageUrl}"><img class="header__logo" src="${resource.path}/logo.svg" height="24" alt="Venia" title="Venia"/></a>
<div class="header__primaryActions">
<sly data-sly-test="${resource['navigation/navigationRoot']}" data-sly-resource="${resource.path}/navigation"/>
</div>
<div class="header__secondaryActions">
<button class="searchTrigger__root clickable__root">
<span class="icon-root"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg></span>
</button>
<div class="header__cartTrigger"></div>
<sly data-sly-test="${header.minicartResource}" data-sly-resource="${header.minicartResource}"></sly>
</div>
<sly data-sly-use.header="${'com.adobe.cq.commerce.core.components.models.header.Header' @ minicartNodeName = 'minicart'}" />

<header class="header__root header__closed">
<div class="header__toolbar">
<a href="${header.navigationRootPageUrl}"><img class="header__logo" src="${resource.path}/logo.svg" height="24" alt="Venia" title="Venia" /></a>
<div class="header__primaryActions">
<sly data-sly-test="${resource['navigation/navigationRoot']}" data-sly-resource="${resource.path}/navigation" />
</div>
<sly data-sly-test="${header.searchbarResource}" data-sly-resource="${header.searchbarResource}"/>
</header>
</sly>
<div class="header__secondaryActions">
<button class="searchTrigger__root clickable__root">
<span class="icon-root"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg></span>
</button>
<div class="header__cartTrigger"></div>
<sly data-sly-test="${header.minicartResource}" data-sly-resource="${header.minicartResource}"></sly>
</div>
</div>
<sly data-sly-test="${header.searchbarResource}" data-sly-resource="${header.searchbarResource}" />
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
~ governing permissions and limitations under the License.
~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-call="${clientlib.all @ categories='core.cif.components.navigation.v1'}"/>
<sly data-sly-include="navigationTrigger.html"/>

<aside class="navigation__root">
<sly data-sly-include="navigationHeader.html"/>
<nav class="navigation__body"
Expand Down