todo actions menu

This commit is contained in:
Tykayn 2021-11-18 10:31:50 +01:00 committed by tykayn
parent 56b48038e0
commit 26109ee368
2 changed files with 25 additions and 3 deletions

View File

@ -39,15 +39,15 @@
</div>
</div>
<div class="admin-actions" *ngIf="pollService.admin_key">
<button class="replicate duplicate button has-text-warning" [routerLink]="['']">
<button class="replicate duplicate button has-text-warning" (click)="deleteAllVotes()">
<i class="fa fa-user-times" aria-hidden="true"></i>
Supprimer tous les votes
</button>
<button class="replicate duplicate button has-text-warning" [routerLink]="['']">
<button class="replicate duplicate button has-text-warning" (click)="deleteAllComments()">
<i class="fa fa-comments-o" aria-hidden="true"></i>
Supprimer tous les commentaires
</button>
<button class="replicate duplicate button has-text-danger" [routerLink]="['']">
<button class="replicate duplicate button has-text-danger" (click)="deletePoll()">
<i class="fa fa-trash" aria-hidden="true"></i>
Supprimer le sondage
</button>

View File

@ -6,6 +6,7 @@ import { ApiService } from '../../../core/services/api.service';
import { PollService } from '../../../core/services/poll.service';
import { DateService } from '../../../core/services/date.service';
import { ToastService } from '../../../core/services/toast.service';
import { ConfirmationService } from 'primeng/api';
@Component({
selector: 'app-actions-menu',
@ -17,6 +18,7 @@ export class ActionsMenuComponent implements OnInit {
private router: Router,
private utils: PollUtilitiesService,
private _Activatedroute: ActivatedRoute,
private confirmationService: ConfirmationService,
public storageService: StorageService,
public api: ApiService,
public pollService: PollService,
@ -47,4 +49,24 @@ export class ActionsMenuComponent implements OnInit {
print(): void {
alert('TODO');
}
deleteAllVotes() {
this.confirmationService.confirm({
message: 'Supprimer tous les votes de ce sondage?',
accept: () => {
alert('TODO');
console.log('TODO');
},
});
}
deleteAllComments() {
alert('TODO');
console.log('TODO');
}
deletePoll() {
alert('TODO');
console.log('TODO');
}
}