<div class="col-xs-12 force-padding full-height">
  <div
    bs-active-pane="tabs.activeTab"
    ng-model="tabs.activeTab"
    ng-show="tabs.length > 1 && !uniqueElement"
    ng-hide="hideList"
    bs-tabs
  >
    <div
      ng-repeat="tab in tabs track by $index"
      title="{{ tab.title | translate }}"
      bs-pane
    ></div>
  </div>

  <div ng-show="tabs.activeTab === 0 && !whereFilter ">
    <form id="formmodel" ng-submit="startCalage()">
      <div class="gcDatatableCrud marginTop nopadding" ng-hide="uniqueElement">
        <div class="row nomargin">
          <div class="col-xs-12 nopadding">
            <save-and-get-template-hpo
              config-name="configName"
              data="currentModel"
              run-return="getReturnedTemplate"
              save-template-html="saveTemplateHtml"
              get-template-html="getTemplateHtml"
              exclude-properties="propertiestoexclude"
            ></save-and-get-template-hpo>

            <button
              class="btn btn-success btn-sm pull-right"
              type="submit"
              ng-disabled="disableAnalyseButton(currentModel)"
            >
              <translate>common.apply</translate>
            </button>

            <div
              class="btn btn-default btn-sm pull-right"
              ng-click="emptyModel(true)"
              ng-show="!disableAnalyseButton(currentModel)"
            >
              <translate>hpo.common.reset</translate>
            </div>
          </div>
        </div>
      </div>

      <div class="row marginTop">
        <div class="col-md-6 verticalLine">
          <div class="row nomargin marginTop add-border">
            <h3><a translate>hpo.model.calage.infocalage</a></h3>
          </div>

          <div class="row nomargin contenu-hpo">
            <div class="col-md-12 marginTop">
              <div class="form-group clearfix">
                <div
                  class="alert alert-danger"
                  ng-if=" currentModel && currentModel.namecalage && exstingNames &&
                                        exstingNames.indexOf(currentModel.namecalage) !== -1 "
                >
                  <translate>hpo.multicritere.parameters.nameExist</translate>
                </div>

                <div class="col-xs-6 nopaddingLeft">
                  <label class="required"
                    ><translate
                      >model.featuretypes.attributes.name</translate
                    ></label
                  >

                  <input
                    type="text"
                    class="form-control"
                    ng-model="currentModel.namecalage"
                    limit="25"
                    required
                  />
                </div>

                <div class="col-xs-6 nopaddingRight">
                  <label class="required"
                    ><translate>hpo.common.commentaire</translate></label
                  >
                  <textarea
                    type="textarea"
                    class="form-control"
                    id="inputalias"
                    placeholder="{{ 'hpo.common.easyget' | translate }}"
                    ng-model="currentModel.commentairecalage"
                    required
                  />
                </div>
              </div>
            </div>

            <model-survie-hpo
              model="currentModel"
              selection-mode="true"
              unique-element="true"
            ></model-survie-hpo>
          </div>
        </div>

        <div class="col-md-6" ng-if="currentModel.editTypeList">
          <div class="row nomargin marginTop add-border">
            <h3>
              <a>
                <translate>hpo.model.calage.attribute</translate>
                <button
                  type="button"
                  class="btn btn-default btn-xs pull-right"
                  title="{{ 'hpo.model.calage.addall' | translate }}"
                  ng-click="addAllAttributes(1)"
                >
                  <i class="fa fa-plus"></i>
                </button>
                <button
                  type="button"
                  class="btn btn-danger btn-xs pull-right"
                  title="{{ 'hpo.model.calage.removeall' | translate }}"
                  ng-click="addAllAttributes(0)"
                >
                  <i class="fa fa-trash"></i>
                </button>
              </a>
            </h3>
          </div>

          <div class="col-xs-12 marginTop">
            <div dual-list-box data="currentModel.editTypeList"></div>
          </div>
        </div>
      </div>
    </form>
  </div>

  <div ng-show="tabs.activeTab === 1">
    <div class="col-md-12">
      <div class="correctPositionDataTAble"></div>
      <div
        id="hpoPrepareDataHistorique"
        fti="fticalage"
        attributes="fticalageattributes"
        height="{{datatableHeightHistoric}}"
        auto-adjust-height="false"
        table-fill-page="false"
        crud="datatableCalageCrudHpo"
        relationshow="true"
        date-format="'dd MMM yyyy HH:mm'"
        reset-filter-on-toggle="true"
        display-total-number="true"
        dont-show-filter="false"
        hide-crud="false"
        usesweetalert="true"
        translate-attrs="translateFtiAttributes"
        display-total-number="true"
        start-count="10"
        button-edit="buttonEditIcon"
        specialactions="buttonSpecialActions"
        where="whereFilter"
        hide-filter="hideFilter"
        supp-func-remove="postRemove"
        dont-use-guid="true"
        gcdata-datatable
      ></div>
    </div>
  </div>
</div>
