{{!
* 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.
}}

<div id="step6">
  <h2>{{view.title}}</h2>

  <div class="alert alert-info">{{{view.label}}}</div>
  {{#if anyGeneralIssues}}
  <div class="alert alert-error">
    {{t installer.step6.validationSlavesAndClients.hasIssues}}
    <a href="javascript:void(null);" {{action openSlavesAndClientsIssues target="controller"}}>{{t installer.step6.validationSlavesAndClients.click}}</a>
    {{t installer.step6.validationSlavesAndClients.forDetails}}
  </div>
  {{/if}}

  <div class="pre-scrollable">
    <table class="table" id="component_assign_table">
      <thead>
      <tr>
        <th>{{t common.host}}</th>
        {{#each header in controller.headers}}

          <th>
            <a href="#" {{bindAttr class="header.allChecked:selected:deselected header.isDisabled:remove-link"}}
              {{action "selectAllNodes" header target="controller"}}>{{t all}}</a> &nbsp;|&nbsp; <a
                  href="#" {{bindAttr class="header.noChecked:selected:deselected header.isDisabled:remove-link"}}
            {{action "deselectAllNodes" header target="controller"}}>{{t none}}</a>
          </th>

        {{/each}}
      </tr>
      </thead>
      <tbody>
      {{#if view.pageContent}}
        {{#each host in view.pageContent}}
          <tr>
            {{#view App.WizardStep6HostView hostBinding="host" }}
              <span class="trim_hostname">{{host.hostName}}</span>
              {{#if host.hasMaster}}
                <i class=icon-asterisks>&#10037;</i>
              {{/if}}
            {{/view}}
            {{#each checkbox in host.checkboxes}}
              <td {{bindAttr class="checkbox.hasErrorMessage:error checkbox.hasWarnMessage:warning"}}>
                <label class="checkbox">
                  <input {{bindAttr checked = "checkbox.checked" disabled="checkbox.isDisabled"}} {{action "checkboxClick" checkbox target="view" }}
                          type="checkbox"/>{{checkbox.title}}
                </label>
              </td>
            {{/each}}
          </tr>
          <tr {{bindAttr class="host.anyMessage::hidden"}}>
            <td {{bindAttr colspan="view.columnCount"}} class="no-borders">
              {{#each errorMsg in host.errorMessages}}
                  <div class="alert alert-error">{{errorMsg}}</div>
              {{/each}}
              {{#each warnMsg in host.warnMessages}}
                <div class="alert alert-warning">{{warnMsg}}</div>
              {{/each}}
            </td>
          </tr>
        {{/each}}
      {{/if}}
      </tbody>
    </table>
  </div>
  <div id="hosts">
    <div class="page-bar">
      <div class="items-on-page">
        <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
      </div>
      <div class="info">{{view.paginationInfo}}</div>
      <div class="paging_two_button">
        {{view view.paginationFirst}}
        {{view view.paginationLeft}}
        {{view view.paginationRight}}
        {{view view.paginationLast}}
      </div>
    </div>
  </div>
  <div class="btn-area">
    <a class="btn installer-back-btn" {{action back}}>&larr; {{t common.back}}</a>
    <a class="btn btn-success pull-right" {{bindAttr disabled="submitDisabled"}} {{action next}}>{{t common.next}} &rarr;</a>
  </div>
</div>
