Poll were missing the button to show participants after vote
authorAlexander Ebert <ebert@woltlab.com>
Tue, 6 Jun 2017 12:17:14 +0000 (14:17 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 6 Jun 2017 12:17:14 +0000 (14:17 +0200)
com.woltlab.wcf/templates/poll.tpl
wcfsetup/install/files/js/WCF.Poll.js

index 2bb2301247d1270fe929c19f7c1bee3d9dae0b09..21f68055e084dbb6ecb3a062c3edf6a2d85c301b 100644 (file)
@@ -9,7 +9,7 @@
        </script>
 {/if}
 
-<div class="container containerPadding pollContainer" data-poll-id="{@$poll->pollID}" data-can-vote="{if $poll->canVote()}1{else}0{/if}" data-can-view-result="{if $poll->canSeeResult()}1{else}0{/if}" data-can-view-participants="{if $poll->canViewParticipants()}true{else}false{/if}" data-in-vote="{if $poll->canVote() && !$poll->isParticipant()}1{else}0{/if}" data-question="{$poll->question}" data-max-votes="{@$poll->maxVotes}">
+<div class="container containerPadding pollContainer" data-poll-id="{@$poll->pollID}" data-can-vote="{if $poll->canVote()}1{else}0{/if}" data-can-view-result="{if $poll->canSeeResult()}1{else}0{/if}" data-can-view-participants="{if $poll->canViewParticipants()}true{else}false{/if}" data-in-vote="{if $poll->canVote() && !$poll->isParticipant()}1{else}0{/if}" data-question="{$poll->question}" data-max-votes="{@$poll->maxVotes}" data-is-public="{if $poll->isPublic}true{else}false{/if}">
        <fieldset>
                <legend>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></legend>
                
@@ -40,7 +40,7 @@
                                        <button class="small jsButtonPollShowVote">{lang}wcf.poll.button.showVote{/lang}</button>
                                        <button class="small jsButtonPollShowResult">{lang}wcf.poll.button.showResult{/lang}</button>
                                {/if}
-                               {if $poll->canViewParticipants()}
+                               {if $poll->canViewParticipants() || ($poll->canVote() && $poll->isPublic)}
                                        <button class="small jsButtonPollShowParticipants">{lang}wcf.poll.button.showParticipants{/lang}</button>
                                {/if}
                                
index 0a4b6847e5a6527f9ec3015f6997f9db218d8803..0fa60e317ba6f1e0813ac5103951059ab23bb58c 100644 (file)
@@ -483,6 +483,11 @@ WCF.Poll.Manager = Class.extend({
                                // display results
                                this._canViewResult[$pollID] = true;
                                this._canVote[$pollID] = (data.canVote) ? true : false;
+                               
+                               if (this._polls[$pollID].data('isPublic')) {
+                                       this._canViewParticipants[$pollID] = true;
+                               }
+                               
                                this._showResult(null, $pollID);
                        break;
                }