2018-02-12 05:47:26 +10:00
|
|
|
{{> partials/menu}}
|
2019-12-26 20:32:28 +10:00
|
|
|
<div class="col-sm-9 top-pad-5">
|
2019-12-16 12:30:30 +10:00
|
|
|
<form class="form-horizontal" id="productEditForm" data-toggle="validator">
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="page-header">
|
|
|
|
<div class="pull-right">
|
|
|
|
<button type="button" class="btn btn-outline-info" data-toggle="modal" data-target="#myModal">{{ @root.__ "Upload image" }}</button>
|
|
|
|
<button id="productUpdate" class="btn btn-outline-success">{{ @root.__ "Save product" }} <i class="fa fa-floppy-o"></i></button>
|
|
|
|
</div>
|
|
|
|
<h2>{{ @root.__ "Edit product" }}</h2>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productTitle" class="control-label">{{ @root.__ "Product title" }} *</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="text" id="productTitle" class="form-control" minlength="5" maxlength="200" value="{{result.productTitle}}" required/>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productPrice" class="control-label">{{ @root.__ "Product price" }} *</label>
|
2018-01-07 04:55:48 +10:00
|
|
|
<div class="input-group">
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="input-group-prepend">
|
|
|
|
<label class="input-group-text">{{currencySymbol config.currencySymbol}}</label>
|
|
|
|
</div>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="number" id="productPrice" class="form-control" value="{{result.productPrice}}" step="any" required/>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productPublished" class="control-label">{{ @root.__ "Status" }}</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<select class="form-control" id="productPublished">
|
2019-11-06 18:31:25 +10:00
|
|
|
<option value="true" {{selectState result.productPublished "true"}}>{{ @root.__ "Published" }}</option>
|
|
|
|
<option value="false" {{selectState result.productPublished "false"}}>{{ @root.__ "Draft" }}</option>
|
2018-01-07 04:55:48 +10:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-09 20:46:41 +10:00
|
|
|
{{#if config.trackStock}}
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productStock" class="control-label">{{ @root.__ "Stock level" }}</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="number" id="productStock" class="form-control" value="{{result.productStock}}" step="any" />
|
2019-02-09 14:07:02 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-09 20:46:41 +10:00
|
|
|
{{/if}}
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productDescription" class="control-label">{{ @root.__ "Product description" }} *</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<textarea minlength="5" rows="10" id="productDescription" class="form-control" required>{{result.productDescription}}</textarea>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label">Permalink</label>
|
2018-01-07 04:55:48 +10:00
|
|
|
<div class="input-group">
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="text" class="form-control" id="productPermalink" placeholder="Permalink for the article" value={{result.productPermalink}}>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="input-group-append">
|
|
|
|
<button class="btn btn-outline-success" id="validate_permalink" type="button">{{ @root.__ "Validate" }}</button>
|
|
|
|
</div>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
2019-11-06 18:31:25 +10:00
|
|
|
<p class="help-block">{{ @root.__ "This sets a readable URL for the product" }}</p>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="hidden" id="productOptions" value="{{stringify result.productOptions}}" />
|
|
|
|
<label class="control-label">{{ @root.__ "Product options" }}</label>
|
2018-01-07 04:55:48 +10:00
|
|
|
<ul class="list-group" id="product_opt_wrapper">
|
|
|
|
<li class="list-group-item">
|
|
|
|
<div class="row">
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-2">
|
2019-11-06 18:31:25 +10:00
|
|
|
<strong>{{ @root.__ "Name" }}:</strong>
|
2018-01-07 04:55:48 +10:00
|
|
|
<input type="text" id="product_optName" class="form-control" placeholder="size" />
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-2">
|
2019-11-06 18:31:25 +10:00
|
|
|
<strong>{{ @root.__ "Label" }}:</strong>
|
2018-01-07 04:55:48 +10:00
|
|
|
<input type="text" id="product_optLabel" class="form-control" placeholder="Select size"/>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-2">
|
2019-11-06 18:31:25 +10:00
|
|
|
<strong>{{ @root.__ "Type" }}:</strong>
|
2018-01-07 04:55:48 +10:00
|
|
|
<select id="product_optType" class="form-control">
|
|
|
|
<option value="select">Select</option>
|
|
|
|
<option value="radio">Radio</option>
|
|
|
|
<option value="checkbox">Checkbox</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-4">
|
2019-11-06 18:31:25 +10:00
|
|
|
<strong>{{ @root.__ "Options" }}:</strong>
|
2018-01-07 04:55:48 +10:00
|
|
|
<input type="text" id="product_optOptions" class="form-control" placeholder="comma, seporated, list"/>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-2 text-right"></br>
|
|
|
|
<button id="product_opt_add" class="btn btn-outline-success">{{ @root.__ "Add" }}</button>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div></div>
|
|
|
|
</li>
|
|
|
|
{{#each options}}
|
|
|
|
<li class="list-group-item">
|
|
|
|
<div class="row">
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class='col-sm-2 opt-name'>{{this.optName}}</div>
|
|
|
|
<div class='col-sm-2'>{{this.optLabel}}</div>
|
|
|
|
<div class='col-sm-2'>{{this.optType}}</div>
|
|
|
|
<div class='col-sm-4'>{{{this.optOptions}}}</div>
|
|
|
|
<div class='col-sm-2 text-right'>
|
|
|
|
<button class='product_opt_remove btn btn-outline-danger'>{{ @root.__ "Remove" }}</button>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
2019-11-06 18:31:25 +10:00
|
|
|
<p class="help-block">{{ @root.__ "Here you can set options for your product. Eg: Size, color, style" }}</p>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-11-06 20:40:27 +10:00
|
|
|
{{#ifCond config.paymentGateway '==' 'stripe'}}
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label">Subscription plan</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="text" class="form-control" id="productSubscription" placeholder="plan_XXXXXXXXXXXXXX" value={{@root.result.productSubscription}}>
|
2019-11-06 20:40:27 +10:00
|
|
|
<p class="help-block">First setup the plan in <strong>Stripe</strong> dashboard and enter the Plan ID. Format: plan_XXXXXXXXXXXXXX</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/ifCond}}
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productComment" class="control-label">{{ @root.__ "Allow comment" }}</label>
|
2018-10-05 21:54:42 +10:00
|
|
|
<div class="checkbox">
|
|
|
|
<label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input class="productComment" type="checkbox" {{checkedState result.productComment}} id="productComment">
|
2018-10-05 21:54:42 +10:00
|
|
|
</label>
|
|
|
|
</div>
|
2019-11-06 18:31:25 +10:00
|
|
|
<p class="help-block">{{ @root.__ "Allow free form comments when adding products to cart" }}</p>
|
2018-10-05 21:54:42 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="productTags" class="control-label">{{ @root.__ "Product tag words" }}</label>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="text" class="form-control" id="productTags" value="{{result.productTags}}">
|
2019-11-06 18:31:25 +10:00
|
|
|
<p class="help-block">{{ @root.__ "Tag words used to indexed products, making them easier to find and filter." }}</p>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<div class="col-sm-12">
|
|
|
|
<div id="product-images">
|
|
|
|
<h2>{{ @root.__ "Product images" }}</h2>
|
|
|
|
{{#if images}}
|
|
|
|
<div class="row">
|
|
|
|
{{#each images}}
|
2019-12-30 16:51:53 +10:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<p>
|
|
|
|
<a data-id="{{this.path}}" class="btn-delete-image btn btn-outline-danger">{{ @root.__ "Delete" }}</a>
|
|
|
|
{{#ifCond this.productImage '==' true}}
|
|
|
|
<span class="label label-info">{{ @root.__ "main image" }}</span>
|
|
|
|
{{else}}
|
|
|
|
<a data-id="{{../this.path}}" class="set-as-main-image btn btn-outline-success">{{ @root.__ "Set as main image" }}</a>
|
|
|
|
{{/ifCond}}
|
|
|
|
</p>
|
|
|
|
<img src="{{this.path}}" class="product-main-image img-fluid">
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
2019-12-30 16:51:53 +10:00
|
|
|
{{/each}}
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
{{else}}
|
|
|
|
<h4 class="text-warning">{{ @root.__ "No images have been uploaded for this product" }}</h4>
|
|
|
|
{{/if}}
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-16 12:30:30 +10:00
|
|
|
<input type="hidden" id="productId" value="{{result._id}}" />
|
2018-01-07 04:55:48 +10:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Modal -->
|
|
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
2019-12-07 09:41:18 +10:00
|
|
|
<form method="post" id="uploadForm" enctype="multipart/form-data"></form>
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
|
|
|
<h4 class="modal-title" id="myModalLabel">{{ @root.__ "Product image upload" }}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2019-12-26 13:23:21 +10:00
|
|
|
<span class="btn btn-outline-info btn-file">
|
2019-12-07 09:41:18 +10:00
|
|
|
{{ @root.__ "Select file" }}<input type="file" name="uploadFile" id="uploadFile" form="uploadForm">
|
|
|
|
</span>
|
|
|
|
<input type="hidden" id="productId" name="productId" value="{{result._id}}"/>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
2019-12-26 13:23:21 +10:00
|
|
|
<button type="button" id="uploadButton" class="btn btn-outline-primary">{{ @root.__ "Upload" }}</button>
|
2019-12-07 09:41:18 +10:00
|
|
|
</div>
|
2018-01-07 04:55:48 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-26 13:23:21 +10:00
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.min.js" integrity="sha256-Q4K0T9IUORjpebn9dIu9szj2Rgn7GmLF+S3RjgM8aXw=" crossorigin="anonymous"></script>
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css" integrity="sha256-f/v2ew/bb0v4el1ALE7bOoXGUDWGk2k+dkPLo3JPhLw=" crossorigin="anonymous" />
|
2018-01-07 04:55:48 +10:00
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
2019-12-16 12:30:30 +10:00
|
|
|
$('#productDescription').summernote({
|
2018-01-07 04:55:48 +10:00
|
|
|
height: 300,
|
|
|
|
minHeight: null
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|