<label class="rulesCfgTitle"
  >{{'rulecfg.setattributebyconcat.title' | translate}}</label
><br />
<div ng-if="editTypeList">
  <div class="ruleCfgEditTypeList" dual-list-box data="editTypeList"></div>
</div>
<div>
  <div class="row">
    <div class="col-xs-6">
      <label>
        {{'rulecfg.setattributebyconcat.target_field' | translate}}
        <i
          class="fa fa-info-circle pull-right nbCharMax"
          ng-if="rule.parameters.variableName && rule.parameters.variableName.length"
          title="L'attribut sera ignoré si une variable est présente"
          ng-disabled="rule.parameters.variableName && rule.parameters.variableName.length"
        ></i>
      </label>
      <select
        required
        class="form-control"
        ng-options="f.name as f.alias for f in attributes"
        ng-model="targetField"
      >
        <option value="" translate>rulecfg.common.choiceprompt</option>
      </select>
    </div>
    <div class="col-xs-6">
      <label>
        Variable destination
        <i
          ng-if="!canEditVariableName"
          class="fa fa-info-circle pull-right nbCharMax"
          title="La variable est déjà utilisée et ne peut pas être modifiée"
        ></i>
      </label>
      <input
        type="text"
        class="form-control"
        ng-model="rule.parameters.variableName"
        ng-disabled="!canEditVariableName"
      />
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      <label> {{'rulecfg.setattributebyconcat.elements' | translate}} </label>
      <table class="table table-bordered">
        <tr>
          <th class="text-center">
            <div
              class="btn btn-xs btn-success"
              ng-click="addNumerotationPart()"
            >
              <i class="fa fa-plus"></i>
            </div>
          </th>
          <th>{{'rulecfg.setattributebyconcat.type' | translate}}</th>
          <th>{{'rulecfg.setattributebyconcat.parametering' | translate}}</th>
          <th>{{'rulecfg.setattributebyconcat.delete_btn' | translate}}</th>
        </tr>
        <tr ng-repeat="x in formula.numerotation.parts track by $index">
          <td class="col-xs-1 text-center">
            <button
              type="button"
              class="btn btn-xs btn-default"
              ng-click="moveNumerotationpart('up',$index)"
              ng-disabled="$index==0"
            >
              <i class="fa fa-arrow-up"></i>
            </button>
            <button
              type="button"
              class="btn btn-xs btn-default"
              ng-click="moveNumerotationpart('down',$index)"
              ng-disabled="$index==formula.numerotation.parts.length-1"
            >
              <i class="fa fa-arrow-down"></i>
            </button>
          </td>
          <td>
            <select
              class="form-control"
              ng-options="o.key as o.label for o in possibleTypes"
              ng-model="x.key"
            >
            </select>
          </td>
          <td>
            <input
              type="text"
              class="form-control"
              ng-model="x.format"
              ng-if="x.key=='separator'"
            />
            <select
              class="form-control"
              ng-if="x.key=='attribut'"
              ng-options="f.name as f.alias for f in attributes"
              ng-model="x.format"
            >
            </select>
            <select
              class="form-control"
              ng-if="x.key=='variable'"
              ng-options="variable as variable for variable in featureRulesVariables"
              ng-model="x.format"
            >
            </select>
            <input
              type="text"
              class="form-control"
              ng-model="x.format"
              ng-if="x.key=='value'"
            />
          </td>
          <td class="col-xs-1 text-center">
            <div
              class="btn btn-xs btn-danger"
              ng-click="removePartFromNumerotationCfg($index)"
              ng-disabled="x.key=='index'"
            >
              <i class="fa fa-times"></i>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      <label>
        {{'rulecfg.setattributebyconcat.formula_preview' | translate}}
      </label>
      <input
        type="text"
        class="form-control"
        ng-model="partsPreview"
        disabled
      />
    </div>
  </div>
</div>
