Commit | Line | Data |
---|---|---|
c72aab29 | 1 | {if ($__wcf->getUser()->userID || $poll->canSeeResult() || $poll->canViewParticipants()) && !$__pollLoadedJavaScript|isset} |
c49d1895 | 2 | {assign var=__pollLoadedJavaScript value=true} |
3 | <script data-relocate="true"> | |
0e92669f | 4 | require(['WoltLabSuite/Core/Ui/Poll/Manager/Poll'], function({ setupAll }) { |
5 | setupAll(); | |
c49d1895 | 6 | }); |
e25b7b61 MW |
7 | </script> |
8 | {/if} | |
9 | ||
c49d1895 | 10 | <div id="poll{@$poll->pollID}" class="pollContainer{if POLL_FULL_WIDTH} pollContainerFullWidth{/if}"{* |
11 | *} data-poll-id="{@$poll->pollID}"{* | |
12 | *} data-can-vote="{if $poll->canVote()}true{else}false{/if}"{* | |
13 | *} data-can-view-result="{if $poll->canSeeResult()}true{else}false{/if}"{* | |
14 | *} data-can-view-participants="{if $poll->canViewParticipants()}true{else}false{/if}"{* | |
15 | *} data-in-vote="{if $poll->canVote() && !$poll->isParticipant()}true{else}false{/if}"{* | |
16 | *} data-question="{$poll->question}"{* | |
17 | *} data-max-votes="{@$poll->maxVotes}"{* | |
18 | *} data-is-public="{if $poll->isPublic}true{else}false{/if}"> | |
b8eab696 | 19 | <section> |
5c7b5ecc | 20 | <h2>{$poll->question} <span class="badge jsTooltip pollTotalVotesBadge" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></h2> |
ab800045 | 21 | |
e25b7b61 MW |
22 | <div class="pollInnerContainer"> |
23 | {if !$__wcf->getUser()->userID} | |
24 | {if $poll->canSeeResult()} | |
c95a9bf1 | 25 | {assign var='__pollView' value='result'} |
c49d1895 | 26 | <div data-key="results"> |
27 | {include file='pollResult'} | |
28 | </div> | |
e25b7b61 | 29 | {else} |
c95a9bf1 | 30 | {assign var='__pollView' value='vote'} |
c49d1895 | 31 | <div data-key="vote"> |
32 | {include file='pollVote'} | |
33 | </div> | |
e25b7b61 MW |
34 | {/if} |
35 | {else} | |
36 | {if $poll->canVote() && !$poll->isParticipant()} | |
c95a9bf1 | 37 | {assign var='__pollView' value='vote'} |
c49d1895 | 38 | <div data-key="vote"> |
39 | {include file='pollVote'} | |
40 | </div> | |
e25b7b61 | 41 | {else} |
c95a9bf1 | 42 | {assign var='__pollView' value='result'} |
c49d1895 | 43 | <div data-key="results"> |
44 | {include file='pollResult'} | |
45 | </div> | |
e25b7b61 MW |
46 | {/if} |
47 | {/if} | |
ab800045 | 48 | |
e25b7b61 MW |
49 | {event name='pollData'} |
50 | </div> | |
b8eab696 | 51 | </section> |
ab800045 | 52 | |
c72aab29 | 53 | {hascontent} |
76705fa4 | 54 | <div class="formSubmit jsOnly"{if !$poll->canVote() && $__pollView === 'result' && !$poll->canSeeResult()} style="display: none"{/if}> |
c72aab29 AE |
55 | {content} |
56 | {if $__wcf->getUser()->userID} | |
ab800045 | 57 | <button class="small votePollButton"{if $poll->canVote() && $__pollView === 'vote'} disabled{else} hidden{/if}>{lang}wcf.poll.button.vote{/lang}</button> |
58 | <button class="small showVoteFormButton"{if $__pollView === 'vote' || !$poll->canVote()} hidden{/if}>{lang}wcf.poll.button.showVote{/lang}</button> | |
59 | <button class="small showResultsButton"{if $__pollView === 'result' || !$poll->canSeeResult()} hidden{/if}>{lang}wcf.poll.button.showResult{/lang}</button> | |
c72aab29 | 60 | {/if} |
888a7d57 | 61 | {if $poll->canViewParticipants() || ($poll->canVote() && $poll->isPublic)} |
972cc683 | 62 | <button class="small showPollParticipantsButton"{if $__pollView === 'vote' || !$poll->canSeeResult()} hidden{/if}>{lang}wcf.poll.button.showParticipants{/lang}</button> |
c72aab29 | 63 | {/if} |
ab800045 | 64 | |
c72aab29 AE |
65 | {event name='pollButtons'} |
66 | {/content} | |
e25b7b61 | 67 | </div> |
c72aab29 | 68 | {/hascontent} |
76705fa4 | 69 | </div> |