Commit | Line | Data |
---|---|---|
c72aab29 | 1 | {if ($__wcf->getUser()->userID || $poll->canSeeResult() || $poll->canViewParticipants()) && !$__pollLoadedJavaScript|isset} |
e25b7b61 | 2 | {assign var=__pollLoadedJavaScript value=true} |
9543d9fe | 3 | <script data-relocate="true"> |
e25b7b61 MW |
4 | $(function() { |
5 | new WCF.Poll.Manager('.pollContainer'); | |
6 | }); | |
e25b7b61 MW |
7 | </script> |
8 | {/if} | |
9 | ||
3f035566 | 10 | <div class="pollContainer{if POLL_FULL_WIDTH} pollContainerFullWidth{/if}" 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}"> |
b8eab696 | 11 | <section> |
818e3018 | 12 | <h2>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></h2> |
e25b7b61 MW |
13 | |
14 | <div class="pollInnerContainer"> | |
15 | {if !$__wcf->getUser()->userID} | |
16 | {if $poll->canSeeResult()} | |
c95a9bf1 | 17 | {assign var='__pollView' value='result'} |
e25b7b61 MW |
18 | {include file='pollResult'} |
19 | {else} | |
c95a9bf1 | 20 | {assign var='__pollView' value='vote'} |
e25b7b61 MW |
21 | {include file='pollVote'} |
22 | {/if} | |
23 | {else} | |
24 | {if $poll->canVote() && !$poll->isParticipant()} | |
c95a9bf1 | 25 | {assign var='__pollView' value='vote'} |
e25b7b61 MW |
26 | {include file='pollVote'} |
27 | {else} | |
c95a9bf1 | 28 | {assign var='__pollView' value='result'} |
e25b7b61 MW |
29 | {include file='pollResult'} |
30 | {/if} | |
31 | {/if} | |
32 | ||
33 | {event name='pollData'} | |
34 | </div> | |
b8eab696 | 35 | </section> |
e25b7b61 | 36 | |
c72aab29 | 37 | {hascontent} |
3f035566 | 38 | <div class="formSubmit jsOnly"{if !$poll->canVote() && $__pollView === 'result'} style="display: none"{/if}> |
c72aab29 AE |
39 | {content} |
40 | {if $__wcf->getUser()->userID} | |
d3755a05 | 41 | <button class="small jsButtonPollVote"{if $poll->canVote()} disabled{else} style="display: none;"{/if}>{lang}wcf.poll.button.vote{/lang}</button> |
d49192ff | 42 | <button class="small jsButtonPollShowVote"{if !$poll->canVote() || $__pollView === 'vote'} style="display: none;"{/if}>{lang}wcf.poll.button.showVote{/lang}</button> |
c95a9bf1 | 43 | <button class="small jsButtonPollShowResult"{if $__pollView === 'result'} style="display: none;"{/if}>{lang}wcf.poll.button.showResult{/lang}</button> |
c72aab29 | 44 | {/if} |
888a7d57 | 45 | {if $poll->canViewParticipants() || ($poll->canVote() && $poll->isPublic)} |
d49192ff | 46 | <button class="small jsButtonPollShowParticipants"{if $__pollView === 'vote' || !$poll->canSeeResult()} style="display: none"{/if}>{lang}wcf.poll.button.showParticipants{/lang}</button> |
c72aab29 AE |
47 | {/if} |
48 | ||
49 | {event name='pollButtons'} | |
50 | {/content} | |
e25b7b61 | 51 | </div> |
c72aab29 | 52 | {/hascontent} |
e25b7b61 | 53 | </div> |