expressCart/views/products.hbs

45 lines
2.3 KiB
Handlebars
Raw Normal View History

2018-02-12 05:47:26 +10:00
{{> partials/menu}}
2020-02-01 16:59:30 +10:00
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
<div class="col-sm-12">
2018-01-07 04:55:48 +10:00
<h2>Products</h2>
</div>
<div class="col-sm-12 search_bar">
2018-01-07 04:55:48 +10:00
<div class="input-group">
<input type="text" name="product_filter" id="product_filter" class="form-control" placeholder="Filter products">
<div class="input-group-append">
<button class="btn btn-outline-success" id="btn_product_filter">Filter</button>
2020-02-01 18:54:11 +10:00
<a href="/admin/products" class="hidden-xs btn btn-outline-warning">{{{feather 'x-octagon'}}}</a>
</div>
2018-01-07 04:55:48 +10:00
</div>
<p class="text-warning top-pad-10">{{ @root.__ "Products can be filtered by: product title or product description keywords" }}</p>
2018-01-07 04:55:48 +10:00
</div>
<div class="col-sm-12">
2019-12-13 21:06:25 +10:00
<ul class="list-group">
<li class="list-group-item">
2020-01-01 19:20:57 +10:00
<span class="float-right"><strong>{{ @root.__ "Published" }}</strong></span>
2019-12-13 21:06:25 +10:00
{{#ifCond resultType '==' 'filtered'}}
<strong>{{ @root.__ "Products" }} - <span class="text-danger">{{ @root.__ "Filtered term" }}: {{searchTerm}} </span></strong>
{{else}}
<strong>{{ @root.__ "Recent products" }}</strong>
{{/ifCond}}
</li>
{{#each results}}
2018-01-07 04:55:48 +10:00
<li class="list-group-item">
2020-02-01 18:54:11 +10:00
<button class="float-right btn text-danger btn-delete-product" data-id="{{this._id}}"> {{{feather 'trash-2'}}}</button>
<h4 class="float-right"><input id="{{this._id}}" class="publishedState" type="checkbox" {{checkedState this.productPublished}}></h4>
2019-12-26 20:32:28 +10:00
<div class="top-pad-8"><a href="/admin/product/edit/{{this._id}}">{{this.productTitle}}</a></div>
2018-01-07 04:55:48 +10:00
</li>
2019-12-13 21:06:25 +10:00
{{/each}}
</ul>
</div>
<div class="col-md-12 mt-5">
<div id="pager" class="d-flex justify-content-center"></div>
</div>
</div>
{{!-- Pager settings --}}
<input type="hidden" id="itemsPerPage" value="10" >
<input type="hidden" id="pageNum" value="{{pageNum}}">
<input type="hidden" id="totalItemCount" value="{{totalItemCount}}">
<input type="hidden" id="paginateUrl" value="{{paginateUrl}}">
<input type="hidden" id="searchTerm" value="{{searchTerm}}">