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 | //<![CDATA[ |
5 | $(function() { | |
6 | new WCF.Poll.Manager('.pollContainer'); | |
7 | }); | |
8 | //]]> | |
9 | </script> | |
10 | {/if} | |
11 | ||
c72aab29 | 12 | <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}"> |
e25b7b61 MW |
13 | <fieldset> |
14 | <legend>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></legend> | |
15 | ||
16 | <div class="pollInnerContainer"> | |
17 | {if !$__wcf->getUser()->userID} | |
18 | {if $poll->canSeeResult()} | |
19 | {include file='pollResult'} | |
20 | {else} | |
21 | {include file='pollVote'} | |
22 | {/if} | |
23 | {else} | |
24 | {if $poll->canVote() && !$poll->isParticipant()} | |
25 | {include file='pollVote'} | |
26 | {else} | |
27 | {include file='pollResult'} | |
28 | {/if} | |
29 | {/if} | |
30 | ||
31 | {event name='pollData'} | |
32 | </div> | |
33 | </fieldset> | |
34 | ||
c72aab29 | 35 | {hascontent} |
e25b7b61 | 36 | <div class="formSubmit jsOnly"> |
c72aab29 AE |
37 | {content} |
38 | {if $__wcf->getUser()->userID} | |
39 | <button class="small jsButtonPollVote">{lang}wcf.poll.button.vote{/lang}</button> | |
40 | <button class="small jsButtonPollShowVote">{lang}wcf.poll.button.showVote{/lang}</button> | |
41 | <button class="small jsButtonPollShowResult">{lang}wcf.poll.button.showResult{/lang}</button> | |
42 | {/if} | |
43 | {if $poll->canViewParticipants()} | |
44 | <button class="small jsButtonPollShowParticipants">{lang}wcf.poll.button.showParticipants{/lang}</button> | |
45 | {/if} | |
46 | ||
47 | {event name='pollButtons'} | |
48 | {/content} | |
e25b7b61 | 49 | </div> |
c72aab29 | 50 | {/hascontent} |
e25b7b61 | 51 | </div> |