<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" ng-if="blade.filteredProperties.length">{{(blade.currentEntities | filter: isPropertyVisible | filter: {type:propGroup.type}).length |  number:0}}/</span>
                        <span class="count">{{(blade.currentEntity.properties | filter: {type:propGroup.type}).length | number:0}}</span>
                        <span ng-if="blade.filteredProperties.length">
                            <span class="filtered-label">filtered</span>
                            <a class="form-ico fa fa-pencil filter-quickaction" ng-click="editPropertyFilter()"></a>
                            <a class="btn-ico fa fa-times-circle filter-quickaction" ng-click="resetFilter()"></a>
                        </span>
                    </legend>
                    <div class="form-group list __info" ng-repeat="prop in properties = (blade.currentEntities | filter: {type:propGroup.type} | filter: isPropertyVisible | filter: isPropertyHasValues | orderBy: 'displayOrder')">
                        <label class="form-label">
                            {{prop.name}} {{ getPropertyDisplayName(prop) ? '(' + getPropertyDisplayName(prop) + ')' : '' }}
                            <span class="alt-description" ng-if="isPropertyChanged(prop)"> {{'catalog.blades.property-list.labels.modified' | translate }} </span>
                            <a ng-if="canEditProperty(prop)" href="" ng-click="editProperty(prop)" class="form-edit">
                                <i class="form-ico fa fa-pencil"></i>
                            </a>
                        </label>
                        <va-property2 ng-model="prop" get-prop-values="getPropValues" get-units="getUnitsOfMeasure" ng-if="!prop.isReadOnly" languages="blade.languages" default-language="blade.defaultLanguage" hidden-languages="prop.$$hiddenLanguages"></va-property2>
                    </div>
                    <div class="note" ng-if="properties.length == 0">{{ 'catalog.blades.property-list.labels.empty-list' | translate }}</div>
                </fieldset>
                <fieldset ng-if="blade.entityType == 'category'">
                    <legend>{{ 'catalog.blades.property-list.labels.excluded' | translate }}</legend>
                    <div class="form-group list __info">
                        <ui-select multiple ng-model="blade.currentEntity.excludedProperties">
                            <ui-select-match placeholder="{{ 'catalog.blades.property-list.placeholders.excluded' | translate }}">{{$item.name}}</ui-select-match>
                            <ui-select-choices repeat="x in blade.propertiesForExclude | filter: {name: $select.search}">
                                <span ng-bind-html="x.name | highlight: $select.search"></span>
                            </ui-select-choices>
                        </ui-select>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>
