Skip to content

Commit

Permalink
Prevent add ballot if deleted users
Browse files Browse the repository at this point in the history
  • Loading branch information
reiterl committed Oct 10, 2023
1 parent aa36d6b commit bbf326d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h2 *ngIf="isCreating">{{ 'New election' | translate }}</h2>
</ng-container>

<!-- New Ballot button -->
<div class="new-ballot-button" *ngIf="assignment && hasPerms('createPoll')">
<div class="new-ballot-button" *ngIf="assignment && assignment.candidatesAsUsers.length && hasPerms('createPoll')">
<button mat-stroked-button (click)="openDialog()">
<mat-icon>add</mat-icon>
<span>{{ 'New ballot' | translate }}</span>
Expand Down Expand Up @@ -162,7 +162,7 @@ <h3>{{ 'Candidates' | translate }}</h3>
>
<!-- implicit item references into the component using ng-template slot -->
<ng-template let-item>
<div class="single-candidate-line">
<div [ngClass]="{'single-candidate-line': true, 'deleted-candidate': !item.user}">
<span>{{ item.getTitle() }}</span>
<span *ngIf="hasPerms('manage')">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
margin: auto 0;
}
}
.deleted-candidate {
color: slategrey;
}

}

.add-candidates {
Expand Down

0 comments on commit bbf326d

Please sign in to comment.