Added proper support for font size and color
[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 //<![CDATA[
5 $(function() {
6 new WCF.Poll.Manager('.pollContainer');
7 });
8 //]]>
9 </script>
10 {/if}
11
12 <div class="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}">
13 <section>
14 <h2>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></h2>
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 </section>
34
35 {hascontent}
36 <div class="formSubmit jsOnly">
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}
49 </div>
50 {/hascontent}
51 </div>