<div class="blade-static __bottom" ng-include="'Modules/$(virtoCommerce.catalog)/Scripts/blades/common/templates/ok-cancel.tpl.html'"></div>
<div class="blade-content __gray">
    <div class="blade-inner">
        <div class="inner-block">
            <form name="propertiesForm" class="form">
                <fieldset ng-repeat="propGroup in blade.propGroups" ng-init="setForm(propertiesForm)">
                    <legend>
                        {{ propGroup.title | translate }}: <span class="count">{{properties.length | number:0}}</span>
                    </legend>
                    <div class="form-group list __info" ng-repeat="prop in properties = (blade.currentEntities | filter: {type:propGroup.type})">

                        <div class="form-group" ng-show="!prop.id && prop.name === 'Vendor'">
                            <label class="form-label">{{ 'catalog.blades.item-detail.labels.vendor' | translate }} </label>
                            <div class="form-input">
                                <ui-select ng-model="blade.vendor">
                                    <ui-select-match allow-clear placeholder="{{ 'catalog.blades.item-detail.placeholders.vendor' | translate }}">{{$select.selected.name}}</ui-select-match>
                                    <ui-select-choices repeat="x.id as x in blade.vendors | filter: {name: $select.search}">
                                        <span ng-bind-html="x.name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>


                        <div class="form-group" ng-show="!prop.id && prop.name === 'TaxType'">
                            <label class="form-label">{{ 'catalog.blades.item-detail.labels.tax-type' | translate }}</label>
                            <div class="form-input">
                                <ui-select ng-model="blade.taxType">
                                    <ui-select-match allow-clear="true" placeholder="{{ 'catalog.blades.item-detail.placeholders.tax-type' | translate }}">{{$select.selected}}</ui-select-match>
                                    <ui-select-choices repeat="x in blade.taxTypes | filter: $select.search">
                                        <span ng-bind-html="x | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>


                        <div class="form-group" ng-show="!prop.id && prop.name === 'WeightUnit'">
                            <label class="form-label">{{ 'catalog.blades.item-detail.labels.weight-unit' | translate }} </label>
                            <div class="form-input">
                                <ui-select ng-model="blade.weightUnit">
                                    <ui-select-match allow-clear="true" placeholder="{{ 'catalog.blades.item-detail.placeholders.weight-unit' | translate }}">{{$select.selected}}</ui-select-match>
                                    <ui-select-choices repeat="x in blade.weightUnits | filter: $select.search">
                                        <span ng-bind-html="x | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>
                        <div class="form-group" ng-show="!prop.id && prop.name === 'PackageType'">
                            <label class="form-label">{{ 'catalog.blades.item-detail.labels.package-type' | translate }} </label>
                            <div class="form-input">
                                <ui-select ng-model="blade.packageType">
                                    <ui-select-match allow-clear="true" placeholder="N/A">{{$select.selected.name}}</ui-select-match>
                                    <ui-select-choices repeat="x.id as x in blade.packageTypes | filter: $select.search">
                                        <span ng-bind-html="x.name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>

                        <div class="form-group" ng-show="!prop.id && prop.name === 'MeasureUnit'">
                            <label class="form-label">{{ 'catalog.blades.item-detail.labels.measure-unit' | translate }} </label>
                            <div class="form-input">
                                <ui-select ng-model="blade.measureUnit">
                                    <ui-select-match allow-clear="true" placeholder="N/A">{{$select.selected}}</ui-select-match>
                                    <ui-select-choices repeat="x in blade.measureUnits | filter: $select.search">
                                        <span ng-bind-html="x | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                            </div>
                        </div>

                        <label class="form-label" ng-show="prop.UseDefaultUIForEdit"> {{prop.name}} {{ getPropertyDisplayName(prop) ? '(' + getPropertyDisplayName(prop) + ')' : '' }}
                            <!--<a href="" ng-click="editProperty(prop)" class="form-edit">
                                <i class="form-ico fa fa-pencil"></i>
                            </a>-->
                        </label>

                        <va-property2 ng-show="prop.UseDefaultUIForEdit" ng-model="prop" get-prop-values="getPropValues" get-units="getUnitsOfMeasure" ng-if="!prop.isReadOnly" languages="blade.languages" default-language="blade.defaultLanguage"></va-property2>
                    </div>
                    <div class="note" ng-if="properties.length == 0">{{ 'catalog.blades.property-list.labels.empty-list' | translate }}</div>
                </fieldset>
            </form>
        </div>
    </div>
</div>
