From 5871d597b5d48b1c36514fab566886e6ac05cd46 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 28 Apr 2023 15:29:33 +0200 Subject: [PATCH] Migrate the inline poll management to the newer API --- .../templates/__messageFormPoll.tpl | 16 +++---- .../templates/__messageFormPollInline.tpl | 43 ++++++++++--------- .../templates/__pollOptionsFormField.tpl | 14 +++--- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/com.woltlab.wcf/templates/__messageFormPoll.tpl b/com.woltlab.wcf/templates/__messageFormPoll.tpl index 66c410fe78..12b5e0665f 100644 --- a/com.woltlab.wcf/templates/__messageFormPoll.tpl +++ b/com.woltlab.wcf/templates/__messageFormPoll.tpl @@ -1,17 +1,17 @@ {if $__showPoll|isset && $__showPoll} @@ -20,10 +21,10 @@
- +
- +
@@ -35,36 +36,36 @@
- +
- +
- +
- +
- +
{if !$pollID && $__wcf->getPollManager()->canStartPublicPoll()}
- +
{/if}
- + {lang}wcf.poll.resultsRequireVote.description{/lang}
- +
diff --git a/com.woltlab.wcf/templates/__pollOptionsFormField.tpl b/com.woltlab.wcf/templates/__pollOptionsFormField.tpl index fb9000d34c..c7a4d94350 100644 --- a/com.woltlab.wcf/templates/__pollOptionsFormField.tpl +++ b/com.woltlab.wcf/templates/__pollOptionsFormField.tpl @@ -5,15 +5,13 @@ 'Dom/Traverse', 'Dom/Util', 'EventHandler', - 'Language', 'WoltLabSuite/Core/Form/Builder/Manager', 'WoltLabSuite/Core/Ui/Poll/Editor' - ], function(DomTraverse, DomUtil, EventHandler, Language, FormBuilderManager, UiPollEditor) { - Language.addObject({ - 'wcf.poll.button.addOption': '{jslang}wcf.poll.button.addOption{/jslang}', - 'wcf.poll.button.removeOption': '{jslang}wcf.poll.button.removeOption{/jslang}', - 'wcf.poll.maxVotes.error.invalid': '{jslang}wcf.poll.maxVotes.error.invalid{/jslang}' - }); + ], (DomTraverse, DomUtil, EventHandler, FormBuilderManager, UiPollEditor) => { + {jsphrase name='wcf.poll.button.addOption'} + {jsphrase name='wcf.poll.button.removeOption'} + {jsphrase name='wcf.poll.endTime.error.invalid'} + {jsphrase name='wcf.poll.maxVotes.error.invalid'} var pollEditor = new UiPollEditor( DomUtil.identify(DomTraverse.childByTag(elById('{@$field->getPrefixedId()|encodeJS}Container'), 'DD')), @@ -21,7 +19,7 @@ '{@$field->getPrefixedWysiwygId()}', { isAjax: {if $field->getDocument()->isAjax()}true{else}false{/if}, - maxOptions: {@POLL_MAX_OPTIONS} + maxOptions: {POLL_MAX_OPTIONS} } ); -- 2.20.1