<div class="col-md-12" ng-if="el.filters.length > 0">
  <div
    class="panel-group"
    ng-model="el.activePanel"
    data-animation="am-flip-x"
    data-start-collapsed="true"
    style="margin-bottom:5px;"
    bs-collapse
  >
    <div class="panel panel-info" ng-repeat="filter in el.filters">
      <div class="panel-heading">
        <h4 class="panel-title">
          <a bs-collapse-toggle>
            <translate class="txt-title">
              <strong
                >{{ 'elastic.search.jointure.inrelation' | translate }} {{
                ("features." + filter.fti.name + ".alias" |
                translate).indexOf("features.") === -1 ? ("features." +
                filter.fti.name + ".alias" | translate) : filter.fti.alias }}
              </strong>
            </translate>
          </a>
        </h4>
      </div>
      <div class="panel-collapse collapse" bs-collapse-target>
        <div class="panel-body">
          <div class="row">
            <div
              class="btn-group col-md-2"
              style="padding-top:45px;padding-right:0px;margin-top:10px;margin-bottom:10px;"
            >
              <button
                type="button"
                ng-click="selectallattributes(filter)"
                class="btn btn-default btn-xs"
                title="{{ 'elastic.search.jointure.selectAll' | translate }}"
              >
                <i class="fa fa-arrow-circle-right"></i>
              </button>
              <button
                type="button"
                ng-click="removeallattributes(filter)"
                class="btn btn-default btn-xs"
                title="{{ 'elastic.search.jointure.removeall' | translate }}"
              >
                <i class="fa fa-remove"></i>
              </button>
            </div>
            <div
              class="col-md-4"
              style="padding-top:45px;padding-left:0px;padding-right:0px;margin-top:10px;margin-bottom:10px;"
            >
              <label
                >{{ 'elastic.search.jointure.attributestoshow' | translate
                }}</label
              >
            </div>

            <!-- CAS GENERAL -->
            <div
              class="col-md-5 form-control"
              style="height:120px;width:210px;overflow-x:hidden;overflow-y:auto;padding-left:0px;margin-top:10px;margin-bottom:10px;"
            >
              <ul>
                <li
                  class="checkbox col-md-12"
                  ng-repeat="attr in filter.fti.attributes | orderBy : 'alias'"
                  style="display:inline-block;min-height:20px;max-height:40px;width:220px;padding:0px;"
                >
                  <input type="checkbox" ng-model="attr.selected" />
                  <span>{{ attr.alias }}</span>
                </li>
              </ul>
            </div>
          </div>
          <div class="row">
            <div
              class="col-xs-12"
              ng-if="(filter.relationSIMPLE && (!filter.relationNM && !filter.relationTOPOAlias)) && (!filter.type || filter.type !== 'ANC')"
            >
              <div class="checkbox">
                <label>
                  <input type="checkbox" ng-model="filter.simplejointure" />
                  {{ 'elastic.search.jointure.jointure' | translate }}
                </label>
              </div>
            </div>

            <div
              class="col-xs-12"
              ng-if="(filter.relationNM || filter.relationTOPOAlias) && (!filter.type || filter.type !== 'ANC')"
            >
              <div class="checkbox">
                <label>
                  <input
                    type="checkbox"
                    ng-model="filter.nmjointure"
                    ng-change="defaultUpdate(filter)"
                  />
                  {{ 'elastic.search.jointure.jointure' | translate }}
                </label>
              </div>
              <div
                class="col-xs-12"
                ng-if="filter.relationNM && filter.nmjointure"
              >
                <div class="col-xs-12">
                  <input
                    type="radio"
                    name="jointuretype-{{param + $index}}"
                    ng-model="filter.jointurenmtype"
                    value="getOnlyFirstline"
                  />
                  <span translate
                    >elastic.search.jointure.jointuregetOnlyFirstline</span
                  >
                </div>
                <div class="col-xs-12" style="padding-right:0;">
                  <input
                    type="radio"
                    ng-model="filter.jointurenmtype"
                    value="duplicateLines"
                    name="jointuretype-{{param + $index}}"
                  />
                  <span translate
                    >elastic.search.jointure.jointureduplicateLines</span
                  >
                </div>
              </div>
            </div>

            <div class="col-xs-12" ng-if="filter.type && filter.type == 'ANC'">
              <div class="checkbox">
                <label>
                  <input
                    type="checkbox"
                    ng-model="filter.ancjointure"
                    ng-change="defaultUpdateANC(filter)"
                  />
                  {{ 'elastic.search.jointure.jointure' | translate }}
                </label>
              </div>
              <div
                class="col-xs-12"
                ng-if="filter.type && filter.type == 'ANC' && filter.ancjointure"
              >
                <div class="col-xs-12">
                  <input
                    type="radio"
                    name="jointuretype-{{param + $index}}"
                    ng-model="filter.jointurenmtype"
                    value="getOnlyFirstline"
                  />
                  <span translate
                    >elastic.search.jointure.jointuregetOnlyFirstline</span
                  >
                </div>
                <div class="col-xs-12" style="padding-right:0;">
                  <input
                    type="radio"
                    ng-model="filter.jointurenmtype"
                    value="duplicateLines"
                    name="jointuretype-{{param + $index}}"
                  />
                  <span translate
                    >elastic.search.jointure.jointureduplicateLines</span
                  >
                </div>
              </div>
            </div>

            <div class="col-xs-12" style="margin-top:10px;">
              <div elastic-mjointure el="filter"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
