mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
only one popup confirm
This commit is contained in:
parent
1f8315235c
commit
1307b9f1a3
@ -62,34 +62,19 @@
|
||||
<h3 class="step-counter-text">Étape {{ step_current }} sur {{ step_max }}</h3>
|
||||
</div>
|
||||
<div class="column is-narrow has-text-right">
|
||||
<a class="cancel-button" (click)="showCancelDialog()"> Annuler <i class="fa fa-times"></i> </a>
|
||||
<p-button class="cancel-button" (click)="showCancelDialog()">
|
||||
Annuler <i class="fa fa-times"></i>
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p-confirmDialog
|
||||
[style]="{ width: '50vw' }"
|
||||
key="positionDialog"
|
||||
[baseZIndex]="10000"
|
||||
rejectButtonStyleClass="p-button-outlined"
|
||||
></p-confirmDialog>
|
||||
<div class="step-bar-container" style="width: 100%;">
|
||||
<div class="step-bar-progress" [ngStyle]="{ width: (step_current / step_max) * 100 + '%' }"></div>
|
||||
</div>
|
||||
|
||||
<!-- modale de confirmation pour quitter-->
|
||||
<p-confirmDialog #stepperConfirm [style]="{ width: '50vw' }">
|
||||
<ng-template pTemplate="header">
|
||||
<h3>{{ 'creation.dialog' | translate }}</h3>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="footer">
|
||||
<button
|
||||
type="button"
|
||||
pButton
|
||||
icon="pi pi-times"
|
||||
[label]="'dialogs.no' | translate"
|
||||
(click)="stepperConfirm.reject()"
|
||||
></button>
|
||||
<button
|
||||
type="button"
|
||||
pButton
|
||||
icon="pi pi-check"
|
||||
[label]="'dialogs.yes' | translate"
|
||||
(click)="stepperConfirm.accept()"
|
||||
></button>
|
||||
</ng-template>
|
||||
</p-confirmDialog>
|
||||
</section>
|
||||
|
@ -10,6 +10,9 @@ import { Router } from '@angular/router';
|
||||
styleUrls: ['./stepper.component.scss'],
|
||||
})
|
||||
export class StepperComponent {
|
||||
@Input()
|
||||
public stepperConfirm: HTMLElement;
|
||||
|
||||
@Input()
|
||||
public step_current: number = 1;
|
||||
@Input()
|
||||
@ -20,16 +23,20 @@ export class StepperComponent {
|
||||
public pollService: PollService,
|
||||
private confirmationService: ConfirmationService,
|
||||
private router: Router
|
||||
) {}
|
||||
) {
|
||||
this.step_current = this.pollService.step_current;
|
||||
}
|
||||
|
||||
showCancelDialog() {
|
||||
this.confirmationService.confirm({
|
||||
message: 'Quitter la création de sondage?',
|
||||
header: "Retour à l' accueil",
|
||||
reject: () => {},
|
||||
accept: () => {
|
||||
this.router.navigate(['/']);
|
||||
},
|
||||
header: 'Quitter ?',
|
||||
message: 'Souhaitez-vous vraiment quitter le sondage ? Toutes les informations seront effacées.',
|
||||
accept: () => this.goToHome(),
|
||||
reject: () => console.log('rejected'),
|
||||
});
|
||||
}
|
||||
goToHome() {
|
||||
this.confirmationService.close();
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
"title": "Créer un sondage",
|
||||
"want": "Choisissez le type de sondage",
|
||||
"dialog": "Quitter la création de sondage?",
|
||||
"dialog_content": "Souhaitez-vous vraiment quitter le sondage ? Toutes les informations seront effacées.",
|
||||
"advanced": "Options avancées",
|
||||
"kind": {
|
||||
"classic": "Propositions",
|
||||
|
Loading…
Reference in New Issue
Block a user