<h3 class="modalTitle">Indicateurs associés au rapport</h3>
<div class="modalBody">
  <div class="row">
    <div class="col-xs-12">
      <table class="table table-bordered">
        <tr>
          <th>Nom</th>
          <th>Type</th>
          <th>Étiquette</th>
          <th>Valeur par défaut</th>
          <th class="col-xs-1"></th>
        </tr>
        <tr ng-if="!indicateurs.length">
          <td colspan="5">
            <div class="alert alert-info" style="margin: 3px;">
              Aucun indicateur n'est renseigné pour ce rapport.
            </div>
          </td>
        </tr>
        <tr ng-repeat="ind in indicateurs track by $index" ng-switch="ind.type">
          <td>
            <input ng-model="ind.name" type="text" class="form-control" />
          </td>
          <td>
            <select
              ng-model="ind.type"
              ng-options="type.key as type.label for type in jasperIndicatorsTypes"
              class="form-control"
            ></select>
          </td>
          <td>
            <input ng-model="ind.label" type="text" class="form-control" />
          </td>
          <td ng-switch-when="int">
            <input
              class="form-control"
              ng-model="ind.value"
              min="0"
              type="number"
            />
          </td>
          <td ng-switch-when="relativeint">
            <input ng-model="ind.value" min="0" type="number" />
          </td>
          <td ng-switch-when="real">
            <input
              class="form-control"
              ng-model="ind.value"
              min="0"
              type="number"
              step="any"
            />
          </td>
          <td ng-switch-when="date">
            <input
              class="form-control"
              ng-model="ind.value"
              type="text"
              data-date-format="dd/MM/yyyy"
              data_autoclose="true"
              title="JJ/MM/YYYY"
              bs-datepicker
            />
          </td>
          <td ng-switch-default>
            <input class="form-control" ng-model="ind.value" type="text" />
          </td>

          <td class="text-center">
            <div
              class="btn btn-danger btn-xs"
              ng-click="removeIndicator($index)"
            >
              <i class="fa fa-times"></i>
            </div>
          </td>
        </tr>
        <tr>
          <td colspan="4" class="noborder_btmleft_td"></td>
          <td class="text-center">
            <div
              class="btn btn-default btn-xs"
              ng-click="indicateurs.push({type:'text'})"
            >
              <i class="fa fa-plus"></i>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12 text-right">
      <hr />
      <div class="btn btn-primary" ng-click="saveIndicators()">
        Enregistrer
      </div>
    </div>
  </div>
</div>
