Skip to content

Commit

Permalink
shud be fine now
Browse files Browse the repository at this point in the history
  • Loading branch information
terragou committed Mar 1, 2016
1 parent 032f24b commit 2f3eb01
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
3 changes: 1 addition & 2 deletions angular/controllers/productAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,13 @@ module.exports = function ($scope, $uibModal, $window, util, config, Product, Im
};

var secondAttribute = {
AttributeId: $scope.dataSet.attributeOptions[0].Attribute.AttributeId,
AttributeId: $scope.dataSet.attributeOptions[1].Attribute.AttributeId,
AttributeValues: (!BVId ? [] : [{
AttributeValueId: BVId
}]),
ValueEn: B
};


kpair.FirstAttribute = firstAttribute;
kpair.SecondAttribute = secondAttribute;
kpair.text = util.variant.toString(firstAttribute, secondAttribute);
Expand Down
2 changes: 1 addition & 1 deletion public/assets/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,7 @@ module.exports = ["$scope", "$uibModal", "$window", "util", "config", "Product",
};

var secondAttribute = {
AttributeId: $scope.dataSet.attributeOptions[0].Attribute.AttributeId,
AttributeId: $scope.dataSet.attributeOptions[1].Attribute.AttributeId,
AttributeValues: (!BVId ? [] : [{
AttributeValueId: BVId
}]),
Expand Down
3 changes: 2 additions & 1 deletion templates/partials/add-product-variation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<option value="" disabled selected>Select an option..</option>
</select>
</div>



<div ng-template="common/input/width-field-large" ng-template-options="{
'error' : {
Expand Down Expand Up @@ -71,7 +73,6 @@

<input ng-if="!dataSet.attributeOptions[jth].Attribute.DataType" type="text" disabled class="form-control" />


</div>
<!--</div>-->

Expand Down
56 changes: 29 additions & 27 deletions templates/partials/coupon_condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</div>
</div>
<div ng-show="formData.Conditions.Order[0].Type == 'PriceGT'"
ng-init="formData.Conditions.Order[0].Type = 'None'"
<div ng-show="formData.Conditions.Order[0].Type == CF_TOTAL_PRICE_MT"
ng-init="formData.Conditions.Order[0].Type = CF_NO_FILTER"
nc-template="common/input/form-group-with-label" nc-label="Price" nc-template-options-path="couponForm/ConditionValue">
<input type="text" ng-model="formData.Conditions.Order[0].Value" class="form-control"/>
</div>
Expand All @@ -27,45 +27,45 @@
<div class="form-section-header"><h2>Filter By...</h2></div>
<div class="form-section-content">
<div nc-template="common/input/form-group-with-label" nc-label="Criteria">
<div class="ah-select2-dropdown">
<select ng-init="formData.Conditions.FilterBy[0].Type = 'None'"
ng-model="formData.Conditions.FilterBy[0].Type" class="form-control" required>
<option ng-repeat="opt in dataSet.filters" value="{{ opt.value }}">
{{ opt.text }}
</option>
</select>
</div>
<div class="ah-select2-dropdown">
<select ng-model="formData.Conditions.FilterBy.Type" class="form-control" required>
<option ng-repeat="opt in dataSet.filters" value="{{ opt.value }}">
{{ opt.text }}
</option>
</select>
</div>
</div>
<div nc-template="common/input/form-group-with-label" nc-template-options-path="couponForm/FilterByValue"
nc-label="Include" ng-show="formData.Conditions.FilterBy[0].Type != 'None'">
<ui-select multiple ng-model="formData.Conditions.FilterBy[0].Value"
ng-init="formData.Conditions.FilterBy[0].Value = []"
ng-if="formData.Conditions.FilterBy[0].Type == 'Brand'">
nc-label="Include" ng-show="formData.Conditions.FilterBy.Type != CF_NO_FILTER">
<ui-select multiple ng-model="formData.Conditions.FilterBy.Brands"
ng-if="formData.Conditions.FilterBy.Type == 'Brand'">
<ui-select-match placeholder="Search by Brand...">
<span ng-bind="$item.BrandNameEn"></span>
</ui-select-match>
<ui-select-choices ui-disable-choice="item.disabled" refresh-delay="1000" refresh="refreshBrands($select.search)"
repeat="item in (dataSet.Brands) | filter : $select.search track by item.BrandId">
<ui-select-choices ui-disable-choice="item.disabled"
refresh-delay="1000"
refresh="refreshBrands($select.search)"
repeat="item in (dataSet.Brands | exclude: (formData.Conditions.FilterBy.Brands || []) : 'BrandId' ) | filter : $select.search track by item.BrandId">
<span>{{ item.BrandNameEn }} </span>
<span ng-if="item.BrandNameTh">/ {{ item.BrandNameTh }}</span>
</ui-select-choices>
</ui-select>
<ui-select multiple tagging tagging-label="(new)" ng-init="formData.Conditions.FilterBy[0].Value = []"
ng-model="formData.Conditions.FilterBy[0].Value" ng-if="formData.Conditions.FilterBy[0].Type == 'Email'">
<ui-select multiple tagging tagging-label="(new)"
ng-model="formData.Conditions.FilterBy.Emails" ng-if="formData.Conditions.FilterBy.Type == 'Email'">
<ui-select-match placeholder="Type emails">
{{ $item }}
</ui-select-match>
<ui-select-choices repeat="color in [] | filter:$select.search">
{{color}}
</ui-select-choices>
</ui-select>
<ui-select multiple ng-model="formData.Conditions.FilterBy[0].Value"
ng-init="formData.Conditions.FilterBy[0].Value = []"
ng-if="formData.Conditions.FilterBy[0].Type == 'Shop'">
<ui-select multiple ng-model="formData.Conditions.FilterBy.Shops"
ng-if="formData.Conditions.FilterBy.Type == 'Shop'">
<ui-select-match placeholder="Search by Shop name or Shop Id...">
<span ng-bind="$item.ShopNameEn"></span>
</ui-select-match>
<ui-select-choices ui-disable-choice="item.disabled" refresh-delay="1000" refresh="refreshShops($select.search)" repeat="item in (dataSet.Shops) | filter : $select.search track by item.ShopId">
<ui-select-choices ui-disable-choice="item.disabled" refresh-delay="1000" refresh="refreshShops($select.search)"
repeat="item in (dataSet.Shops) | filter : $select.search track by item.ShopId">
<span>{{ item.ShopNameEn }} </span>
<span ng-if="item.ShopNameTh">/ {{ item.ShopNameTh }}</span>
</ui-select-choices>
Expand All @@ -81,11 +81,12 @@
<div nc-template="common/input/form-group-with-label"
nc-template-options-path="couponForm/IncludeProducts"
nc-label="Products">
<ui-select multiple ng-model="formData.Conditions.Include" ng-init="formData.Conditions.Include = []">
<ui-select multiple ng-model="formData.Conditions.Include">
<ui-select-match placeholder="Search by Product Name or PID...">
<span>{{ $item.ProductNameEn }} ({{ $item.Pid }}) </span>
</ui-select-match>
<ui-select-choices refresh-delay="1000" refresh="refreshProducts($select.search)" repeat="item in (dataSet.Products) | filter : $select.search track by item.Pid">
<ui-select-choices refresh-delay="1000" refresh="refreshProducts($select.search)"
repeat="item in (dataSet.Products) | filter : $select.search track by item.Pid">
<span>{{ item.ProductNameEn }} ({{ item.Pid }}) </span>
</ui-select-choices>
</ui-select>
Expand All @@ -98,11 +99,12 @@
<div nc-template="common/input/form-group-with-label"
nc-template-options-path="couponForm/IncludeProducts"
nc-label="Products">
<ui-select multiple ng-model="formData.Conditions.Exclude" ng-init="formData.Conditions.Exclude = []">
<ui-select multiple ng-model="formData.Conditions.Exclude" >
<ui-select-match placeholder="Search by Product Name or PID...">
<span>{{ $item.ProductNameEn }} ({{ $item.Pid }}) </span>
</ui-select-match>
<ui-select-choices refresh-delay="1000" refresh="refreshProducts($select.search)" repeat="item in (dataSet.Products) | filter : $select.search track by item.Pid">
<ui-select-choices refresh-delay="1000" refresh="refreshProducts($select.search)"
repeat="item in (dataSet.Products) | filter : $select.search track by item.Pid">
<span>{{ item.ProductNameEn }} ({{ item.Pid }}) </span>
</ui-select-choices>
</ui-select>
Expand All @@ -111,4 +113,4 @@
</div>
</div>
</div>
</div>
</div>

0 comments on commit 2f3eb01

Please sign in to comment.