Merge branch 'master' into next
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / __messageFormPoll.tpl
1 {if $__showPoll|isset && $__showPoll}
2 <script data-relocate="true">
3 //<![CDATA[
4 $(function() {
5 WCF.Language.addObject({
6 'wcf.poll.button.addOption': '{lang}wcf.poll.button.addOption{/lang}',
7 'wcf.poll.button.removeOption': '{lang}wcf.poll.button.removeOption{/lang}'
8 });
9
10 new WCF.Poll.Management('pollOptionContainer', [ {implode from=$pollOptions item=pollOption}{ optionID: {@$pollOption[optionID]}, optionValue: '{$pollOption[optionValue]|encodeJS}' }{/implode} ], {@POLL_MAX_OPTIONS});
11 });
12 //]]>
13 </script>
14
15 <div id="poll" class="jsOnly tabMenuContent container containerPadding">
16 <fieldset>
17 <dl{if $errorField == 'pollOptions'} class="formError"{/if}>
18 <dt>
19 <label for="pollQuestion">{lang}wcf.poll.question{/lang}</label>
20 </dt>
21 <dd>
22 <input type="text" name="pollQuestion" id="pollQuestion" value="{$pollQuestion}" class="long" maxlength="255" />
23 {if $errorField == 'pollQuestion'}
24 <small class="innerError">
25 {lang}wcf.global.form.error.empty{/lang}
26 </small>
27 {/if}
28 </dd>
29 <dt>
30 <label>{lang}wcf.poll.options{/lang}</label>
31 </dt>
32 <dd id="pollOptionContainer" class="sortableListContainer">
33 <ol class="sortableList"></ol>
34 {if $errorField == 'pollOptions'}
35 <small class="innerError">
36 {lang}wcf.global.form.error.empty{/lang}
37 </small>
38 {/if}
39 <small>{lang}wcf.poll.options.description{/lang}</small>
40 </dd>
41 </dl>
42 <dl{if $errorField == 'pollEndTime'} class="formError"{/if}>
43 <dt>
44 <label for="pollEndTime">{lang}wcf.poll.endTime{/lang}</label>
45 </dt>
46 <dd>
47 <input type="datetime" name="pollEndTime" id="pollEndTime" value="{if $pollEndTime}{@$pollEndTime|date:'c'}{/if}" class="medium" data-ignore-timezone="true" />
48 {if $errorField == 'pollEndTime'}
49 <small class="innerError">
50 {lang}wcf.poll.endTime.error.{@$errorType}{/lang}
51 </small>
52 {/if}
53 </dd>
54 </dl>
55 <dl{if $errorField == 'pollMaxVotes'} class="formError"{/if}>
56 <dt>
57 <label for="pollMaxVotes">{lang}wcf.poll.maxVotes{/lang}</label>
58 </dt>
59 <dd>
60 <input type="number" name="pollMaxVotes" id="pollMaxVotes" value="{@$pollMaxVotes}" min="1" class="tiny" />
61 {if $errorField == 'pollMaxVotes'}
62 <small class="innerError">
63 {lang}wcf.poll.maxVotes.error.{@$errorType}{/lang}
64 </small>
65 {/if}
66 </dd>
67 </dl>
68 <dl>
69 <dt></dt>
70 <dd>
71 <label><input type="checkbox" name="pollIsChangeable" value="1"{if $pollIsChangeable} checked="checked"{/if} /> {lang}wcf.poll.isChangeable{/lang}</label>
72 </dd>
73 {if !$pollID && $__wcf->getPollManager()->canStartPublicPoll()}
74 <dd>
75 <label><input type="checkbox" name="pollIsPublic" value="1"{if $pollIsPublic} checked="checked"{/if} /> {lang}wcf.poll.isPublic{/lang}</label>
76 </dd>
77 {/if}
78 <dd>
79 <label><input type="checkbox" name="pollResultsRequireVote" value="1"{if $pollResultsRequireVote} checked="checked"{/if} /> {lang}wcf.poll.resultsRequireVote{/lang}</label>
80 <small>{lang}wcf.poll.resultsRequireVote.description{/lang}</small>
81 </dd>
82 <dd>
83 <label><input type="checkbox" name="pollSortByVotes" value="1"{if $pollSortByVotes} checked="checked"{/if} /> {lang}wcf.poll.sortByVotes{/lang}</label>
84 </dd>
85 </dl>
86
87 {event name='fields'}
88 </fieldset>
89 </div>
90 {/if}