<div ng-if="documentsTabs" ng-model="documentsTabs.activeTab" bs-tabs>
  <div
    ng-repeat="tab in documentsTabs track by $index"
    title="{{tab.title}}"
    bs-pane
  ></div>
</div>

<div ng-if="!documentsTabs || documentsTabs.activeTab == 0">
  <div class="row">
    <div class="col-xs-12">
      <div ng-repeat="item in dashboardCfg" class="documentTypeItem">
        <div class="ico">
          <i class="fa fa-file-word-o" ng-if="item.type=='modele'"></i>
          <i class="fa fa-file-pdf-o" ng-if="item.type=='static'"></i>
          <i class="fa fa-file-code-o" ng-if="item.type=='jasper'"></i>
        </div>
        <div class="title">{{item.label}}</div>
        <div class="desc" ng-if="item.detail!=''">
          <table class="fillParams">
            <tr>
              <td colspan="2">
                <div>{{ item.detail }}</div>
              </td>
            </tr>
            <tr
              ng-if="item.type=='jasper'"
              ng-repeat="indic in item.indicateurs"
              ng-switch="indic.type"
            >
              <td class="col-xs-4">
                <i> {{ indic.label }} </i>
              </td>
              <td ng-switch-when="int">
                <input
                  class="form-control"
                  ng-model="indic.value"
                  min="0"
                  type="number"
                />
              </td>
              <td ng-switch-when="relativeint">
                <input ng-model="indic.value" min="0" type="number" />
              </td>
              <td ng-switch-when="real">
                <input
                  class="form-control"
                  ng-model="indic.value"
                  min="0"
                  type="number"
                  step="any"
                />
              </td>
              <td ng-switch-when="date">
                <input
                  class="form-control"
                  ng-model="indic.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="indic.value"
                  type="text"
                />
              </td>
            </tr>
          </table>
        </div>

        <div
          ng-click="getDocx(item.fichier)"
          ng-if="item.type=='modele'"
          class="btn btn-default"
          title="Télécharger"
        >
          <i class="fa fa-print"></i>
        </div>
        <div
          ng-click="getStaticFIle(item.fichier)"
          ng-if="item.type=='static'"
          class="btn btn-default"
          title="Télécharger"
        >
          <i class="fa fa-print"></i>
        </div>
        <div
          ng-click="getJasperReport(item)"
          ng-if="item.type=='jasper'"
          class="btn btn-default"
          title="Télécharger"
        >
          <i class="fa fa-print"></i>
        </div>
      </div>
    </div>
  </div>
</div>

<div ng-if="documentsTabs && documentsTabs.activeTab == 1">
  <div class="alert alert-warning">
    <span ng-if="fileManagerAdmin">
      Connecté avec le rôle : <b>administration des rapports</b>
    </span>
    <span ng-if="!fileManagerAdmin">
      Connecté avec le rôle : <b>consultation des rapports</b>
    </span>
  </div>
  <iframe ng-src="{{includeElUrl}}" style="height: 650px; padding: 0;"></iframe>
</div>
