Merge remote-tracking branch 'refs/remotes/origin/3.0'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / poll.tpl
1 {if ($__wcf->getUser()->userID || $poll->canSeeResult() || $poll->canViewParticipants()) && !$__pollLoadedJavaScript|isset}
2 {assign var=__pollLoadedJavaScript value=true}
3 <script data-relocate="true">
4 $(function() {
5 new WCF.Poll.Manager('.pollContainer');
6 });
7 </script>
8 {/if}
9
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}">
11 <section>
12 <h2>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></h2>
13
14 <div class="pollInnerContainer">
15 {if !$__wcf->getUser()->userID}
16 {if $poll->canSeeResult()}
17 {assign var='__pollView' value='result'}
18 {include file='pollResult'}
19 {else}
20 {assign var='__pollView' value='vote'}
21 {include file='pollVote'}
22 {/if}
23 {else}
24 {if $poll->canVote() && !$poll->isParticipant()}
25 {assign var='__pollView' value='vote'}
26 {include file='pollVote'}
27 {else}
28 {assign var='__pollView' value='result'}
29 {include file='pollResult'}
30 {/if}
31 {/if}
32
33 {event name='pollData'}
34 </div>
35 </section>
36
37 {hascontent}
38 <div class="formSubmit jsOnly"{if !$poll->canVote() && $__pollView === 'result'} style="display: none"{/if}>
39 {content}
40 {if $__wcf->getUser()->userID}
41 <button class="small jsButtonPollVote"{if $poll->canVote()} disabled{else} style="display: none;"{/if}>{lang}wcf.poll.button.vote{/lang}</button>
42 <button class="small jsButtonPollShowVote"{if !$poll->canVote() || $__pollView === 'vote'} style="display: none;"{/if}>{lang}wcf.poll.button.showVote{/lang}</button>
43 <button class="small jsButtonPollShowResult"{if $__pollView === 'result'} style="display: none;"{/if}>{lang}wcf.poll.button.showResult{/lang}</button>
44 {/if}
45 {if $poll->canViewParticipants() || ($poll->canVote() && $poll->isPublic)}
46 <button class="small jsButtonPollShowParticipants"{if $__pollView === 'vote' || !$poll->canSeeResult()} style="display: none"{/if}>{lang}wcf.poll.button.showParticipants{/lang}</button>
47 {/if}
48
49 {event name='pollButtons'}
50 {/content}
51 </div>
52 {/hascontent}
53 </div>