{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
<table class="table advanced-header-table table-bordered table-striped">
  <thead>
  {{#view view.sortView classNames="label-row" contentBinding="view.filteredContent"}}
    {{view view.parentView.stackSort classNames="first"}}
    {{view view.parentView.repoVersionSort}}
    {{view view.parentView.statusSort}}
    <th></th>
  {{/view}}
  <tr class="filter-row">
    <th class="first stack-name-filter">{{view view.stackFilterView}}</th>
    <th class="repo-version-filter">{{view view.repoVersionFilterView}}</th>
    <th class="status-filter">{{view view.statusFilterView}}</th>
    <th> </th>
  </tr>
  </thead>
  <tbody>
  {{#if view.pageContent}}
    {{#each view.pageContent}}
      <tr>
        <td class="first stack-name">{{this.stack}}</td>
        <td class="repo-version">{{this.displayName}}</td>
        <td class="host-stack-version-status">
          {{#if this.isCurrent}}
            <span class="label label-success">{{t common.current}}</span>
          {{else}}
            {{#if this.isInstalling}}
              <a href="#" {{action showInstallProgress this target="view"}}><i class="icon-cog in_progress"></i>&nbsp;{{this.displayStatus}}</a>
            {{else}}
              {{this.displayStatus}}
              {{#if this.isOutOfSync}}
                {{view view.outOfSyncInfo}}
              {{/if}}
            {{/if}}
          {{/if}}
        </td>
        <td class="install-repo-version align-center">
          {{#isAccessible ADMIN}}
            <button class="btn" {{action installVersionConfirmation this target="controller"}} {{bindAttr disabled="this.installDisabled"}}><i class="icon-off"></i>&nbsp;{{t common.install}}</button>
          {{/isAccessible}}
        </td>
      </tr>
    {{/each}}
  {{else}}
    <tr>
      <td colspan="4" class="first">
        {{t hosts.host.stackVersions.table.noVersions}}
      </td>
    </tr>
  {{/if}}
  </tbody>
</table>

<div class="page-bar">
  <div class="filtered-info span4">
    <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}}
      href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  </div>
  <div class="items-on-page">
    <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.parentView.displayLength"}}</label>
  </div>
  <div class="info">{{view.paginationInfo}}</div>
  <div class="paging_two_button">
    {{view view.paginationLeft}}
    {{view view.paginationRight}}
  </div>
</div>
