<div>
  <h2 id="page-heading" data-cy="PlantillaHeading">
    <span jhiTranslate="dataSurveyApp.plantilla.home.title">Plantillas</span>

    <div class="d-flex justify-content-end">
      <button class="btn btn-info mr-2" (click)="loadAll()" [disabled]="isLoading">
        <fa-icon icon="sync" [spin]="isLoading"></fa-icon>
        <span jhiTranslate="dataSurveyApp.plantilla.home.refreshListLabel">Refresh List</span>
      </button>

      <button
        id="jh-create-entity"
        data-cy="entityCreateButton"
        class="btn btn-primary jh-create-entity create-plantilla"
        [routerLink]="['/plantilla/new']"
      >
        <fa-icon icon="plus"></fa-icon>
        <span jhiTranslate="dataSurveyApp.plantilla.home.createLabel"> Create a new Plantilla </span>
      </button>
    </div>
  </h2>

  <jhi-alert-error></jhi-alert-error>

  <jhi-alert></jhi-alert>

  <div class="alert alert-warning" id="no-result" *ngIf="plantillas?.length === 0">
    <span jhiTranslate="dataSurveyApp.plantilla.home.notFound">No plantillas found</span>
  </div>

  <div class="table-responsive" id="entities" *ngIf="plantillas && plantillas.length > 0">
    <table class="table table-striped" aria-describedby="page-heading">
      <thead>
        <tr>
          <th scope="col"><span jhiTranslate="global.field.id">ID</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.nombre">Nombre</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.descripcion">Descripcion</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaCreacion">Fecha Creacion</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaPublicacionTienda">Fecha Publicacion Tienda</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.estado">Estado</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.precio">Precio</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.categoria">Categoria</span></th>
          <th scope="col"></th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let plantilla of plantillas; trackBy: trackId" data-cy="entityTable">
          <td>
            <a [routerLink]="['/plantilla', plantilla.id, 'view']">{{ plantilla.id }}</a>
          </td>
          <td>{{ plantilla.nombre }}</td>
          <td>{{ plantilla.descripcion }}</td>
          <td>{{ plantilla.fechaCreacion | formatMediumDatetime }}</td>
          <td>{{ plantilla.fechaPublicacionTienda | formatMediumDatetime }}</td>
          <td jhiTranslate="{{ 'dataSurveyApp.EstadoPlantilla.' + plantilla.estado }}">{{ plantilla.estado }}</td>
          <td>{{ plantilla.precio }}</td>
          <td>
            <div *ngIf="plantilla.categoria">
              <a [routerLink]="['/categoria', plantilla.categoria?.id, 'view']">{{ plantilla.categoria?.nombre }}</a>
            </div>
          </td>
          <td class="text-right">
            <div class="btn-group">
              <button
                type="submit"
                [routerLink]="['/plantilla', plantilla.id, 'view']"
                class="btn btn-info btn-sm"
                data-cy="entityDetailsButton"
              >
                <fa-icon icon="eye"></fa-icon>
                <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
              </button>

              <button
                type="submit"
                [routerLink]="['/plantilla', plantilla.id, 'edit']"
                class="btn btn-primary btn-sm"
                data-cy="entityEditButton"
              >
                <fa-icon icon="pencil-alt"></fa-icon>
                <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
              </button>

              <button type="submit" (click)="delete(plantilla)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
                <fa-icon icon="times"></fa-icon>
                <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
              </button>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
