<div class="filterLayers">
  <div>
    <div class="headerDescription">
      <translate ng-if="!geocatalogueNotFromApplication">applications.applications.filterLayers.subTitle</translate>
      <span ng-if="geocatalogueNotFromApplication">{{('applications.applications.filterLayers.subTitleDyn' | translate) + (widget ? widget : '')}}</span>
    </div>
    <div class="form-group globalCfgFilterLayers col-xs-12">
      <div class="col-xs-1 smallmarginTop">
        <i
          class="fa fa-plus-square-o"
          ng-show="allPanelHidden"
          ng-click="showAllPanels()"
        ></i>
        <i
          class="fa fa-minus-square-o"
          ng-show="!allPanelHidden"
          ng-click="hideAllPanels()"
        ></i>
      </div>
      <div class="col-xs-4">
        <select
          class="form-control"
          ng-options="x  for x in ['Alias','Nom']"
          ng-model="display"
        ></select>
      </div>
      <div class="pull-right col-xs-1 smallmarginTop">
        <input
          type="checkbox"
          ng-model="allGroupChecked"
          ng-click="allGroupCheckedFn()"
          title="{{'applications.applications.filterLayers.globalSelectAll' | translate}}"
        />
      </div>
      <div class="pull-right col-xs-2 smallmarginTop" ng-if="!geocatalogueNotFromApplication">
        <i
          class="fa"
          ng-class="edit_resource.filterLayers.useFilter ? 'fa-toggle-on toggle-on' : 'fa-toggle-off toggle-off'"
          ng-click="edit_resource.filterLayers.useFilter=!edit_resource.filterLayers.useFilter"
          title="{{'applications.applications.filterLayers.activate' | translate}}"
        ></i>
      </div>
    </div>
    <div class="row marginTop">
      <div class="col-md-12">
        <div class="col-md-10 col-md-offset-1">
          <div class="searchHpo">
            <span class="fa fa-filter"></span>
            <input
              title="{{ 'common.cancelFilter' | translate }}"
              type="text"
              ng-model="search.filterLayers"
              class="form-control"
              placeholder="{{ 'common.filterbykey' | translate }}"
              ng-keydown="onFilterKeydown($event)"
              ng-keyup="onFilterKeyup()"
            />
            <a ng-show="search.filterLayers.length > 0" ng-click="resetFilter()">
              <span class="fa fa-times-circle"></span>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="inner_lmw_FilterLayers marginTop">
    <div ng-repeat="group in grouplayersName | orderBy">
      <div class="groupLayersFilterLayers col-xs-12">
        <div class="col-xs-1">
          <i
            class="fa fa-plus-square-o"
            ng-show="hiddenPanels[group]"
            ng-click="hiddenPanels[group]=false"
          ></i>
          <i
            class="fa fa-minus-square-o"
            ng-show="!hiddenPanels[group]"
            ng-click="hiddenPanels[group]=true"
          ></i>
        </div>
        <div class="col-xs-9">
          <span>{{'theme.' + group | translate}}</span>
        </div>
        <div class="pull-right col-xs-1 noPaddingRight">
          <input
            type="checkbox"
            ng-model="groupChecked[group]"
            ng-click="groupChecked[group] = !groupChecked[group];subGroupCheckedFn(group);allGroupIsChecked()"
            title="{{'applications.applications.filterLayers.selectAllLayers' | translate}}"/>
        </div>
      </div>
      <ul class="itemsFilterLayers" ng-if="!hiddenPanels[group]">
        <li
          ng-repeat="layer in grouplayers[group] | filter:search.filterLayers | orderBy:display ==='Alias'?'alias':'name'"
          class="clearfix">
          <div class="col-xs-8" ng-if="display ==='Alias'">
            <span>{{layer.alias | translate}}</span>
          </div>
          <div class="col-xs-8" ng-if="display ==='Nom'">
            <span>{{layer.name | translate}}</span>
          </div>
          <div class="pull-right col-xs-1">
            <input
              type="checkbox"
              ng-model="edit_resource.filterLayers.layers[layer.uid]"
              ng-click="checkFeature(layer.uid);
                          groupIsChecked(group);allGroupIsChecked()"
              title="{{'applications.applications.filterLayers.selectLayer' | translate}}"/>
          </div>
          <div class="pull-right">
            <span>{{layer.srid | translate}}</span>
          </div>
        </li>
      </ul>
    </div>
  </div>
</div>
