<div class="elasticEditRequest">
  <div class="title">
    <div
      class="btn btn-sm btn-default pull-right"
      ng-click="visible=!visible"
      title="Afficher les paramètres"
      ng-show="parameters.length"
    >
      <i
        class="fa"
        ng-class="{'fa-compress':visible==1,'fa-expand':visible==0}"
      ></i>
    </div>

    <span class="{{request.labelClass || '' }}">
      {{ request.label }}
    </span>

    <div
      class="elastic-request-description"
      ng-class="{'show-less': !visible || !parameters.length}"
      ng-if="request.description"
    >
      <span style="font-weight: 400; font-size: 12px"
        >{{request.description}}</span
      >
    </div>
  </div>
  <div class="body" ng-show="visible || !parameters.length">
    <div ng-if="!currentRequest && requeteRecuperee">
      Aucune requête ne portant ce nom n'a pu être retrouvée.
    </div>

    <div ng-if="currentRequest && componentftis" class="row">
      <div ng-if="!fieldsConfiguration" class="col-xs-12">
        Cette requete n'est pas paramètrable.
      </div>
      <div ng-if="fieldsConfiguration" class="col-xs-12">
        <div ng-repeat="param in parameters">
          <div
            elastic-mrule
            map="map"
            resolved-filter="currentRequest.resolved"
            filter="param.filter"
            condition="param.relation"
            disable-attribute-selection="true"
            components="componentftis"
          ></div>
        </div>
        <i ng-if="!parameters.length">
          Cette requête ne comporte aucun paramètre éditable
        </i>
      </div>

      <div
        class="btn btn-default btn-sm saveAndExecuteQuery"
        ng-click="saveAndExecuteQuery()"
        title="Lancer la recherche"
      >
        <i class="fa fa-search"></i>
      </div>

      <div
        res="inner.res"
        ng-if="!currentRequest.resolved"
        class="innerFilter"
        elastic-filter
        filter-id="filterId"
        place="'widget'"
      ></div>
      <div
        res="inner.res"
        ng-if="!currentRequest.resolved && skipSearchEvent"
        relations="currentRequest.data.relations"
        class="innerFilter"
        elastic-filter
        filter-id="filterId"
        place="'widget'"
      ></div>
    </div>
  </div>
</div>
