<div class="blade-content">
  <div class="blade-inner">
    <div class="inner-block">
      <form class="form" name="detailForm">
        <va-metaform blade="blade" registered-inputs="blade.metaFields" column-count="1" ng-init="setForm(detailForm)"></va-metaform>
        <div class="form-group">
          <va-widget-container group="addressDetail" blade="blade" data="blade.currentEntity" gridster-opts="{columns: 3}"></va-widget-container>
        </div>
      </form>
    </div>
  </div>
</div>

<script id="addressTypeSelector.html" type="text/ng-template">
  <label class="form-label">{{ 'orders.blades.address-details.labels.address-type' | translate }}</label>
  <div class="form-input">
    <ui-select ng-model="blade.currentEntity.addressType">
      <ui-select-match placeholder="{{ 'orders.blades.address-details.placeholders.address-type' | translate }}">{{$select.selected}}</ui-select-match>
      <ui-select-choices repeat="x as x in blade.addressTypes | filter: $select.search">
        <span ng-bind-html="x | highlight: $select.search"></span>
      </ui-select-choices>
    </ui-select>
  </div>
</script>
<script id="countrySelector.html" type="text/ng-template">
  <label class="form-label">{{ 'orders.blades.address-details.labels.country' | translate }}</label>
  <div class="form-input">
    <ui-select ng-model="blade.currentEntity.countryCode" required>
      <ui-select-match placeholder="{{ 'orders.blades.address-details.placeholders.country' | translate }}">{{$select.selected.displayName}}</ui-select-match>
      <ui-select-choices repeat="x.id as x in blade.countries | filter: $select.search">
        <span ng-bind-html="x.displayName | highlight: $select.search"></span>
      </ui-select-choices>
    </ui-select>
  </div>
</script>
<script id="countryRegionSelector.html" type="text/ng-template">
  <label class="form-label">{{ 'customer.blades.address-details.labels.region' | translate }}</label>
  <div class="form-input">
    <ui-select ng-model="blade.currentEntity.regionName">
      <ui-select-match placeholder="{{ 'customer.blades.address-details.placeholders.region' | translate }}">{{$select.selected.displayName}}</ui-select-match>
      <ui-select-choices repeat="x.name as x in blade.getRegions($select.search) | filter: $select.search track by $index">
        <span ng-bind-html="x.displayName | highlight: $select.search"></span>
      </ui-select-choices>
    </ui-select>
  </div>
</script>
<script id="description.html" type="text/ng-template">
  <label class="form-label">{{ 'customer.blades.address-details.labels.description' | translate }}</label>
  <div class="form-input">
    <textarea maxlength="128" ng-model="blade.currentEntity.description" placeholder="{{ 'customer.blades.address-details.placeholders.description' | translate }}"></textarea>
  </div>
</script>
