<div class="blade-static __bottom" ng-include="'$(Platform)/Scripts/common/templates/ok-cancel.tpl.html'"></div>
<div class="blade-content">
  <div class="blade-inner">
    <div class="inner-block">
      <form class="form" name="measureDetailsForm">
        <va-metaform blade="blade" registered-inputs="blade.metaFields" column-count="1" ng-init="setForm(measureDetailsForm)"></va-metaform>
      </form>
    </div>
  </div>
</div>

<script type="text/ng-template" id="measure-unit-details-code.html">
  <div class="form-group">
    <label class="form-label">{{ 'catalog.blades.measure-unit-details.labels.code' | translate }}</label>
    <div class="form-input">
      <input required ng-readonly="!blade.isNew" class="form-control" ng-model="blade.currentEntity.code" name="code" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.code' | translate }}" />
    </div>
    <span class="comment-text" ng-if="blade.errorMessage">
      <img src="/images/layout/warning.svg" class="comment-icon">
      <span ng-if="blade.errorMessage === 'code-naming-error'">
        {{ 'catalog.blades.measure-unit-details.labels.code-naming-error' | translate }}
      </span>
    </span>
  </div>
</script>

<script type="text/ng-template" id="measure-unit-details-name.html">
  <div class="form-group">
    <label class="form-label" for="">{{ 'catalog.blades.measure-unit-details.labels.name' | translate }}</label>
    <div class="form-input">
      <input focus-on="" required class="form-control" ng-model="blade.currentEntity.name" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.name' | translate }}" />
    </div>
  </div>
  <div class="form-group">
    <label class="form-label" for="">{{ 'catalog.blades.measure-unit-details.labels.localized-name' | translate }}</label>
    <div class="vc-catalog form-input __langs" ng-repeat="language in blade.languages | limitTo: blade.showNameAllLanguages ? blade.languages.length : 2">
      <label class="lang-code">{{language}}</label>
      <input ng-model="blade.currentEntity.localizedName.values[language]" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.localized-name' | translate }}" class="vc-catalog form-control" />
    </div>
    <div ng-if="blade.languages.length > 2">
      <a href="" ng-click="blade.showNameAllLanguages = !blade.showNameAllLanguages">
        {{ (blade.showNameAllLanguages ? 'catalog.blades.item-detail.labels.show-less-languages' : 'catalog.blades.item-detail.labels.show-more-languages' ) | translate }}
      </a>
    </div>
  </div>
</script>

<script type="text/ng-template" id="measure-unit-details-conversion-factor.html">
  <div class="form-group">
    <label class="form-label">{{ 'catalog.blades.measure-unit-details.labels.conversion-factor' | translate }}</label>
    <div class="form-editor form-input">
      <input class="form-input" smart-float required num-type="float" fraction="6" min="0.000001" ng-model="blade.currentEntity.conversionFactor" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.conversion-factor' | translate }}" />
    </div>
  </div>
</script>

<script type="text/ng-template" id="measure-unit-details-symbol.html">
  <div class="form-group">
    <label class="form-label" for="">{{ 'catalog.blades.measure-unit-details.labels.symbol' | translate }}</label>
    <div class="form-input">
      <input focus-on="" required class="form-control" ng-model="blade.currentEntity.symbol" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.symbol' | translate }}" />
    </div>
  </div>
  <div class="form-group">
    <label class="form-label" for="">{{ 'catalog.blades.measure-unit-details.labels.localized-symbol' | translate }}</label>
    <div class="vc-catalog form-input __langs" ng-repeat="language in blade.languages | limitTo: blade.showSymbolAllLanguages ? blade.languages.length : 2">
      <label class="lang-code">{{language}}</label>
      <input ng-model="blade.currentEntity.localizedSymbol.values[language]" placeholder="{{ 'catalog.blades.measure-unit-details.placeholders.localized-symbol' | translate }}" class="vc-catalog form-control" />
    </div>
    <div ng-if="blade.languages.length > 2">
      <a href="" ng-click="blade.showSymbolAllLanguages = !blade.showSymbolAllLanguages">
        {{ (blade.showSymbolAllLanguages ? 'catalog.blades.item-detail.labels.show-less-languages' : 'catalog.blades.item-detail.labels.show-more-languages' ) | translate }}
      </a>
    </div>
  </div>
</script>
