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">
2019-12-26 13:23:21 +10:00
<div class="col-sm-12">
2018-01-07 04:55:48 +10:00
<h2>Orders</h2>
</div>
2019-12-26 13:23:21 +10:00
<div class="col-sm-12 search_bar">
2018-01-07 04:55:48 +10:00
<div class="input-group">
2019-12-26 13:23:21 +10:00
<input type="text" name="order_filter" id="order_filter" class="form-control" placeholder="Filter orders">
<div class="input-group-append">
<button class="btn btn-outline-success" id="btn_order_filter"> {{ @ root .__ "Filter" }} </button>
<a href="/admin/orders/bystatus/" class="hidden-xs btn btn-outline-info orderFilterByStatus"> {{ @ root .__ "By status" }} </a>
2020-02-01 18:54:11 +10:00
<a href="/admin/orders" class="hidden-xs btn btn-outline-warning"> {{{ feather 'x-octagon' }}} </a>
2019-12-26 13:23:21 +10:00
</div>
2018-01-07 04:55:48 +10:00
</div>
<div class="orderFilter">
2019-12-26 13:23:21 +10:00
<div class="row">
<div class="text-warning top-pad-10 col-sm-8"> {{ @ root .__ "Orders can be filtered by: surname, email address or postcode/zipcode" }} </div>
2019-12-26 20:32:28 +10:00
<div class="col-sm-4 top-pad-10">
<form class="form-inline float-sm-right">
<label for="orderStatusFilter" class="control-label formLabel right-pad-10">Status</label>
<select class="form-control" id="orderStatusFilter">
<option> {{ @ root .__ "Completed" }} </option>
<option> {{ @ root .__ "Paid" }} </option>
<option> {{ @ root .__ "Created" }} </option>
<option> {{ @ root .__ "Cancelled" }} </option>
<option> {{ @ root .__ "Declined" }} </option>
<option> {{ @ root .__ "Shipped" }} </option>
<option> {{ @ root .__ "Pending" }} </option>
</select>
</form>
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>
</div>
2019-12-26 13:23:21 +10:00
<div class="col-sm-12 top-pad-10">
2018-01-07 04:55:48 +10:00
<ul class="list-group">
<li class="list-group-item">
{{ # if searchTerm }}
2019-11-06 18:31:25 +10:00
<strong> {{ @ root .__ "Orders" }} - <span class="text-danger"> {{ @ root .__ "Filtered term" }} : {{ searchTerm }} </span></strong>
2018-01-07 04:55:48 +10:00
{{ else }}
2019-11-06 18:31:25 +10:00
<strong> {{ @ root .__ "Recent orders" }} </strong>
2018-01-07 04:55:48 +10:00
{{ / if }}
</li>
2018-01-07 23:16:31 +10:00
{{ # if orders }}
2018-01-07 04:55:48 +10:00
{{ # each orders }}
<li class="list-group-item">
2020-01-01 19:20:57 +10:00
<div class="float-right top-pad-5">
2019-11-06 18:31:25 +10:00
{{ @ root .__ "Status" }} : <span class="text- {{ getStatusColor this .orderStatus }} "> {{ this .orderStatus }} </span>
2020-02-01 18:54:11 +10:00
<a class="text-danger" href="/admin/order/delete/ {{ this ._id }} " onclick="return confirm('Are you sure you want to delete this order?');"> {{{ feather 'trash-2' }}} </a>
2019-12-26 20:32:28 +10:00
</div>
<div class="top-pad-5">
2019-11-06 18:31:25 +10:00
<a href="/admin/order/view/ {{ this ._id }} " class="text-success">View order</a> - <span class="text-info">Date: </span> {{ formatDate this .orderDate "DD/MM/YYYY hh:mm" }} | <span class="text-info">Email:</span> {{ this .orderEmail }} | <span class="text-info"> {{ @ root .__ "Last name" }} :</span> {{ this .orderLastname }}
2019-12-26 20:32:28 +10:00
</div>
2018-01-07 04:55:48 +10:00
</li>
{{ / each }}
2018-01-07 23:16:31 +10:00
{{ else }}
<li class="list-group-item">
2019-12-26 20:32:28 +10:00
<h5 class="text-center">
2019-11-06 18:31:25 +10:00
{{ @ root .__ "No orders found" }}
2019-12-26 20:32:28 +10:00
</h5>
2018-01-07 23:16:31 +10:00
</li>
{{ / if }}
2018-01-07 04:55:48 +10:00
</ul>
2018-01-07 23:16:31 +10:00
</div>
2020-03-19 16:32:52 +10:00
<div class="col-md-12 mt-5">
<div id="pager" class="d-flex justify-content-center"></div>
</div>
</main>
{{!-- 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 }} ">