-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ejs): minor style fixes and update sections
[skip ci]
- Loading branch information
Showing
7 changed files
with
63 additions
and
34 deletions.
There are no files selected for viewing
49 changes: 22 additions & 27 deletions
49
@ecomplus/storefront-template/template/pages/@/sections/collection-shelf.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,24 @@ | ||
<div class="collection-shelf my-lg-5"> | ||
<% | ||
if (opt.collection_id) { | ||
const res = await _.ecomClient.store({ | ||
url: `/collections/${opt.collection_id}.json` | ||
}) | ||
const collection = res.data | ||
let items = [] | ||
if (Array.isArray(collection.products) && collection.products.length) { | ||
const search = new _.EcomSearch() | ||
await search.setProductIds(collection.products).fetch() | ||
items = search.getItems() | ||
} | ||
const { title, link } = opt | ||
%> | ||
<%- await include('/@/sections/inc/products-carousel', { | ||
_, opt: { items, collection, title, link } | ||
}) %> | ||
<% | ||
} else { | ||
%> | ||
<%- await include('/@/sections/inc/products-carousel', { | ||
_, opt: { items: _.items } | ||
}) %> | ||
<% | ||
<% | ||
const { title, link, shuffle } = opt | ||
let items, collection | ||
if (opt.collection_id) { | ||
const res = await _.ecomClient.store({ | ||
url: `/collections/${opt.collection_id}.json` | ||
}) | ||
collection = res.data | ||
items = [] | ||
if (Array.isArray(collection.products) && collection.products.length) { | ||
const search = new _.EcomSearch() | ||
await search.setProductIds(collection.products).fetch() | ||
items = search.getItems() | ||
} | ||
%> | ||
} else { | ||
items = _.items | ||
} | ||
%> | ||
|
||
<div class="collection-shelf my-lg-5"> | ||
<%- await include('/@/sections/inc/products-carousel', { | ||
_, opt: { items, collection, title, link, shuffle } | ||
}) %> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
@ecomplus/storefront-template/template/pages/@/sections/custom-content.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="custom-content"> | ||
<%- await include('/@/sections/inc/md-content') %> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
@ecomplus/storefront-template/template/pages/@/sections/custom-html.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% if (typeof opt.html === 'string') { %> | ||
<section class="custom-html my-4 my-lg-5"> | ||
<div class="container"> | ||
<div class="html-clearfix"> | ||
<%- opt.html %> | ||
</div> | ||
</div> | ||
</section> | ||
<% } %> |
15 changes: 15 additions & 0 deletions
15
@ecomplus/storefront-template/template/pages/@/sections/inc/banner.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
@ecomplus/storefront-template/template/pages/@/sections/inc/md-content.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
@ecomplus/storefront-template/template/pages/@/sections/inc/products-carousel.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
@ecomplus/storefront-template/template/pages/@/sections/search-engine.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters