Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Commit

Permalink
Issue #51 - Allow users to change votes via candidate profile
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrenner committed Mar 10, 2013
1 parent 4eda934 commit ea2a710
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/Controller/CandidatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public function listByElection($id, $filter = 0, $sorting = 0) {
endforeach;
endif;


$conditions[] = array('Candidate.election_id = ' => $id);

if ($filter != 0) :
Expand Down
8 changes: 5 additions & 3 deletions app/View/Candidates/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
<div class="span3">
<p><a href="#" class="thumbnail"><img src="<?=$candidate['User']['image']?>" class="img-rounded" /></a></p>
<p class="pagination-centered" id="votes<?=$candidate['Candidate']['id']?>">
<?php if(!$votes['casted']['Vote']['stances_id']) : ?>
<?php //if(!$votes['casted']['Vote']['stances_id']) : ?>
<a class="btn btn-small btn-success" id="votes<?=$candidate['Candidate']['id']?>_1" href="#" onclick="vote(<?=$candidate['Candidate']['id']?>,1);"><i class="icon-thumbs-up"></i><span class="badge badge-inverse" id="votes_c<?=$candidate['Candidate']['id']?>_1"><?=$votes['positive']?></span></a>
<a class="btn btn-small btn-danger" id="votes<?=$candidate['Candidate']['id']?>_3" href="#" onclick="vote(<?=$candidate['Candidate']['id']?>,3);"><i class="icon-thumbs-down"></i><span class="badge badge-inverse" id="votes_c<?=$candidate['Candidate']['id']?>_3"><?=$votes['negative']?></span></a>
<?php else : ?>
<?php //else : ?>
<!--
<a class="btn btn-small disabled <?=$votes['casted']['Vote']['stances_id']==1 ? 'btn-success' : '' ?>" id="votes<?=$candidate['Candidate']['id']?>_1" href="#"><i class="icon-thumbs-up"></i><span class="badge badge-inverse" id="votes_c<?=$candidate['Candidate']['id']?>_1"><?=$votes['positive']?></span></a>
<a class="btn btn-small disabled <?=$votes['casted']['Vote']['stances_id']==3 ? 'btn-danger' : '' ?>" id="votes<?=$candidate['Candidate']['id']?>_3" href="#"><i class="icon-thumbs-down"></i><span class="badge badge-inverse" id="votes_c<?=$candidate['Candidate']['id']?>_3"><?=$votes['negative']?></span></a>
<?php endif; ?>
-->
<?php //endif; ?>
</p>
</div>
<div class="span6">
Expand Down

0 comments on commit ea2a710

Please sign in to comment.