<div class="blade-content __small-wide">
  <div class="blade-inner">
    <div class="inner-block" ng-init="setGridOptions({
                data: 'items',
                rowTemplate: 'item-list.row.html',
                rowHeight: 60,
                columnDefs: [
                        { name: 'name', displayName: 'catalog.blades.measure-units-list.labels.name', width: 100, cellTemplate: 'measureUnitName.cell.html' },
                        { name: 'code', displayName: 'catalog.blades.measure-units-list.labels.code', width: 100  },
                        { name: 'isDefault', displayName: 'catalog.blades.measure-units-list.labels.is-default', width: 150, cellTemplate: 'defaultUnit.cell.html'  }
                ],
                enableCellEditOnFocus: false,
                enablePaginationControls: false
                 })">
      <div class="table-wrapper" ng-if="blade.currentEntity.units.length">
        <div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-selection ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height ui-grid-infinite-scroll></div>
      </div>
      <div class="note" ng-if="!blade.currentEntity.pmPhones.length">{{ 'platform.list.no-data' | translate }}</div>
    </div>
  </div>
</div>


<script type="text/ng-template" id="item-list.row.html">
  <div ng-click='grid.appScope.openDetailBlade(row.entity)'
       ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid"
       ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'"
       class="ui-grid-cell"
       ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id===grid.appScope.selectedNodeId }"
       role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}"
       ui-grid-cell context-menu="grid.appScope.contextMenuEntity = row.entity"
       data-target="cil_menu_{{grid.appScope.blade.level}}"></div>
</script>

<script type="text/ng-template" id="measureUnitName.cell.html">
  <div class="ui-grid-cell-contents">
    <div class="table-t" title="{{COL_FIELD}}">{{COL_FIELD}}</div>
  </div>
</script>

<script type="text/ng-template" id="defaultUnit.cell.html">
  <div style="ui-grid-cell-contents" ng-if="row.entity.isDefault">
    <span class="table-statusDefault" style="margin-top: 16px;">Default</span>
  </div>
</script>

