2021-07-03 21:48:27 +00:00
|
|
|
<div>
|
|
|
|
<h2 id="page-heading" data-cy="PlantillaHeading">
|
2021-08-01 06:54:44 +00:00
|
|
|
<div class="d-flex flex-sm-row flex-column justify-content-between align-items-center">
|
|
|
|
<div>
|
|
|
|
<span class="ds-title" jhiTranslate="dataSurveyApp.plantilla.home.title">Encuestas</span>
|
|
|
|
<p class="ds-subtitle">Administre las plantillas comprables de la tienda</p>
|
|
|
|
</div>
|
2021-07-03 21:48:27 +00:00
|
|
|
|
2021-08-01 06:54:44 +00:00
|
|
|
<div>
|
|
|
|
<button class="ds-btn ds-btn--secondary" (click)="loadAll()" [disabled]="isLoading">
|
|
|
|
<fa-icon icon="sync" [spin]="isLoading"></fa-icon>
|
|
|
|
<span jhiTranslate="dataSurveyApp.plantilla.home.refreshListLabel">Refresh List</span>
|
|
|
|
</button>
|
2021-07-03 21:48:27 +00:00
|
|
|
|
2021-08-01 06:54:44 +00:00
|
|
|
<button
|
|
|
|
*ngIf="isAdmin() && isAuthenticated()"
|
|
|
|
type="button"
|
|
|
|
class="ds-btn ds-btn--primary"
|
|
|
|
(click)="resetCreateTemplateForm()"
|
|
|
|
data-toggle="modal"
|
|
|
|
data-target="#crearPlantilla"
|
|
|
|
>
|
|
|
|
Crear plantilla
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-07-03 21:48:27 +00:00
|
|
|
</div>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<jhi-alert-error></jhi-alert-error>
|
|
|
|
|
|
|
|
<jhi-alert></jhi-alert>
|
|
|
|
|
|
|
|
<div class="alert alert-warning" id="no-result" *ngIf="plantillas?.length === 0">
|
2021-07-30 04:50:21 +00:00
|
|
|
<span jhiTranslate="dataSurveyApp.plantilla.home.notFound">No templates found</span>
|
2021-07-03 21:48:27 +00:00
|
|
|
</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="dataSurveyApp.plantilla.nombre">Nombre</span></th>
|
|
|
|
<th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.descripcion">Descripcion</span></th>
|
2021-08-01 04:52:17 +00:00
|
|
|
<!-- <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaCreacion">Fecha Creacion</span></th> -->
|
2021-07-03 21:48:27 +00:00
|
|
|
<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>{{ plantilla.nombre }}</td>
|
|
|
|
<td>{{ plantilla.descripcion }}</td>
|
2021-08-01 03:53:35 +00:00
|
|
|
<!-- <td>{{ plantilla.fechaCreacion | formatMediumDatetime }}</td> -->
|
2021-08-01 04:52:17 +00:00
|
|
|
<td *ngIf="plantilla.fechaPublicacionTienda">{{ plantilla.fechaPublicacionTienda | formatShortDatetime | titlecase }}</td>
|
|
|
|
<td *ngIf="!plantilla.fechaPublicacionTienda">No establecida</td>
|
2021-07-03 21:48:27 +00:00
|
|
|
<td jhiTranslate="{{ 'dataSurveyApp.EstadoPlantilla.' + plantilla.estado }}">{{ plantilla.estado }}</td>
|
2021-08-01 04:52:17 +00:00
|
|
|
<td>{{ plantilla.precio | currency: 'USD':'symbol-narrow' }}</td>
|
2021-08-01 03:53:35 +00:00
|
|
|
<td>{{ plantilla.categoria?.nombre }}</td>
|
2021-07-03 21:48:27 +00:00
|
|
|
<td class="text-right">
|
|
|
|
<div class="btn-group">
|
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
[routerLink]="['/plantilla', plantilla.id, 'view']"
|
2021-08-01 06:54:44 +00:00
|
|
|
class="ds-btn ds-btn--secondary btn-sm"
|
2021-07-03 21:48:27 +00:00
|
|
|
data-cy="entityDetailsButton"
|
|
|
|
>
|
|
|
|
<fa-icon icon="eye"></fa-icon>
|
2021-08-01 06:54:44 +00:00
|
|
|
<span class="d-none d-md-inline">Vista previa</span>
|
2021-07-03 21:48:27 +00:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
[routerLink]="['/plantilla', plantilla.id, 'edit']"
|
2021-07-30 04:49:50 +00:00
|
|
|
class="ds-btn ds-btn--primary btn-sm"
|
2021-07-03 21:48:27 +00:00
|
|
|
data-cy="entityEditButton"
|
|
|
|
>
|
|
|
|
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
|
|
|
</button>
|
|
|
|
|
2021-07-30 04:49:50 +00:00
|
|
|
<button type="submit" (click)="delete(plantilla)" class="ds-btn ds-btn--danger btn-sm" data-cy="entityDeleteButton">
|
2021-07-03 21:48:27 +00:00
|
|
|
<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>
|
2021-08-01 03:53:35 +00:00
|
|
|
|
|
|
|
<!-- Modal -->
|
|
|
|
<div
|
|
|
|
class="modal fade ds-modal"
|
|
|
|
id="crearPlantilla"
|
|
|
|
tabindex="-1"
|
|
|
|
role="dialog"
|
|
|
|
aria-labelledby="exampleModalCenterTitle"
|
|
|
|
aria-hidden="true"
|
|
|
|
>
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<form
|
|
|
|
autocomplete="off"
|
|
|
|
class="ds-form"
|
|
|
|
name="templateCreateForm"
|
|
|
|
role="form"
|
|
|
|
novalidate
|
|
|
|
(ngSubmit)="save()"
|
|
|
|
[formGroup]="templateCreateForm"
|
|
|
|
>
|
|
|
|
<div class="modal-header">
|
|
|
|
<h1 class="modal-title" id="exampleModalLongTitle">Crear Plantilla</h1>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<!-- Template Registration Modal -->
|
|
|
|
<div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.nombre" for="field_nombre">Nombre</label>
|
|
|
|
<input type="text" class="form-control" name="nombre" id="field_nombre" data-cy="nombre" formControlName="nombre" />
|
|
|
|
<div
|
|
|
|
*ngIf="
|
|
|
|
templateCreateForm.get('nombre')!.invalid &&
|
|
|
|
(templateCreateForm.get('nombre')!.dirty || templateCreateForm.get('nombre')!.touched)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<small
|
|
|
|
class="form-text text-danger"
|
|
|
|
*ngIf="templateCreateForm.get('nombre')?.errors?.required"
|
|
|
|
jhiTranslate="entity.validation.required"
|
|
|
|
>
|
|
|
|
This field is required.
|
|
|
|
</small>
|
|
|
|
<small
|
|
|
|
class="form-text text-danger"
|
|
|
|
*ngIf="templateCreateForm.get('nombre')?.errors?.minlength"
|
|
|
|
jhiTranslate="entity.validation.minlength"
|
|
|
|
[translateValues]="{ min: 1 }"
|
|
|
|
>
|
|
|
|
This field is required to be at least 1 characters.
|
|
|
|
</small>
|
|
|
|
<small
|
|
|
|
class="form-text text-danger"
|
|
|
|
*ngIf="templateCreateForm.get('nombre')?.errors?.maxlength"
|
|
|
|
jhiTranslate="entity.validation.maxlength"
|
|
|
|
[translateValues]="{ max: 50 }"
|
|
|
|
>
|
|
|
|
This field cannot be longer than 50 characters.
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.descripcion" for="field_descripcion"
|
|
|
|
>Descripcion</label
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
|
|
|
name="descripcion"
|
|
|
|
id="field_descripcion"
|
|
|
|
data-cy="descripcion"
|
|
|
|
formControlName="descripcion"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-control-label" jhiTranslate="dataSurveyApp.plantilla.precio" for="field_precio">Precio</label>
|
|
|
|
<input type="number" class="form-control" name="precio" id="field_precio" data-cy="precio" formControlName="precio" />
|
|
|
|
<div
|
|
|
|
*ngIf="
|
|
|
|
templateCreateForm.get('precio')!.invalid &&
|
|
|
|
(templateCreateForm.get('precio')!.dirty || templateCreateForm.get('precio')!.touched)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<small
|
|
|
|
class="form-text text-danger"
|
|
|
|
*ngIf="templateCreateForm.get('precio')?.errors?.required"
|
|
|
|
jhiTranslate="entity.validation.required"
|
|
|
|
>
|
|
|
|
This field is required.
|
|
|
|
</small>
|
|
|
|
<small
|
|
|
|
class="form-text text-danger"
|
|
|
|
[hidden]="!templateCreateForm.get('precio')?.errors?.number"
|
|
|
|
jhiTranslate="entity.validation.number"
|
|
|
|
>
|
|
|
|
This field should be a number.
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2021-08-01 04:52:17 +00:00
|
|
|
<label class="form-control-label" jhiTranslate="dataSurveyApp.plantilla.categoria" for="field_categoria">Categoria</label>
|
2021-08-01 03:53:35 +00:00
|
|
|
<select class="form-control" id="field_categoria" data-cy="categoria" name="categoria" formControlName="categoria">
|
2021-08-01 04:52:17 +00:00
|
|
|
<option [ngValue]="null"></option>
|
2021-08-01 03:53:35 +00:00
|
|
|
<option
|
|
|
|
[ngValue]="
|
|
|
|
categoriaOption.id === templateCreateForm.get('categoria')!.value?.id
|
|
|
|
? templateCreateForm.get('categoria')!.value
|
|
|
|
: categoriaOption
|
|
|
|
"
|
|
|
|
*ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
|
|
|
|
>
|
|
|
|
{{ categoriaOption.nombre }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<input id="createAnother" type="checkbox" (change)="createAnotherTemplateChange($event)" />
|
|
|
|
<label for="createAnother">Crear otra</label>
|
|
|
|
<button id="cancelBtn" type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal">
|
|
|
|
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
id="save-entity"
|
|
|
|
data-cy="entityCreateSaveButton"
|
|
|
|
class="ds-btn ds-btn--primary"
|
|
|
|
[disabled]="templateCreateForm.invalid || isSaving"
|
|
|
|
>
|
|
|
|
<span jhiTranslate="entity.action.create">Create</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|