2021-02-04 16:14:07 +01:00
|
|
|
<div class="form-field">
|
|
|
|
<form [formGroup]="form">
|
2021-02-12 14:51:17 +01:00
|
|
|
<span class="columns">
|
|
|
|
<span class="column">
|
|
|
|
<button class="btn is-primary" (click)="addChoice()">
|
|
|
|
<i class="fa fa-plus"></i>
|
|
|
|
Ajouter un choix
|
|
|
|
</button>
|
2021-02-04 16:14:07 +01:00
|
|
|
</span>
|
2021-02-12 14:51:17 +01:00
|
|
|
<span class="column pull-right">
|
|
|
|
<button class="btn is-warning" (click)="reinitChoices()">
|
|
|
|
<i class="fa fa-recycle"></i>
|
|
|
|
Réinitialiser
|
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</span>
|
2021-02-04 16:14:07 +01:00
|
|
|
|
2021-02-12 14:51:17 +01:00
|
|
|
<span class="hint">
|
|
|
|
{{ 'creation.choices_hint' | translate }}
|
|
|
|
</span>
|
|
|
|
<div *ngFor="let choice of choices; let i = index">
|
|
|
|
<div class="form-row" [formGroup]="choice">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
|
|
|
<button class="btn btn-warning" (click)="deleteChoiceField(i)">
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
</button>
|
|
|
|
{{ i * 1 + 1 }})
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
|
|
|
<label [for]="'choice_label_' + i" class="hidden">label</label>
|
|
|
|
<input
|
|
|
|
formControlName="label"
|
|
|
|
[id]="'choice_label_' + i"
|
|
|
|
(keyup)="keyOnChoice($event, i)"
|
|
|
|
(keyup.backspace)="deleteChoiceField(i)"
|
|
|
|
/>
|
|
|
|
<br />
|
|
|
|
<label [for]="'image_url_' + i" class="hidden">image Url</label>
|
|
|
|
<input
|
|
|
|
formControlName="imageUrl"
|
|
|
|
[id]="'image_url_' + i"
|
|
|
|
(keyup)="keyOnChoice($event, i)"
|
|
|
|
(keyup.backspace)="deleteChoiceField(i)"
|
|
|
|
/>
|
2021-02-04 16:14:07 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-12 14:51:17 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-04 16:14:07 +01:00
|
|
|
</form>
|
|
|
|
</div>
|