aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles/prosilver
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-04-20 10:17:08 -0700
committerCesar G <prototech91@gmail.com>2014-04-20 10:17:08 -0700
commit889f6673b250685634795281fc60dc8a011c0369 (patch)
treeb7857611f989a9e98d4fbf1e92dcf5d158dea45a /phpBB/styles/prosilver
parentc31ea7af66d3c38072de2fe6788c8d5d4c5d93f5 (diff)
parentf1201a8ec5b5b65ebcb24cddda60ea29fb1c222f (diff)
downloadforums-889f6673b250685634795281fc60dc8a011c0369.tar
forums-889f6673b250685634795281fc60dc8a011c0369.tar.gz
forums-889f6673b250685634795281fc60dc8a011c0369.tar.bz2
forums-889f6673b250685634795281fc60dc8a011c0369.tar.xz
forums-889f6673b250685634795281fc60dc8a011c0369.zip
Merge remote-tracking branch 'PayBas/ticket/12363' into develop-ascraeus
* PayBas/ticket/12363: [ticket/12363] Fix typo [ticket/12363] changed _winner_ to _most-votes_ [ticket/12363] Mark winning (most votes) results bar
Diffstat (limited to 'phpBB/styles/prosilver')
-rw-r--r--phpBB/styles/prosilver/template/ajax.js2
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index d2a070d11b..4df38f4275 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -244,10 +244,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
var option = $(this);
var option_id = option.attr('data-poll-option-id');
var voted = (typeof res.user_votes[option_id] !== 'undefined') ? true : false;
+ var most_voted = (res.vote_counts[option_id] == most_votes) ? true : false;
var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[option_id] / res.total_votes) * 100);
var percent_rel = (most_votes == 0) ? 0 : Math.round((res.vote_counts[option_id] / most_votes) * 100);
option.toggleClass('voted', voted);
+ option.toggleClass('most-votes', most_voted);
// Update the bars
var bar = option.find('.resultbar div');
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 4e3561c4a2..649129923a 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -72,7 +72,7 @@
<fieldset class="polls">
<!-- BEGIN poll_option -->
- <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}">
+ <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}">
<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
<!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
<dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd>