Skip to content

Commit

Permalink
Merge branch 'ahancer-dev' of github.com:Laki7877/col-sp-ui into ahan…
Browse files Browse the repository at this point in the history
…cer-dev
  • Loading branch information
nattphenjati committed Mar 1, 2016
2 parents 214e7fc + 9b0b4f5 commit 430ec17
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 deletions.
16 changes: 1 addition & 15 deletions angular/helpers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ module.exports = ['storage', 'config', 'common', '$window', '$rootScope', '$inte

service.variant = {};

// service.variant.hash = function (a, b) {
// if (!("ValueEn" in a) || a.ValueEn) return "[API Error]";
// if (!('ValueEn' in b) || b.ValueEn) return (a.AttributeId + "-" + a.ValueEn.trim() + "-" + "null" + "-");
// return (a.AttributeId + "-" + a.ValueEn.trim() + "-" + b.AttributeId + "-" + b.ValueEn.trim());
// };

service.variant.toString = function (a, b) {
// if (!("ValueEn" in a) || !a.ValueEn) return "[API Error]";
// if (!('ValueEn' in b) || !b.ValueEn) return a.ValueEn.trim();

var left = null;
var right = null;
left = (a.ValueEn || a.AttributeValueEn || a.AttributeValues.length && a.AttributeValues[0].AttributeValueEn || '');
Expand All @@ -25,12 +16,7 @@ module.exports = ['storage', 'config', 'common', '$window', '$rootScope', '$inte
};

service.uniqueSet = function (a, prop) {
// var seen = new Set();
// return a.filter(function (x) {
// var y = x;
// if (prop) y = x[prop];
// return !seen.has(y) && seen.add(y);
// })

return _.uniqWith(a, function(x,y){
if(x == y) return true;
if(prop && _.get(x, prop) && _.get(y, prop)){
Expand Down
5 changes: 5 additions & 0 deletions angular/template-options/addProductForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ module.exports = {
}
}
},
MasterVariant_DescriptionFull: {
'formGroupClass': 'margin-top-40',
'labelClass': 'required',
'inputSize': 'xxl'
},
MasterVariant_ProductNameTh: {
'labelClass': 'required',
'error': {
Expand Down
2 changes: 1 addition & 1 deletion angular/template.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Generated by grunt-angular-templates
* Tue Mar 01 2016 16:37:38 GMT+0700 (SE Asia Standard Time)
* Tue Mar 01 2016 17:00:51 GMT+0700 (SE Asia Standard Time)
*/
module.exports = ["$templateCache", function($templateCache) { 'use strict';

Expand Down
23 changes: 7 additions & 16 deletions public/assets/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5431,16 +5431,7 @@ module.exports = ['storage', 'config', 'common', '$window', '$rootScope', '$inte

service.variant = {};

// service.variant.hash = function (a, b) {
// if (!("ValueEn" in a) || a.ValueEn) return "[API Error]";
// if (!('ValueEn' in b) || b.ValueEn) return (a.AttributeId + "-" + a.ValueEn.trim() + "-" + "null" + "-");
// return (a.AttributeId + "-" + a.ValueEn.trim() + "-" + b.AttributeId + "-" + b.ValueEn.trim());
// };

service.variant.toString = function (a, b) {
// if (!("ValueEn" in a) || !a.ValueEn) return "[API Error]";
// if (!('ValueEn' in b) || !b.ValueEn) return a.ValueEn.trim();

var left = null;
var right = null;
left = (a.ValueEn || a.AttributeValueEn || a.AttributeValues.length && a.AttributeValues[0].AttributeValueEn || '');
Expand All @@ -5450,12 +5441,7 @@ module.exports = ['storage', 'config', 'common', '$window', '$rootScope', '$inte
};

service.uniqueSet = function (a, prop) {
// var seen = new Set();
// return a.filter(function (x) {
// var y = x;
// if (prop) y = x[prop];
// return !seen.has(y) && seen.add(y);
// })

return _.uniqWith(a, function(x,y){
if(x == y) return true;
if(prop && _.get(x, prop) && _.get(y, prop)){
Expand Down Expand Up @@ -10595,6 +10581,11 @@ module.exports = {
}
}
},
MasterVariant_DescriptionFull: {
'formGroupClass': 'margin-top-40',
'labelClass': 'required',
'inputSize': 'xxl'
},
MasterVariant_ProductNameTh: {
'labelClass': 'required',
'error': {
Expand Down Expand Up @@ -10966,7 +10957,7 @@ module.exports = {
},{}],148:[function(require,module,exports){
/**
* Generated by grunt-angular-templates
* Tue Mar 01 2016 16:37:38 GMT+0700 (SE Asia Standard Time)
* Tue Mar 01 2016 17:00:51 GMT+0700 (SE Asia Standard Time)
*/
module.exports = ["$templateCache", function($templateCache) { 'use strict';

Expand Down
37 changes: 29 additions & 8 deletions templates/partials/add-product-information.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,40 @@
<h2>Description</h2></div>
<div class="form-section-content">

<? $this->insert('components/forms/ckeditor-with-label',
["label" => "Description (English)", "ng_model" => "formData.MasterVariant.DescriptionFullEn", "size" => "xxl", "label_class" => "required"]) ?>


<div nc-template="common/input/form-group-with-label" nc-label="Description (English)"
nc-template-options-path="addProductForm/MasterVariant_DescriptionFull"
nc-template-form="addProductForm.MasterVariant_DescriptionFullEn">
<textarea ng-pattern="/^[^<>]+$/"
ng-ckeditor="ckOptions"
class="form-control" maxlength="500"
name="MasterVariant_DescriptionFullEn" ng-model="formData.MasterVariant.DescriptionFullEn" />
</textarea>
</div>

<div nc-template="common/input/form-group-with-label" nc-label="Short Description (English)" nc-template-options-path="addProductForm/MasterVariant_DescriptionShortEn" nc-template-form="addProductForm.MasterVariant_DescriptionShortEn">
<textarea ng-pattern="/^[^<>ก-๙]+$/" class="form-control" maxlength="500" name="MasterVariant_DescriptionShortEn" ng-model="formData.MasterVariant.DescriptionShortEn" />
</textarea>
</div>

<? $this->insert('components/forms/ckeditor-with-label', ["label" => "Description (ไทย)", "ng_model" => "formData.MasterVariant.DescriptionFullTh", "size" => "xxl", "form_group_class" => "margin-top-40","label_class" => "required"]) ?>
<div nc-template="common/input/form-group-with-label" nc-label="Short Description (ไทย)" nc-template-options-path="addProductForm/MasterVariant_DescriptionShortTh" nc-template-form="addProductForm.MasterVariant_DescriptionShortTh">
<textarea ng-pattern="/^[^<>]+$/" class="form-control" maxlength="500" name="MasterVariant_DescriptionShortTh" ng-model="formData.MasterVariant.DescriptionShortTh" />
</textarea>
</div>



<div nc-template="common/input/form-group-with-label" nc-label="Description (ไทย)"
nc-template-options-path="addProductForm/MasterVariant_DescriptionFull"
nc-template-form="addProductForm.MasterVariant_DescriptionFullTh">
<textarea ng-pattern="/^[^<>]+$/"
ng-ckeditor="ckOptions"
class="form-control" maxlength="500"
name="MasterVariant_DescriptionFullTh" ng-model="formData.MasterVariant.DescriptionFullTh" />
</textarea>
</div>


<div nc-template="common/input/form-group-with-label" nc-label="Short Description (ไทย)" nc-template-options-path="addProductForm/MasterVariant_DescriptionShortTh" nc-template-form="addProductForm.MasterVariant_DescriptionShortTh">
<textarea ng-pattern="/^[^<>]+$/" class="form-control" maxlength="500" name="MasterVariant_DescriptionShortTh" ng-model="formData.MasterVariant.DescriptionShortTh" />
</textarea>
</div>

</div>
</div>
Expand Down

0 comments on commit 430ec17

Please sign in to comment.