<div class="blade-content __medium-wide">
  <div class="blade-inner">
    <div class="inner-block">
      <form name="detailForm" class="form">
        <va-metaform registered-inputs="blade.metaFields" blade="blade" column-count="2" ng-if="blade.currentEntity" ng-init="setForm(detailForm)"></va-metaform>
      </form>

      <va-widget-container group="categoryDetail" blade="blade" data="blade.currentEntity" gridster-opts="{columns: 4}" class="form-group"></va-widget-container>
    </div>
  </div>
</div>

<script type="text/ng-template" id="category-details-is-active.html">
  <div class="form-input">
    <label class="form-label __switch">
      <input type="checkbox" ng-model="blade.currentEntity.isActive">
      <span class="switch"></span>
    </label>
  </div>
  <div class="form-error" ng-if="!blade.currentEntity.parentIsActive">
    <div class="vc-alert vc-alert--warning">
      <svg class="vc-alert__icon">
        <use href="/images/error.svg#icon"></use>
      </svg>
      <div class="vc-alert__text">{{ 'catalog.blades.category-detail.parent-disabled-alert' | translate }}</div>
    </div>
  </div>
</script>
<script type="text/ng-template" id="code.html">
  <div class="form-input">
    <input required class="form-control" ng-model="blade.currentEntity.code" placeholder="{{'catalog.blades.category-detail.placeholders.code' | translate}}" name="code" ui-validate=" 'blade.codeValidator($value)' " />
  </div>
  <div class="form-error" data-ng-show="blade.formScope.code.$error.validator">
    {{ 'catalog.blades.category-detail.validations.code' | translate }}
  </div>
</script>
<script type="text/ng-template" id="taxType.html">
  <div class="form-group">
    <label class="form-label">{{ 'catalog.blades.category-detail.labels.tax-type' | translate }} <a href="" ng-click="blade.openDictionarySettingManagement()" class="form-edit" va-permission="platform:setting:update"><i class="form-ico fa fa-pencil"></i></a></label>
    <div class="form-input">
      <ui-select ng-model="blade.currentEntity.taxType">
        <ui-select-match allow-clear="true" placeholder="{{'catalog.blades.category-detail.placeholders.select' | 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>
</script>
<script type="text/ng-template" id="localizedName.html">
  <div class="vc-catalog form-input __langs" ng-repeat="language in blade.catalog.languages | limitTo: blade.showAllLanguages ? blade.catalog.languages.length : 2">
    <label class="lang-code">{{language.languageCode}}</label>
    <input ng-model="blade.currentEntity.localizedName.values[language.languageCode]" type="text" ng-maxlength="1024" placeholder="{{ 'catalog.blades.category-detail.placeholders.name' | translate }}" />
  </div>
  <div ng-if="blade.catalog.languages.length > 2">
    <a href="" ng-click="blade.showAllLanguages = !blade.showAllLanguages">
      {{ (blade.showAllLanguages ? 'catalog.blades.category-detail.labels.show-less-languages' : 'catalog.blades.category-detail.labels.show-more-languages') | translate }}
    </a>
  </div>
</script>
