<div ng-if="!history_active">
  <div class="row">
    <div class="col-xs-12">
      <div class="alert alert-warning">
        L'historique des actions sur les composants n'est pas activée pour ce
        portail.
      </div>
    </div>
  </div>
</div>
<div class="tableFeatureHistory" ng-if="history_active">
  <div class="row spbrow">
    <div class="col-xs-3 col-xs-offset-6">
      <select
        class="form-control"
        ng-options="title as title for title in action_titles"
        ng-model="titleFilter.x"
        ng-change="refreshDossierAction()"
      >
      </select>
    </div>
    <div class="col-xs-3 text-right">
      <button
        type="button"
        ng-click="openModal()"
        class="btn btn-success buttonRefresh cursorHelp"
      >
        <span class="glyphicon glyphicon-plus" title="Créer une action"></span>
      </button>
      <button
        type="button"
        ng-click="refreshDossierAction()"
        class="btn btn-default buttonRefresh cursorHelp"
      >
        <span
          class="glyphicon glyphicon-refresh"
          title="Rafraîchir la liste"
        ></span>
      </button>
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12" ng-class="{ 'disabled ' : disabled }">
      <table ng-table="tableFeaturesHistory" class="table table-bordered">
        <tr ng-repeat="history in $data">
          <td data-title="'Date'" sortable="'Date'">
            {{history.Date| date : 'd MMM yyyy HH:mm' }}
          </td>
          <td data-title="'Utilisateur'" sortable="'user_id'">
            {{history.user_id}}
          </td>
          <td data-title="'Action Titre'" sortable="'action_title'">
            {{history.action_title}}
          </td>
          <td data-title="'Action Description'" sortable="'action_description'">
            {{history.action_description}}
          </td>
          <td data-title="'Actions'" align="center">
            <div
              class="btn btn-danger btn-sm cursorHelp"
              title="Supprimer la ligne d'historique"
              ng-click="removeHistory(history)"
              ng-disabled="disabledButtonRemove()"
            >
              <i class="fa fa-times"></i>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
</div>
