<form
  name="params_Form"
  id="rulesChoiceCfgModal"
  ng-submit="validerParameters();closeDiag();"
  class="form"
  role="form"
>
  <div class="row">
    <div class="col-xs-12">
      <div class="input-group">
        <span translate> adminparam.columntitle_parameters </span>
      </div>
      <hr />
    </div>

    <br />

    <div class="col-xs-12">
      <table
        ng-table="tableParamsParameters"
        class="table table-striped table-bordered"
      >
        <tr>
          <th><translate>adminparam.columntitle_name</translate></th>
          <th><translate>adminparam.columntitle_type</translate></th>
          <th><translate>adminparam.columntitle_modesaisie</translate></th>
          <th>
            <translate>adminparam.columntitle_possibleAttribute</translate>
          </th>
        </tr>
        <tr style="text-align: center;" ng-repeat="parameter in $data">
          <td>
            <center>{{ parameter.name }}</center>
          </td>
          <td>
            <center>{{ parameter.type | translate }}</center>
          </td>
          <td>
            <select
              ng-model="parameter.saisieMode"
              ng-options="saisieMode for saisieMode in saisieModes | orderBy : 'toString()'  "
              data-html="1"
              name="parmeter_id"
              ng-change="changedParameters(parameter)"
              ng-init="saisieModes.length === 1 && !parameter.saisieMode ? parameter.saisieMode = saisieModes[0] : parameter.saisieMode"
              class="form-control"
              required
            >
              <option value="" disabled selected hidden translate
                >model.featuretypes.actions.choisirmode</option
              >
            </select>
          </td>
          <td>
            <select
              ng-model="parameter.attributAlias"
              ng-options="attribut for attribut in parameter.possibleAttributes | orderBy : 'toString()'  "
              data-html="1"
              name="attribut_id"
              class="form-control"
              ng-if="parameter.saisieMode === ( 'model.featuretypes.actions.saisieAttribut' | translate )"
              required
            >
              <option value="" disabled selected hidden translate
                >model.featuretypes.actions.select_attribut</option
              >
            </select>

            <input
              type="text"
              data-html="1"
              class="form-control"
              ng-disabled="true"
              ng-if="parameter.saisieMode === ( 'model.featuretypes.actions.saisieUtilisateur' | translate )"
              placeholder="{{ 'model.featuretypes.actions.saisieENUtilisateur' | translate }}"
            />

            <input
              type="text"
              ng-model="parameter.value"
              data-html="1"
              class="form-control"
              ng-if="parameter.saisieMode === ( 'model.featuretypes.actions.saisieStatic' | translate ) || parameter.saisieMode === ( 'model.featuretypes.actions.saisieVariable' | translate )"
            />
          </td>
        </tr>
      </table>

      <hr />
    </div>

    <br />

    <!-- Boutons d'actions -->
    <div class="form-group clearfix">
      <div class="col-xs-12">
        <div class="text-right">
          <button type="button" class="btn btn-default" ng-click="closeDiag()">
            <translate>common.close</translate>
          </button>
          <button
            ng_disabled="!jasperParamsOk();"
            type="submit"
            class="btn btn-primary"
            title="{{'model.featuretypes.rules.addorupdate' | translate}}"
          >
            <translate>common.save</translate>
          </button>
        </div>
      </div>
    </div>
  </div>
</form>
