Author: fdesbois Date: 2010-03-05 16:19:37 +0100 (Fri, 05 Mar 2010) New Revision: 2897 Log: Evo #122 : use custom pollForm.js instead of mixin zoneUpdater to manage interactions internal to the form. Added: trunk/pollen-ui/src/main/webapp/js/pollForm.js Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java trunk/pollen-ui/src/main/webapp/js/pollen.js trunk/pollen-ui/src/main/webapp/poll/PollForm.tml Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-05 09:55:30 UTC (rev 2896) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-05 15:19:37 UTC (rev 2897) @@ -2,13 +2,15 @@ package org.chorem.pollen.ui.pages.poll; import java.text.DateFormat; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.lang.StringUtils; -import org.apache.tapestry5.ValidationException; +import org.apache.tapestry5.RenderSupport; +import org.apache.tapestry5.annotations.Environmental; +import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry5.annotations.IncludeStylesheet; import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.annotations.SessionState; @@ -51,6 +53,7 @@ * par : $Author$ */ @IncludeStylesheet("context:css/poll.css") +@IncludeJavaScriptLibrary("context:js/pollForm.js") public class PollForm { @Inject @@ -163,13 +166,32 @@ return new SimpleDateFormat(messages.get("date-pattern")); } + @Environmental + private RenderSupport renderSupport; + + /** + * Action when rendering form. A script is added to manage form interactions + */ + @Log + void onPrepareForRender() { + String formId = mainForm.getClientId(); + if (log.isDebugEnabled()) { + log.debug("form id : " + formId); + } + if (formId != null) { + // Script for form interactions : see "webapp/js/pollForm.js" + renderSupport.addScript("new PollForm('%s', '%s', '%s');", + formId, + VoteCountingType.NORMAL, + PollType.FREE); + } + } + /**************************** MAIN INFOS **********************************/ @InjectComponent private Form mainForm; - private Date beginDateValidation; - @Persist @Property private boolean advancedOptions; @@ -178,109 +200,6 @@ advancedOptions = false; } - void onChangeFromCreatorName(String value) { - getPoll().setCreatorName(value); - } - - /** - * Action on creatorEmail textfield. This action refresh the form to - * actualize options, only if needed {@link #isNotificationDisabled()} - * - * @param value of the email - * @return the form to refresh - */ - Object onChangeFromEmail(String value) { - boolean notificationDisabled = isNotificationDisabled(); - getPoll().setCreatorEmail(value); - // The notification option depends on email change - // If it must be disabled and sendNotification checkbox is activated, - // execute change on notification fields - if (isNotificationDisabled() && hasNotification) { - return onChangeFromSendNotification(""); - } - return null; - } - - void onChangeFromTitle(String value) { - getPoll().setTitle(value); - } - - void onChangeFromDescription(String value) { - getPoll().setDescription(value); - } - - void onChangeFromBeginDate(String value) { - getPoll().setBeginDate(getDateFromChangeValue(value)); - } - - void onChangeFromEndDate(String value) { - getPoll().setEndDate(getDateFromChangeValue(value)); - } - - /** - * Util method to simplify date change. - * - * @param value of the date to parse - * @return the date resulted from the value - */ - protected Date getDateFromChangeValue(String value) { - Date result = null; - if (StringUtils.isNotEmpty(value)) { - try { - result = getDateFormat().parse(value); - } catch (ParseException eee) { - log.warn("Syntax error for poll date : " + value, eee); - } - } - return result; - } - - /** - * Action on voteCounting select. This action refresh the form to actualize - * options. - * - * @param value of the selected PollType - * @return the form to refresh - */ - Object onChangeFromVoteCounting(String value) { - if (log.isDebugEnabled()) { - log.debug("voteCounting change to value : " + value); - } - getPoll().setVoteCounting(VoteCountingType.valueOf(value)); - // The choiceNb option depends on VoteCounting type - // If it must be disabled and choiceNb checkbox is activated, - // execute change on choiceNb fields - if (isChoiceNbDisabled() && hasChoiceNb) { - return onChangeFromChoiceNb(""); - } - return mainForm; - } - - /** - * Action on pollType select. This action refresh the form to actualize - * options. - * - * @param value of the selected PollType - * @return the form to refresh - */ - Object onChangeFromPollType(String value) { - if (log.isDebugEnabled()) { - log.debug("pollType change to value : " + value); - } - getPoll().setPollType(PollType.valueOf(value)); - // The reminder option depends on PollType - // If it must be disabled and reminder checkbox is activated, execute - // change on reminder fields - if (isReminderDisabled() && hasReminder) { - return onChangeFromSendReminder(""); - } - return mainForm; - } - - void onChangeFromAdvancedOptions(String value) { - advancedOptions = !advancedOptions; - } - /************************** OPTIONS ***************************************/ /** Synchronization with anonymous and anonymousVoteAllowed options **/ @@ -322,132 +241,15 @@ hasReminder = false; } - //~~~~~~~~ OPTIONS ANONYMOUS ~~~~~~// - - /** - * Action on anonymous checkbox. The anonymousVoteAllowed is synchronized - * with this option. - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromAnonymous(String value) { - boolean anonymous = !getPoll().getAnonymous(); - getPoll().setAnonymous(anonymous); - // Synchro with anonymousVoteAllowed option - // Will be disabled and set to true if anonymous option is set - getPoll().setAnonymousVoteAllowed(anonymous); - anonymousVoteAllowedDisabled = anonymous; - return mainForm; - } - - void onChangeFromAnonymousVoteAllowed(String value) { - getPoll().setAnonymousVoteAllowed(!getPoll().getAnonymousVoteAllowed()); - } - - //~~~~~~~~ OPTIONS SHOW RESULTS ~~~~~~// - - /** - * Action on continuousResults checkbox. The publicResults is synchronized - * with this option. - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromContinuousResults(String value) { - boolean continuous = !getPoll().getContinuousResults(); - getPoll().setContinuousResults(continuous); - // Synchro with publicResults option - // Will be disabled and set to true if continousResults option is set - getPoll().setPublicResults(continuous); - publicResultsDisabled = continuous; - return mainForm; - } - - void onChangeFromPublicResults(String value) { - getPoll().setPublicResults(!getPoll().getPublicResults()); - } - - //~~~~~~~~ OPTION ADD_CHOICE_ALLOWED ~~~~~~// - - /** - * Action on choiceAddAllowed checkbox. The beginChoiceDate and - * endChoiceDate of the poll depends on this value. - * If the value becomes to false, the dates will be reinitialized. - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromChoiceAddAllowed(String value) { - boolean choiceAddAllowed = !getPoll().getChoiceAddAllowed(); - getPoll().setChoiceAddAllowed(choiceAddAllowed); - if (!choiceAddAllowed) { - getPoll().setBeginChoiceDate(null); - getPoll().setEndChoiceDate(null); - } - return mainForm; - } - - public String getChoiceDateStyle() { - return getPoll().getChoiceAddAllowed() ? "display" : "hidden"; - } - - void onChangeFromBeginChoiceDate(String value) { - getPoll().setBeginChoiceDate(getDateFromChangeValue(value)); - } - - void onChangeFromEndChoiceDate(String value) { - getPoll().setEndChoiceDate(getDateFromChangeValue(value)); - } - - //~~~~~~~~ OPTION NB_CHOICES ~~~~~~~~~~~~~~// - - /** - * Action on choiceNb checkbox to activate the maxChoiceNb for the poll. - * If the value becomes to false, the maxChoiceNb will be reinitialized - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromChoiceNb(String value) { - hasChoiceNb = !hasChoiceNb; - if (!hasChoiceNb) { - getPoll().setMaxChoiceNb(null); - } - return mainForm; - } - public boolean isChoiceNbDisabled() { // voteCounting not set to NORMAL return getPoll().getVoteCounting() != VoteCountingType.NORMAL; } - public String getChoiceNbLabelStyle() { - return isChoiceNbDisabled() ? "disabled" : ""; - } - void onChangeFromMaxChoiceNb(String value) { - getPoll().setMaxChoiceNb(Integer.parseInt(value)); - } - //~~~~~~~~ OPTION NOTIFICATION ~~~~~~~~~~~~// /** - * Action on sendNotification checkbox to activate the notification. - * If the value becomes to false, the notification will be reinitialized - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromSendNotification(String value) { - hasNotification = !hasNotification; - if (!hasNotification) { - notification = null; - } - return mainForm; - } - - /** * Get the current notification or init a new one based on PreventRule. * * @return the notification @@ -470,32 +272,9 @@ return StringUtils.isEmpty(getPoll().getCreatorEmail()); } - public String getNotificationLabelStyle() { - return isNotificationDisabled() ? "disabled" : ""; - } - - public void onChangeFromNotification(String value) { - getNotification().setSensibility(Integer.parseInt(value)); - } - //~~~~~~~~ OPTION REMINDER ~~~~~~~~~~~~~~~~// /** - * Action on sendReminder checkbox to activate the reminder. - * If the value becomes to false, the reminder will be reinitialized - * - * @param value not used in this case - * @return the form to refresh - */ - Object onChangeFromSendReminder(String value) { - hasReminder = !hasReminder; - if (!hasReminder) { - reminder = null; - } - return mainForm; - } - - /** * Get the current reminder or init a new one based on PreventRule. * * @return the reminder @@ -518,60 +297,5 @@ return getPoll().getPollType() == PollType.FREE; } - public String getReminderLabelStyle() { - return isReminderDisabled() ? "disabled" : ""; - } - - public void onChangeFromReminder(String value) { - getReminder().setSensibility(Integer.parseInt(value)); - } - -// /** -// * Ajax validation from beginChoiceDate input. The date must be before the -// * beginDate. -// * -// * @throws ValidationException -// */ -// void onValidateFromBeginChoiceDate(Date value) throws ValidationException { -// if (beginDateValidation == null) { -// beginDateValidation = getCurrentDate(); -// } -// beginChoiceDateValidation = value; -// if (value != null && value.after(beginDateValidation)) { -// throw new ValidationException( -// messages.get("beginChoiceDate-validate")); -// } -// } -// -// /** -// * Ajax validation from endChoiceDate input. The date must be after the -// * beginChoiceDate. -// * -// * @throws ValidationException -// */ -// void onValidateFromEndChoiceDate(Date value) throws ValidationException { -// if (beginChoiceDateValidation == null) { -// beginChoiceDateValidation = getCurrentDate(); -// } -// -// if (value != null && value.before(beginChoiceDateValidation)) { -// throw new ValidationException( -// messages.get("endChoiceDate-validate")); -// } -// } - -// private void initNotificationRule() { -// notificationCheckBox = false; -// newRule = new PreventRuleDTO("vote", 0, true, -// PreventRuleManager.EMAIL_ACTION); -// newRule.setPollId(poll.getId()); -// for (PreventRuleDTO rule : poll.getPreventRuleDTOs()) { -// if ("vote".equals(rule.getScope())) { -// notificationCheckBox = true; -// newRule = rule; -// } -// } -// } - } Added: trunk/pollen-ui/src/main/webapp/js/pollForm.js =================================================================== --- trunk/pollen-ui/src/main/webapp/js/pollForm.js (rev 0) +++ trunk/pollen-ui/src/main/webapp/js/pollForm.js 2010-03-05 15:19:37 UTC (rev 2897) @@ -0,0 +1,101 @@ +var PollForm = Class.create(); + +PollForm.prototype = { + + initialize: function(formId, voteCountingNormal, pollTypeFree) { + +// Tapestry.debug('Form id : ' + formId); + + this.form = $(formId); + +// Tapestry.debug('Form : ' + this.form); + + // Attributes for email and notification synchronization + this.email = this.form.email; + this.notification = this.form.sendNotification; + this.notificationFragmentId = 'notificationFragment'; + + // Attributes for voteCounting and choiceNb synchronization + this.voteCounting = this.form.voteCounting; + this.voteCountingNormal = voteCountingNormal; + this.choiceNbFragmentId = 'choiceNbFragment'; + this.choiceNb = this.form.choiceNb; + + // Attributes for anonymous options + this.anonymous = this.form.anonymous; + this.anonymousVoteAllowed = this.form.anonymousVoteAllowed; + + // Attributes for continuousResults and publicResults options + this.continuousResults = this.form.continuousResults; + this.publicResults = this.form.publicResults; + + // Attributes for pollType and reminder synchronization + this.pollType = this.form.pollType; + this.pollTypeFree = pollTypeFree; + this.reminder = this.form.sendReminder; + this.reminderFragmentId = 'reminderFragment'; + + this.voteCounting.observe('change', this.updateFromVoteCounting.bindAsEventListener(this)); + this.pollType.observe('change', this.updateFromPollType.bindAsEventListener(this)); + this.email.observe('blur', this.updateFromEmail.bindAsEventListener(this)); + this.anonymous.observe('change', this.updateFromAnonymous.bindAsEventListener(this)); + this.continuousResults.observe('change', this.updateFromContinuousResults.bindAsEventListener(this)); + }, + + /* + * Action when voteCounting select change. This change affects choiceNb + * checkbox : choiceNb is only available if voteCounting is 'NORMAL'. + */ + updateFromVoteCounting: function(event) { +// Tapestry.debug('VoteCounting change to : ' + this.voteCounting.value); + + if (this.voteCounting.value != this.voteCountingNormal) { + this.choiceNb.disabled = true; + this.choiceNb.checked = false; + $(this.choiceNbFragmentId).hide(); + } else { + this.choiceNb.disabled = false; + } + }, + + /* + * Action when pollType select change. This change affects reminder + * checkbox : reminder is only available if pollType is not 'FREE'. + */ + updateFromPollType: function(event) { +// Tapestry.debug('PollType change to : ' + this.pollType.value); + + if (this.pollType.value == this.pollTypeFree) { + this.reminder.disabled = true; + this.reminder.checked = false; + $(this.reminderFragmentId).hide(); + } else { + this.reminder.disabled = false; + } + }, + + updateFromEmail: function(event) { +// Tapestry.debug('Email change to : ' + this.email.value); + + if (this.email.value && this.email.value != ' ') { + this.notification.disabled = false; + } else { + this.notification.disabled = true; + this.notification.checked = false; + $(this.notificationFragmentId).hide(); + } + }, + + updateFromAnonymous: function(event) { + this.syncCheckboxes(this.anonymous, this.anonymousVoteAllowed); + }, + + updateFromContinuousResults: function(event) { + this.syncCheckboxes(this.continuousResults, this.publicResults); + }, + + syncCheckboxes: function(checkbox1, checkbox2) { + checkbox2.disabled = checkbox1.checked; + checkbox2.checked = checkbox1.checked; + } +} \ No newline at end of file Modified: trunk/pollen-ui/src/main/webapp/js/pollen.js =================================================================== --- trunk/pollen-ui/src/main/webapp/js/pollen.js 2010-03-05 09:55:30 UTC (rev 2896) +++ trunk/pollen-ui/src/main/webapp/js/pollen.js 2010-03-05 15:19:37 UTC (rev 2897) @@ -31,4 +31,26 @@ function onCompleteZoneUpdate(response) { var zoneManager = Tapestry.findZoneManagerForZone(response.zoneId); zoneManager.updateFromURL(response.link); -} \ No newline at end of file +} + +function triggerFragment(checkbox, fragment) { + fragment.toggle(); +} + +function changeVoteCounting(element) { + var choiceNbCheckbox = element.form.choiceNb; + + if (element.value != 'NORMAL') { + choiceNbCheckbox.disabled = true; + choiceNbCheckbox.checked = false; + $('choiceNbFragment').hide(); + } else { + choiceNbCheckbox.disabled = false; + } +} + +function synchronizeCheckboxes(checkbox1, checkbox2) { + checkbox2.disabled = checkbox1.checked; + checkbox2.checked = checkbox1.checked; +} + Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-03-05 09:55:30 UTC (rev 2896) +++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-03-05 15:19:37 UTC (rev 2897) @@ -1,205 +1,191 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <t:border t:address="addressBar.items" t:pageLogo="literal:Creation" t:pageTitle="prop:pageTitle" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> - <t:feedback t:id="feedback"/> - <h1 class="titlePoll"> - <t:if t:test="createMode"> - ${message:mainTitle-create} - <p:else>${poll.title}</p:else> - </t:if> - </h1> - <t:zone t:id="mainZone" t:update="show"> - <form t:type="form" t:id="mainForm" t:zone="mainZone" action="post"> - <t:errors/> - <div class="clearfix"> - <!-- MAIN INFOS --> - <div id="pollForm-mainInfos" class="fleft"> - <fieldset> - <legend>${message:legend-mainInfos}</legend> - <div> - <label t:type="label" for="creatorName" /> - <input type="text" t:type="textfield" t:id="creatorName" value="poll.creatorName" t:validate="required,minlength=2" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="keyup" t:zone="mainZone"/> - </div> - <div> - <label t:type="label" for="email" /> - <input type="text" t:type="textfield" t:id="email" value="poll.creatorEmail" t:validate="regexp" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="keyup" t:zone="mainZone"/> - </div> - <br /> - <div> - <label t:type="label" for="title" /> - <input type="text" t:type="textfield" t:id="title" value="poll.title" t:validate="required" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="keyup" t:zone="mainZone" /> - </div> - <div> - <label t:type="label" for="description" /> - <textarea t:type="textarea" cols="23" rows="1" t:id="description" t:value="poll.description" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="keyup" t:zone="mainZone" >${poll.description}</textarea> - </div> - <div> - <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> - <label t:type="label" for="beginDate" /> - <input t:type="ck/dateTimeField" t:id="beginDate" value="poll.beginDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="blur" t:zone="mainZone" /> - </div> - <div> - <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> - <label t:type="label" for="endDate" /> - <input t:type="ck/dateTimeField" t:id="endDate" value="poll.endDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="blur" t:zone="mainZone"/> - </div> - <div> - <label t:type="label" for="pollType" /> - <select t:type="select" t:id="pollType" t:value="poll.pollType" t:validate="required" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"> - <option></option> - </select> - <span t:type="ck/Tooltip" title="message:help" t:value="message:pollType-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - </div> - <div> - <label t:type="label" for="voteCounting" /> - <select t:type="select" t:id="voteCounting" t:value="poll.voteCounting" t:validate="required" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"> - <option></option> - </select> - <span t:type="ck/Tooltip" title="${message:help}" t:value="${message:voteCounting-help}" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <label t:type="label" for="advancedOptions" /> - <input t:type="checkbox" t:id="advancedOptions" t:mixins="triggerfragment,zoneUpdater" t:fragment="optionsFragment" - t:event="change" t:zone="mainZone"/> - </div> - </fieldset> +<t:feedback t:id="feedback"/> +<h1 class="titlePoll"> + <t:if t:test="createMode"> + ${message:mainTitle-create} + <p:else>${poll.title}</p:else> + </t:if> +</h1> +<t:zone t:id="mainZone" t:update="show"> +<form t:type="form" t:id="mainForm" t:zone="mainZone" action="post"> +<t:errors/> +<div class="clearfix"> +<!-- MAIN INFOS --> +<div id="pollForm-mainInfos" class="fleft"> + <fieldset> + <legend>${message:legend-mainInfos}</legend> + <div> + <label t:type="label" for="creatorName"/> + <input type="text" t:type="textfield" t:id="creatorName" value="poll.creatorName" t:validate="required,minlength=2"/> + </div> + <div> + <label t:type="label" for="email"/> + <input type="text" t:type="textfield" t:id="email" value="poll.creatorEmail" t:validate="regexp"/> + </div> + <br/> + + <div> + <label t:type="label" for="title"/> + <input type="text" t:type="textfield" t:id="title" value="poll.title" t:validate="required"/> + </div> + <div> + <label t:type="label" for="description"/> + <textarea t:type="textarea" cols="23" rows="1" t:id="description" t:value="poll.description">${poll.description}</textarea> + </div> + <div> + <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> + <label t:type="label" for="beginDate"/> + <input t:type="ck/dateTimeField" t:id="beginDate" value="poll.beginDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> + </div> + <div> + <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> + <label t:type="label" for="endDate"/> + <input t:type="ck/dateTimeField" t:id="endDate" value="poll.endDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> + </div> + <div> + <label t:type="label" for="pollType"/> + <select t:type="select" t:id="pollType" t:value="poll.pollType" t:validate="required"> + <option></option> + </select> + <span t:type="ck/Tooltip" title="message:help" t:value="message:pollType-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + </div> + <div> + <label t:type="label" for="voteCounting"/> + <select t:type="select" t:id="voteCounting" t:value="poll.voteCounting" t:validate="required"> + <option></option> + </select> + <span t:type="ck/Tooltip" title="${message:help}" t:value="${message:voteCounting-help}" + t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="${message:help}"/> + </span> + </div> + </fieldset> <!-- <div class="buttons"> - <input t:type="submit" value="${message:next-button}" /> - </div>--> - </div> - <!-- OPTIONS --> - <t:formfragment t:id="optionsFragment" visible="advancedOptions"> - <div id="pollForm-options" class="fleft"> - <fieldset> - <legend>${message:legend-options}</legend> - <div> - <input t:type="checkbox" t:id="anonymous" value="poll.anonymous" t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="anonymous" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymous-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - </div> - <div> - <input t:type="checkbox" t:id="anonymousVoteAllowed" value="poll.anonymousVoteAllowed" disabled="anonymousVoteAllowedDisabled" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="anonymousVoteAllowed" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymousVoteAllowed-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - </div> - <div> - <input t:type="checkbox" t:id="continuousResults" value="poll.continuousResults" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone" /> - <label t:type="label" for="continuousResults" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:continuousResults-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - </div> - <div> - <input t:type="checkbox" t:id="publicResults" value="poll.publicResults" disabled="publicResultsDisabled" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="publicResults" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:publicResults-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - </div> - <div> - <input t:type="checkbox" t:id="choiceAddAllowed" value="poll.choiceAddAllowed" - t:mixins="triggerfragment,zoneUpdater" t:fragment="choiceDateFragment" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="choiceAddAllowed" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceAddAllowed-help}" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - <br/> - <t:formFragment t:id="choiceDateFragment" t:visible="poll.choiceAddAllowed"> - <label t:type="label" for="beginChoiceDate" /> - <input t:type="ck/dateTimeField" t:id="beginChoiceDate" value="poll.beginChoiceDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="blur" t:zone="mainZone"/> - <br /> - <label t:type="label" for="endChoiceDate" /> - <input t:type="ck/dateTimeField" t:id="endChoiceDate" value="poll.endChoiceDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true" - t:mixins="zoneUpdater" t:event="change" t:clientEvent="blur" t:zone="mainZone"/> - </t:formFragment> -<!-- <span id="choiceDateDiv" style="display: none;"> - - </span>--> - </div> - <!--<t:if test="normalVoteCounting">--> - <div> - <input t:type="checkbox" t:id="choiceNb" value="hasChoiceNb" disabled="choiceNbDisabled" - t:mixins="triggerfragment,zoneUpdater" t:fragment="choiceNbFragment" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="choiceNb" class="${choiceNbLabelStyle}" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceNb-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - <br/> - <t:formFragment t:id="choiceNbFragment" t:visible="hasChoiceNb"> - <label t:type="label" for="maxChoiceNb" /> - <input t:type="textfield" t:id="maxChoiceNb" t:value="poll.maxChoiceNb" t:size="1" t:validate="min=0" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - </t:formFragment> - </div> - <!--</t:if>--> - <!--<t:if test="poll.creatorEmail">--> - <div> - <input t:type="checkbox" t:id="sendNotification" value="hasNotification" disabled="notificationDisabled" - t:mixins="triggerfragment,zoneUpdater" t:fragment="notificationFragment" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="sendNotification" class="${notificationLabelStyle}" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:sendNotification-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - <br/> - <t:formFragment t:id="notificationFragment" t:visible="hasNotification"> - <label t:type="label" for="notification" /> - <input t:type="textfield" t:id="notification" value="notification.sensibility" t:size="3" t:validate="min=0" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - ${message:notification-label2} - </t:formFragment> - </div> - <!--</t:if>--> - <!--<t:unless test="freePoll">--> - <div> - <input t:type="checkbox" t:id="sendReminder" t:value="hasReminder" disabled="reminderDisabled" - t:mixins="triggerfragment,zoneUpdater" t:fragment="reminderFragment" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="sendReminder" class="${reminderLabelStyle}" /> - <span t:type="ck/Tooltip" title="message:help" t:value="message:sendReminder-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> - </span> - <br/> - <t:formFragment t:id="reminderFragment" t:visible="hasReminder"> - <input t:type="textfield" t:id="reminder" t:value="reminder.sensibility" t:size="1" t:validate="min=0" - t:mixins="zoneUpdater" t:event="change" t:zone="mainZone"/> - <label t:type="label" for="reminder" /> - </t:formFragment> - </div> - <!--</t:unless>--> - </fieldset> - <!-- <div class="buttons"> - <t:eventLink t:event="previous" t:zone="pollCreationZone" style="text-decoration: none;"> - <input type="button" value="${message:prev-button}" /> - </t:eventLink> - <t:submit t:value="${message:next-button}" t:zone="pollCreationZone" /> - </div>--> - </div> - </t:formfragment> + <input t:type="submit" value="${message:next-button}" /> + </div>--> +</div> +<!-- OPTIONS --> +<div id="pollForm-options" class="fleft"> + <fieldset> + <legend> + <input t:type="checkbox" t:id="advancedOptions" t:mixins="triggerfragment" t:fragment="optionsFragment"/> + <label t:type="label" for="advancedOptions"/> + </legend> + <t:formFragment t:id="optionsFragment" visible="advancedOptions"> + <div> + <input t:type="checkbox" t:id="anonymous" value="poll.anonymous" /> + <label t:type="label" for="anonymous"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymous-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> </div> - </form> - </t:zone> + <div> + <input t:type="checkbox" t:id="anonymousVoteAllowed" value="poll.anonymousVoteAllowed" disabled="anonymousVoteAllowedDisabled"/> + <label t:type="label" for="anonymousVoteAllowed"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymousVoteAllowed-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + </div> + <div> + <input t:type="checkbox" t:id="continuousResults" value="poll.continuousResults"/> + <label t:type="label" for="continuousResults"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:continuousResults-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + </div> + <div> + <input t:type="checkbox" t:id="publicResults" value="poll.publicResults" disabled="publicResultsDisabled"/> + <label t:type="label" for="publicResults"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:publicResults-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + </div> + <div> + <input t:type="checkbox" t:id="choiceAddAllowed" value="poll.choiceAddAllowed" + t:mixins="triggerfragment" t:fragment="choiceDateFragment"/> + <label t:type="label" for="choiceAddAllowed"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceAddAllowed-help}" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + <br/> + <t:formFragment t:id="choiceDateFragment" t:visible="poll.choiceAddAllowed"> + <label t:type="label" for="beginChoiceDate"/> + <input t:type="ck/dateTimeField" t:id="beginChoiceDate" value="poll.beginChoiceDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> + <br/> + <label t:type="label" for="endChoiceDate"/> + <input t:type="ck/dateTimeField" t:id="endChoiceDate" value="poll.endChoiceDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> + </t:formFragment> + <!-- <span id="choiceDateDiv" style="display: none;"> + + </span>--> + </div> + <!--<t:if test="normalVoteCounting">--> + <div> + <input t:type="checkbox" t:id="choiceNb" value="hasChoiceNb" disabled="choiceNbDisabled" + t:mixins="triggerFragment" t:fragment="choiceNbFragment"/> + <label t:type="label" for="choiceNb"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceNb-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + <br/> + <t:formFragment t:id="choiceNbFragment" t:visible="hasChoiceNb"> + <label t:type="label" for="maxChoiceNb"/> + <input t:type="textfield" t:id="maxChoiceNb" t:value="poll.maxChoiceNb" t:size="1" t:validate="min=0"/> + </t:formFragment> + </div> + <!--</t:if>--> + <!--<t:if test="poll.creatorEmail">--> + <div> + <input t:type="checkbox" t:id="sendNotification" value="hasNotification" + disabled="notificationDisabled" t:mixins="triggerfragment" t:fragment="notificationFragment"/> + <label t:type="label" for="sendNotification"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:sendNotification-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + <br/> + <t:formFragment t:id="notificationFragment" t:visible="hasNotification"> + <label t:type="label" for="notification"/> + <input t:type="textfield" t:id="notification" value="notification.sensibility" t:size="3" t:validate="min=0"/> + ${message:notification-label2} + </t:formFragment> + </div> + <!--</t:if>--> + <!--<t:unless test="freePoll">--> + <div> + <input t:type="checkbox" t:id="sendReminder" t:value="hasReminder" disabled="reminderDisabled" + t:mixins="triggerfragment" t:fragment="reminderFragment"/> + <label t:type="label" for="sendReminder"/> + <span t:type="ck/Tooltip" title="message:help" t:value="message:sendReminder-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" alt="message:help"/> + </span> + <br/> + <t:formFragment t:id="reminderFragment" t:visible="hasReminder"> + <input t:type="textfield" t:id="reminder" t:value="reminder.sensibility" t:size="1" t:validate="min=0"/> + <label t:type="label" for="reminder"/> + </t:formFragment> + </div> + <!--</t:unless>--> + </t:formFragment> + </fieldset> + <!-- <div class="buttons"> + <t:eventLink t:event="previous" t:zone="pollCreationZone" style="text-decoration: none;"> + <input type="button" value="${message:prev-button}" /> + </t:eventLink> + <t:submit t:value="${message:next-button}" t:zone="pollCreationZone" /> + </div>--> +</div> + +</div> +</form> +</t:zone> </t:border>