<div>
  <h2 id="page-heading" data-cy="PPreguntaCerradaHeading">
    <span jhiTranslate="dataSurveyApp.pPreguntaCerrada.home.title">P Pregunta Cerradas</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.pPreguntaCerrada.home.refreshListLabel">Refresh List</span>
      </button>

      <button
        id="jh-create-entity"
        data-cy="entityCreateButton"
        class="btn btn-primary jh-create-entity create-p-pregunta-cerrada"
        [routerLink]="['/p-pregunta-cerrada/new']"
      >
        <fa-icon icon="plus"></fa-icon>
        <span jhiTranslate="dataSurveyApp.pPreguntaCerrada.home.createLabel"> Create a new P Pregunta Cerrada </span>
      </button>
    </div>
  </h2>

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

  <jhi-alert></jhi-alert>

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

  <div class="table-responsive" id="entities" *ngIf="pPreguntaCerradas && pPreguntaCerradas.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.pPreguntaCerrada.nombre">Nombre</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.pPreguntaCerrada.tipo">Tipo</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.pPreguntaCerrada.opcional">Opcional</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.pPreguntaCerrada.orden">Orden</span></th>
          <th scope="col"><span jhiTranslate="dataSurveyApp.pPreguntaCerrada.plantilla">Plantilla</span></th>
          <th scope="col"></th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let pPreguntaCerrada of pPreguntaCerradas; trackBy: trackId" data-cy="entityTable">
          <td>
            <a [routerLink]="['/p-pregunta-cerrada', pPreguntaCerrada.id, 'view']">{{ pPreguntaCerrada.id }}</a>
          </td>
          <td>{{ pPreguntaCerrada.nombre }}</td>
          <td jhiTranslate="{{ 'dataSurveyApp.PreguntaCerradaTipo.' + pPreguntaCerrada.tipo }}">{{ pPreguntaCerrada.tipo }}</td>
          <td>{{ pPreguntaCerrada.opcional }}</td>
          <td>{{ pPreguntaCerrada.orden }}</td>
          <td>
            <div *ngIf="pPreguntaCerrada.plantilla">
              <a [routerLink]="['/plantilla', pPreguntaCerrada.plantilla?.id, 'view']">{{ pPreguntaCerrada.plantilla?.id }}</a>
            </div>
          </td>
          <td class="text-right">
            <div class="btn-group">
              <button
                type="submit"
                [routerLink]="['/p-pregunta-cerrada', pPreguntaCerrada.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]="['/p-pregunta-cerrada', pPreguntaCerrada.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(pPreguntaCerrada)" 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>
