<div class="row nomargin">
  <div class="col-md-12 nopadding">
    <div class="col-md-10 nopadding">
      <div class="col-md-2 nopadding smallpaddingtop">
        <label translate>hpo.common.intervalle</label>
      </div>
      <div class="col-md-2 nopadding">
        <input type="number" class="form-control" ng-model="conditions.value" />
      </div>
    </div>
    <div class="col-md-2 nopadding">
      <button
        type="button"
        class="btn btn-success btn-sm pull-right"
        ng-click="addCondition()"
      >
        <span translate>hpo.common.addcondition</span>
      </button>
    </div>
  </div>
</div>

<div class="row nomargin marginTop">
  <div class="col-md-12 nopadding">
    <div class="col-md-10 nopadding smallpaddingtop">
      <label translate>hpo.common.conditions</label>
    </div>
    <div class="col-md-2 nopadding">
      <button
        type="button"
        class="btn btn-info btn-xs pull-right"
        ng-show="usespecialfilters && usespecialfilters.operands && usespecialfilters.operands.length > 0"
        ng-click="extractConditions()"
        title="{{ 'hpo.common.getcondition' | translate }}"
      >
        <i class="fa fa-refresh"></i>
        <translate class="text-small"
          >hpo.data.prepare.correctiontools.getattributesfromanalysis</translate
        >
      </button>
    </div>
  </div>
</div>

<div class="row nomargin">
  <div class="col-md-12 marginTop">
    <label translate>hpo.data.prepare.configuration</label>
    <div class="col-md-12">
      <div class="col-md-6">
        <span translate>hpo.common.interpreteconditions</span>
      </div>
      <div class="col-md-2">
        <input
          type="radio"
          ng-model="conditions.interpreteconditions"
          value="and"
        />
        <translate>hpo.common.and</translate>
      </div>
      <div class="col-md-2">
        <input
          type="radio"
          ng-model="conditions.interpreteconditions"
          value="or"
        />
        <translate>hpo.common.or</translate>
      </div>
    </div>
  </div>
</div>

<div
  class="row nomargin marginTop"
  css-manipulate='{"mih":"90px"}'
  ng-if="conditions.list && conditions.list.length > 0"
>
  <div
    class="col-md-12 nopadding"
    ng-repeat="condition in conditions.list track by $index"
  >
    <div class="col-md-5 nopadding">
      <div class="input-group">
        <span
          class="input-group-addon btn btn-default"
          ng-click="removeFromList($index)"
          title="{{ 'common.delete' | translate }}"
          id="basic-addon1"
        >
          <i class="fa fa-trash"></i>
        </span>
        <input
          type="text"
          class="form-control"
          ng-model="attr.alias"
          disabled
        />
      </div>
    </div>
    <filter-as-elastic
      fti="fti"
      attr="attr"
      res="condition"
      class="col-md-7 nopadding"
    ></filter-as-elastic>
  </div>
</div>

<div
  class="row nomargin"
  ng-show="!conditions.list || conditions.list.length === 0"
>
  <div class="col-md-12">
    <div class="alert alert-hpo-info marginBottom">
      <translate>hpo.common.noconditions</translate>
    </div>
  </div>
</div>
