Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Adding abstain to approval voting.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines committed May 15, 2018
1 parent 8abd9f3 commit 10c7afe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions ui/src/app/components/candidate/candidate.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<span *ngIf="!candidate.title">Untitled candidate</span>
<small class="text-muted">
<span *ngIf="voteExists() && questionType == 1">Your Vote: {{vote / 10}} | </span>
<span *ngIf="voteExists() && questionType == 2">Your Vote: {{vote}} | </span>
<span *ngIf="voteExists() && questionType == 3">Your Vote: {{approvalVoteToThumb()}}</span>
<span *ngIf="voteExists() && questionType >= 2">Your Vote: {{vote / 10}} | </span>
<span *ngIf="candidate?.meetsThreshold && (questionType == 1 || questionType == 3)" role="button">Score: <span tooltip="{{voteAvg(4)}}">{{voteAvg(1)}}</span> | </span>
<span *ngIf="candidate.avg_score && questionType == 2">Score: {{candidate.avg_score.toFixed(1)}} | </span>
<span *ngIf="!candidate.meetsThreshold">Score: Too Few Votes | </span>
Expand All @@ -28,6 +27,8 @@
<div class="btn-group col-md-12">
<button class="btn btn-outline-primary" [class.active]="vote==100" (click)="createOrUpdateVote(100)" [disabled]="expired || candidate.readOnly"><i class="fa fa-fw fa-thumbs-up"></i>
</button>
<button class="btn btn-outline-primary" [class.active]="vote==50" (click)="createOrUpdateVote(50)" [disabled]="expired || candidate.readOnly">Abstain
</button>
<button class="btn btn-outline-primary" [class.active]="vote==0" (click)="createOrUpdateVote(0)" [disabled]="expired || candidate.readOnly"><i class="fa fa-fw fa-thumbs-down"></i>
</button>
</div>
Expand Down
4 changes: 0 additions & 4 deletions ui/src/app/components/candidate/candidate.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ export class CandidateComponent implements OnInit {
return (this.candidate.votes) ? this.candidate.votes.length.toString() : '0';
}

approvalVoteToThumb(): string {
return (this.vote == 100) ? "👍" : "👎";
}

voteExists(): boolean {
return this.vote !== undefined && this.vote !== null;
}
Expand Down

0 comments on commit 10c7afe

Please sign in to comment.