r3000 - in trunk: pollen-business/src/main/java/org/chorem/pollen/entity pollen-business/src/main/xmi pollen-business/src/test/java/org/chorem/pollen/service pollen-ui/src/main/java/org/chorem/pollen/ui/data pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll pollen-ui/src/main/java/org/chorem/pollen/ui/services pollen-ui/src/main/resources/i18n pollen-ui/src/main/webapp/css pollen-ui/src/main/webapp/js pollen-ui/src/main/webapp/poll
Author: fdesbois Date: 2010-05-18 19:09:12 +0200 (Tue, 18 May 2010) New Revision: 3000 Url: http://chorem.org/repositories/revision/pollen/3000 Log: continue form managment with list... Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/GenericEncoder.java Removed: trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml.orig Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java trunk/pollen-business/src/main/xmi/pollen.zargo trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServicePollImplTest.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties trunk/pollen-ui/src/main/webapp/css/poll.css trunk/pollen-ui/src/main/webapp/js/pollForm.js trunk/pollen-ui/src/main/webapp/poll/PollForm.tml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -23,7 +23,16 @@ } @Override - public void addParticipant(Participant participant) throws PollenBusinessException { + public void setParticipants(Collection<Participant> participants) + throws PollenBusinessException { + setFavoriteParticipant(new ArrayList<FavoriteParticipant>()); + for (Participant participant : participants) { + addParticipant(participant); + } + } + + protected void addParticipant(Participant participant) + throws PollenBusinessException { String name = participant.getName(); String email = participant.getEmail(); @@ -36,8 +45,4 @@ favorite.setFavoriteList(this); addFavoriteParticipant(favorite); } - - @Override - public void removeParticipant(Participant participant) { - } } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -14,7 +14,7 @@ /** * Check the existence of participant from a {@code list}. The existence is - * tested on {@code name} and {@code email}. The {@code email} an be null. + * tested on {@code name} and {@code email}. The {@code email} can be null. * * @param list ParticipantList which contains a list of Participant * @param name Name of the participant to check @@ -30,7 +30,7 @@ boolean emailCheck = emailNull || (email != null && email.equals(participant.getEmail())); - if (name.equals(participant.getName()) && emailCheck) { + if (name != null && name.equals(participant.getName()) && emailCheck) { if (emailNull) { throw new PollenBusinessException( PollenBusinessException.PollenExceptionType.PARTICIPANT_EXIST_WITHOUT_EMAIL, Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -30,11 +30,20 @@ } @Override - public void addParticipant(Participant participant) throws PollenBusinessException { - if (!list) { + public void setParticipants(Collection<Participant> participants) + throws PollenBusinessException { + if (!list) { throw new UnsupportedOperationException( - "Unable to add a participant from a child account"); + "Unable to set participants from a child account"); } + setChild(new ArrayList<PollAccount>()); + for (Participant participant : participants) { + addParticipant(participant); + } + } + + protected void addParticipant(Participant participant) + throws PollenBusinessException { String name = participant.getName(); String email = participant.getEmail(); @@ -46,8 +55,4 @@ account.setWeight(participant.getWeight()); addChild(account); } - - @Override - public void removeParticipant(Participant participant) { - } } Modified: trunk/pollen-business/src/main/xmi/pollen.zargo =================================================================== (Binary files differ) Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServicePollImplTest.java =================================================================== --- trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServicePollImplTest.java 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServicePollImplTest.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -69,14 +69,16 @@ list1.setName("List1"); list1.setList(true); + Collection<Participant> participants = new ArrayList<Participant>(); Participant participant1_1 = new PollAccountImpl(); participant1_1.setName("participant1_1"); participant1_1.setEmail("email1_1@domain.org"); - list1.addParticipant(participant1_1); + participants.add(participant1_1); Participant participant1_2 = new PollAccountImpl(); participant1_2.setName("participant1_2"); - list1.addParticipant(participant1_2); + participants.add(participant1_2); + list1.setParticipants(participants); // Second list : existing list from user favorites list2 = createFavoriteList("list2", user); @@ -283,17 +285,19 @@ ParticipantList list = servicePoll.getNewPollList(); lists.add(list); + Collection<Participant> participants = new ArrayList<Participant>(); Participant participant1 = servicePoll.getNewPollParticipant(); participant1.setName("participant1"); participant1.setEmail("email1"); participant1.setWeight(1.); - list.addParticipant(participant1); + participants.add(participant1); Participant participant2 = servicePoll.getNewPollParticipant(); participant2.setName("participant2"); participant2.setEmail(null); participant2.setWeight(1.); - list.addParticipant(participant2); + participants.add(participant2); + list.setParticipants(participants); /** EXEC METHOD **/ servicePoll.createPoll(poll, lists); Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/GenericEncoder.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/GenericEncoder.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/GenericEncoder.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -0,0 +1,37 @@ +package org.chorem.pollen.ui.data; + +import org.apache.tapestry5.ValueEncoder; +import org.chorem.pollen.entity.Participant; + +import java.util.Collection; + +/** + * Created: 17 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class GenericEncoder<T> implements ValueEncoder<T> { + + protected Iterable<T> dataSource; + + public GenericEncoder(Iterable<T> dataSource) { + this.dataSource = dataSource; + } + + @Override + public String toClient(T object) { + return object == null ? null : object.toString(); + } + + @Override + public T toValue(String s) { + for (T curr : dataSource) { + if (curr.toString().equals(s)) { + return curr; + } + } + return null; + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/GenericEncoder.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL 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-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -3,7 +3,9 @@ import org.apache.commons.lang.StringUtils; import org.apache.tapestry5.Block; import org.apache.tapestry5.ComponentResources; +import org.apache.tapestry5.Field; import org.apache.tapestry5.RenderSupport; +import org.apache.tapestry5.ValueEncoder; import org.apache.tapestry5.annotations.Environmental; import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry5.annotations.IncludeStylesheet; @@ -11,6 +13,7 @@ import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.corelib.components.AjaxFormLoop; import org.apache.tapestry5.corelib.components.Form; import org.apache.tapestry5.corelib.components.Zone; import org.apache.tapestry5.ioc.Messages; @@ -29,12 +32,22 @@ import org.chorem.pollen.ui.base.AbstractPollenPage; import org.chorem.pollen.ui.components.Border; import org.chorem.pollen.ui.data.AddressBar; +import org.chorem.pollen.ui.data.GenericEncoder; +import org.chorem.pollen.ui.data.ParticipantsListener; +import org.chorem.pollen.ui.services.PollenManager; +import org.nuiton.web.tapestry5.components.FeedBack; import org.slf4j.Logger; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Collection; import java.util.Date; import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** @@ -73,6 +86,9 @@ @InjectComponent private Zone mainZone; + @Inject + private Logger logger; + @Override public Border getBorder() { return border; @@ -87,6 +103,9 @@ @Inject private ServicePoll servicePoll; + @Inject + private PollenManager manager; + private String pollUID; @Persist @@ -113,7 +132,7 @@ * @return poll existing or a new one * @throws PollenBusinessException */ - public Poll getPoll() throws PollenBusinessException { + public Poll getPoll() { if (poll == null) { if (StringUtils.isNotEmpty(pollUID)) { if (log.isDebugEnabled()) { @@ -137,8 +156,8 @@ * @return true if it's the create mode, false otherwise * @throws PollenBusinessException */ - public boolean isCreateMode() throws PollenBusinessException { - return StringUtils.isEmpty(getPoll().getTopiaId()); + public boolean isCreateMode() { + return StringUtils.isEmpty(getPoll().getId()); } /** @@ -147,7 +166,7 @@ * @return the page title depends on create or update mode. * @throws PollenBusinessException */ - public String getPageTitle() throws PollenBusinessException { + public String getPageTitle() { String title = ""; if (isCreateMode()) { title = messages.get("pageTitle-create"); @@ -163,7 +182,7 @@ * @return the address bar. * @throws PollenBusinessException */ - public AddressBar getAddressBar() throws PollenBusinessException { + public AddressBar getAddressBar() { return AddressBar.newBar().appendCurrent(getPageTitle()); } @@ -325,7 +344,7 @@ hasReminder = false; } - public boolean isChoiceNbDisabled() throws PollenBusinessException { + public boolean isChoiceNbDisabled() { // voteCounting not set to NORMAL return !getPoll().getVoteCountingType().isNormal(); } @@ -386,22 +405,30 @@ * @return true if the poll has a FREE pollType * @throws PollenBusinessException */ - public boolean isReminderDisabled() throws PollenBusinessException { + public boolean isReminderDisabled() { // pollType is FREE return getPoll().getPollType().isFree(); } - /** *********************** LISTS **************************************** */ + /** *********************** LISTS *****************************************/ @Persist - private Map<String, ParticipantList> lists; // for GROUP + private Map<String, ParticipantList> lists; @Property private ParticipantList list; +// @Persist +// private String listSelectedName; + @Persist - private Map<String, Participant> participants; // for RESTRICTED + private ParticipantList listSelected; + private Map<String, Participant> selectedParticipants; + + @Property + private Participant participant; + @InjectComponent private Zone listsZone; @@ -412,70 +439,286 @@ private ComponentResources resources; @Property - private boolean flag; + private boolean formActivate; -// @Inject -// private Block listsForm; -// -// @Inject -// @Property -// private Block listsFields; + @InjectComponent + private FeedBack listsFeedback; + private ParticipantsListener listSelectedListener; + public Map<String, ParticipantList> getLists() { if (lists == null) { - lists = new HashMap<String, ParticipantList>(); + lists = new LinkedHashMap<String, ParticipantList>(); + if (getPoll().getPollType().isRestricted()) { + lists.put("LIST", servicePoll.getNewPollList()); + } } return lists; } - public Map<String, Participant> getParticipants() { - if (participants == null) { - participants = new HashMap<String, Participant>(); + @Log + Object onChangeFromPollType(String value) { + PollType type = PollType.valueOf(value); + getPoll().setPollType(type); + if (type.isRestrictedOrGroup()) { + listsFeedback.addInfo("Edition en cours d'une liste restreinte. " + + "Attention un changement de type de restriction provoquera" + + " une remise à zéro de la/les liste(s) en cours d'édition."); } - return participants; + // Clean persist data for lists : careful, will reset unsaved data + lists = null; + listSelected = null; + return refreshListZone(); } @Log - public boolean canDisplayLists() throws PollenBusinessException { + public boolean canDisplayLists() { return getPoll().getPollType().isRestrictedOrGroup(); } + public ParticipantList getListSelected() { + if (listSelected == null && getPoll().getPollType().isRestricted()) { + listSelected = getLists().get("LIST"); +// if (listSelected == null) { +// listSelected = servicePoll.getNewPollList(); +// getLists().put("LIST", listSelected); +// if (log.isDebugEnabled()) { +// log.debug("Instantiate list for restricted poll"); +// } +// } + } +// else if (StringUtils.isNotEmpty(listSelectedName)) { +// listSelected = getLists().get(listSelectedName); +// } + if (log.isDebugEnabled() && listSelected != null) { + log.debug("List selected : " + listSelected.getName()); + } + return listSelected; + } + + public String getStyleSelected() { + return isCurrentListSelected() ? " selected" : ""; + } + + public boolean isCurrentListSelected() { + return listSelected != null && + list.getName().equals(listSelected.getName()); + } + @Log - Object onChangeFromPollType(String value) throws PollenBusinessException { - getPoll().setPollType(PollType.valueOf(value)); - flag = false; - return listsZone.getBody(); + void onSelectedFromAddList() { + formActivate = true; + if (StringUtils.isNotEmpty(listName) && + !getLists().containsKey(listName)) { + if (log.isDebugEnabled()) { + log.debug("Add list : " + listName); + } + ParticipantList list = servicePoll.getNewPollList(); + list.setName(listName); + getLists().put(listName, list); + listSelected = list; + } else { + if (log.isDebugEnabled()) { + log.debug("Refuse adding list : " + listName); + } +// listSelected = null; +// listsFeedback.addError("Impossible d'ajouter une liste avec un nom vide"); + } + // Reset form field before refresh form + listName = null; + if (log.isDebugEnabled() && listSelected != null) { + log.debug("Selected list : " + listSelected.getName()); + } } + @Log + void onSelectedFromEditList(String listName) { + formActivate = true; + listSelected = getLists().get(listName); + if (log.isDebugEnabled() && listSelected != null) { + log.debug("List selected : " + listSelected.getName()); + } + } + + public Map<String, Participant> getSelectedParticipants() { + if (selectedParticipants == null) { + if (log.isDebugEnabled() && listSelected != null) { + log.debug("Retrieve participants from list"); + } + selectedParticipants = new LinkedHashMap<String, Participant>(); + for (Participant participant : listSelected.getParticipants()) { + String id = manager.createPollenUrlId(); + selectedParticipants.put(id, participant); + } + } + return selectedParticipants; + } + + @Log + Object onActionFromRemoveList() { + if (log.isDebugEnabled()) { + log.debug("Remove list : " + listSelected.getName()); + } + getLists().remove(listSelected.getName()); + if (log.isDebugEnabled()) { + for (ParticipantList list : getLists().values()) { + log.debug("Existing lists : " + list.getName()); + } + } + listSelected = null; + return refreshListZone(); + } + + @Log + void onSelectedFromSaveList(String listName) { + try { + listSelected.setParticipants(selectedParticipants.values()); + } catch (PollenBusinessException eee) { + String message = manager.getErrorMessage(eee, messages, logger); + listsFeedback.addError(message); + } + } + // @Log -// public Block getListsBlock() throws PollenBusinessException { -// if (canDisplayLists()) { -// if (flag) { -// return listsFields; +// void onSelectedFromRemoveList(String listName) { +// if (formActivate) { +// if (log.isWarnEnabled()) { +// log.warn("Strange submit behavior... Escape remove."); // } -// return listsForm; +// return; // } -// return null; +// formActivate = true; +// if (log.isDebugEnabled()) { +// log.debug("Remove list : " + listName); +// } +// getLists().remove(listName); +// if (log.isDebugEnabled()) { +// for (ParticipantList list : getLists().values()) { +// log.debug("Existing lists : " + list.getName()); +// } +// } +// if (listSelected != null && listSelected.getName().equals(listName)) { +// listSelected = null; +// } // } - @Log - void onSelectedFromAddList() { - flag = true; - addList(listName); + public ValueEncoder<ParticipantList> getListEncoder() { + final Collection<ParticipantList> lists = getLists().values(); + ValueEncoder<ParticipantList> encoder = + new ValueEncoder<ParticipantList>() { + + @Override + public String toClient(ParticipantList participant) { + return participant.getName(); + } + + @Override + public ParticipantList toValue(String s) { + for (ParticipantList curr : lists) { + if (s.equals(curr.getName())) { + return curr; + } + } + return null; + } + }; + return encoder; } - protected void addList(String name) { - if (!getLists().containsKey(name)) { - ParticipantList list = new PollAccountImpl(); - list.setName(name); - getLists().put(name, list); - } + Object onAddRowFromParticipants() { + Participant newParticipant = servicePoll.getNewPollParticipant(); + //selectedParticipants.add(newParticipant); +// try { +// listSelected.addParticipant(newParticipant); +// } catch (PollenBusinessException eee) { +// String message = manager.getErrorMessage(eee, messages, logger); +// listsFeedback.addError(message); +// } + return newParticipant; } + void onRemoveRowFromParticipants(Participant participant) { +// if (log.isDebugEnabled()) { +// for (Participant p : listSelected.getParticipants()) { +// log.debug("Before Existing participants : " + +// p.getName() + "_" + p.getEmail()); +// } +// } +//// boolean isRemoved = +//// listSelected.getParticipants().remove(participant); +//// listSelected.removeParticipant(participant); +// if (log.isDebugEnabled()) { +// log.debug("Participant removed : " + participant.getName()); +// } +// if (log.isDebugEnabled()) { +// for (Participant p : listSelected.getParticipants()) { +// log.debug("Existing participants : " + +// p.getName() + "_" + p.getEmail()); +// } +// } + } + + public ValueEncoder<Participant> getParticipantEncoder() { + ValueEncoder<Participant> encoder = new ValueEncoder<Participant>() { + + @Override + public String toClient(Participant participant) { +// String key = getParticipantKey(participant); + if (log.isDebugEnabled()) { + log.debug("Participant to find : " + participant); + } + for (Map.Entry<String, Participant> entry : + getSelectedParticipants().entrySet()) { + if (logger.isDebugEnabled()) { + logger.debug("Selected participant entry : " + + "key = " + entry.getKey() + " -> " + + "value = " + entry.getValue()); + } + if (entry.getValue() == participant) { + if (logger.isDebugEnabled()) { + logger.debug("toClient : key = " + entry.getKey()); + } + return entry.getKey(); + } + } + return null; + } + + @Override + public Participant toValue(String s) { +// for (Participant curr : getSelectedParticipants()) { +// String key = getParticipantKey(curr); +// if (s.equals(key)) { +// if (logger.isDebugEnabled()) { +// logger.debug("toValue from : " + s); +// } +// return curr; +// } +// } + Participant participant = getSelectedParticipants().get(s); + if (logger.isDebugEnabled()) { + logger.debug("toValue : key = " + s + " -> " + participant); + } + return participant; + } + }; + return encoder; + } + + protected Object refreshListZone() { + formActivate = false; + return listsZone.getBody(); + } + @Log - Object onSuccess() throws PollenBusinessException { + Object onSuccess() { return mainZone; } + // TODO-FD2010-05-18 : Put this in ParticipantHelper in business + public String getParticipantKey(Participant participant) { + return participant.getName() + "_" + participant.getEmail(); + } + } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-05-18 17:09:12 UTC (rev 3000) @@ -122,6 +122,10 @@ return context.getCurrentDate(); } + public String createPollenUrlId() { + return context.createPollenUrlId(); + } + public String getErrorMessage(PollenBusinessException eee, Messages messages, Logger logger) { if (logger.isDebugEnabled()) { Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties =================================================================== --- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-18 17:09:12 UTC (rev 3000) @@ -3,53 +3,58 @@ pollen.page.UserLists.title=Vos listes de votants ############################ EMAIL ############################################# -pollen.email.userRegister.subject=[Pollen] Confirmation de cr\u00E9ation du compte %s -pollen.email.userRegister.content=Bienvenue %1$s. Vous venez de cr\u00E9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %2$s\nMot de passe : %3$s\n\nVous pouvez d\u00E8s maintenant g\u00E9rer vos sondages en vous identifiant sur le site : \n%4$s +pollen.email.userRegister.subject=[Pollen] Confirmation de cr\u00e9ation du compte %s +pollen.email.userRegister.content=Bienvenue %1$s. Vous venez de cr\u00e9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %2$s\nMot de passe : %3$s\n\nVous pouvez d\u00e8s maintenant g\u00e9rer vos sondages en vous identifiant sur le site : \n%4$s ############################ GLOBAL ############################################ pollen.ui.tooltip.help=Aide pollen.ui.button.add=Ajouter -pollen.ui.button.create=Cr\u00E9er +pollen.ui.button.create=Cr\u00e9er pollen.ui.button.ok=Ok ############################ USER ############################################## -pollen.ui.user.register.autoConnection=Vous \u00EAtes maintenant connect\u00E9 avec l'identifiant %1$s. -pollen.ui.user.register.sendEmail=Un email vous a \u00E9t\u00E9 envoy\u00E9 \u00E0 l'adresse %1$s. +pollen.ui.user.register.autoConnection=Vous \u00eates maintenant connect\u00e9 avec l'identifiant %1$s. +pollen.ui.user.register.sendEmail=Un email vous a \u00e9t\u00e9 envoy\u00e9 \u00e0 l'adresse %1$s. pollen.ui.user.validate.passwords=Les deux mots de passe ne correspondent pas. -pollen.ui.user.update.success=Modification enregistr\u00E9e avec succ\u00E8s. -pollen.ui.user.display.notConnected=Vous devez vous connecter pour acc\u00E9der \u00E0 la page %1$s. -pollen.ui.user.display.notAllowed=Vous n'avez pas les droits n\u00E9cessaires pour acc\u00E9der \u00E0 la page %1$s. -pollen.ui.user.create.title=Cr\u00E9er un nouvel utilisateur -pollen.ui.user.create.passwordGenerated=Le mot de passe du nouvel utilisateur a \u00E9t\u00E9 g\u00E9n\u00E9r\u00E9. -pollen.ui.user.create.passwordSameAsLogin=Le mot de passe du nouvel utilisateur est le m\u00EAme que son identifiant. -pollen.ui.user.create.passwordHelp=Si vous pr\u00E9cisez un email, un mot de passe sera g\u00E9n\u00E9r\u00E9 et envoy\u00E9 \u00E0 l'utilisateur. Sinon le mot de passe sera identique au login. -pollen.ui.user.create.sendEmail=Un email a \u00E9t\u00E9 envoy\u00E9 au nouvel utilisateur %1$s \u00E0 l'adresse %2$s. -pollen.ui.user.create.emailFailedShowPassword=Le mot de passe g\u00E9n\u00E9r\u00E9 est le suivant : %1$s -pollen.ui.user.create.success=L'utilisateur %1$s a \u00E9t\u00E9 cr\u00E9\u00E9 avec succ\u00E8s. +pollen.ui.user.update.success=Modification enregistr\u00e9e avec succ\u00e8s. +pollen.ui.user.display.notConnected=Vous devez vous connecter pour acc\u00e9der \u00e0 la page %1$s. +pollen.ui.user.display.notAllowed=Vous n'avez pas les droits n\u00e9cessaires pour acc\u00e9der \u00e0 la page %1$s. +pollen.ui.user.create.title=Cr\u00e9er un nouvel utilisateur +pollen.ui.user.create.passwordGenerated=Le mot de passe du nouvel utilisateur a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9. +pollen.ui.user.create.passwordSameAsLogin=Le mot de passe du nouvel utilisateur est le m\u00eame que son identifiant. +pollen.ui.user.create.passwordHelp=Si vous pr\u00e9cisez un email, un mot de passe sera g\u00e9n\u00e9r\u00e9 et envoy\u00e9 \u00e0 l'utilisateur. Sinon le mot de passe sera identique au login. +pollen.ui.user.create.sendEmail=Un email a \u00e9t\u00e9 envoy\u00e9 au nouvel utilisateur %1$s \u00e0 l'adresse %2$s. +pollen.ui.user.create.emailFailedShowPassword=Le mot de passe g\u00e9n\u00e9r\u00e9 est le suivant : %1$s +pollen.ui.user.create.success=L'utilisateur %1$s a \u00e9t\u00e9 cr\u00e9\u00e9 avec succ\u00e8s. pollen.ui.user.nbUsers=%1$d utilisateurs existants pollen.ui.user.update.edit=Modifier cet utilisateur pollen.ui.user.update.save=Enregistrer les modifications pollen.ui.user.update.cancel=Annuler les changements pollen.ui.user.delete=Supprimer cet utilisateur -pollen.ui.user.delete.confirmMessage=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer cet utilisateur ? -pollen.ui.list.create.title=Cr\u00E9er une nouvelle liste -pollen.ui.list.create.success=La liste %1$s a \u00E9t\u00E9 cr\u00E9\u00E9e avec succ\u00E8s. -pollen.ui.list.create.weightHelp=Ce chiffre correspond au poids du vote de la personne, c'est \u00E0 dire le nombre de voix que poss\u00E8de la personne dans le sondage. +pollen.ui.user.delete.confirmMessage=Etes-vous s\u00fbr de vouloir d\u00e9finitivement supprimer cet utilisateur ? +############################ USER ############################################## +pollen.ui.list.create.title=Cr\u00e9er une nouvelle liste +pollen.ui.list.create.success=La liste %1$s a \u00e9t\u00e9 cr\u00e9\u00e9e avec succ\u00e8s. +pollen.ui.list.create.weightHelp=Ce chiffre correspond au poids du vote de la personne, c'est \u00e0 dire le nombre de voix que poss\u00e8de la personne dans le sondage. pollen.ui.list.delete=Supprimer la liste %1$s -pollen.ui.list.delete.confirmMessage=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer cette liste et l'int\u00E9gralit\u00E9 de ses votants ? -pollen.ui.list.delete.success=La liste et son contenu ont \u00E9t\u00E9 supprim\u00E9 avec succ\u00E8s. -pollen.ui.list.notSelected=Aucune liste s\u00E9lectionn\u00E9e +pollen.ui.list.delete.confirmMessage=Etes-vous s\u00fbr de vouloir d\u00e9finitivement supprimer cette liste et l'int\u00e9gralit\u00e9 de ses votants ? +pollen.ui.list.delete.success=La liste et son contenu ont \u00e9t\u00e9 supprim\u00e9 avec succ\u00e8s. +pollen.ui.list.notSelected=Aucune liste s\u00e9lectionn\u00e9e pollen.ui.list.emptyList=Liste vide. Ajoutez des votants en saisissant leur nom et email. pollen.ui.list.nbParticipants=%1$d votants contenus dans cette liste -pollen.ui.list.update.addParticipant=Ajouter un nouveau votant \u00E0 la liste -pollen.ui.list.update.addParticipant.success=Le votant %1$s a \u00E9t\u00E9 ajout\u00E9 \u00E0 la liste. +pollen.ui.list.update.addParticipant=Ajouter un nouveau votant \u00e0 la liste +pollen.ui.list.update.addParticipant.success=Le votant %1$s a \u00e9t\u00e9 ajout\u00e9 \u00e0 la liste. pollen.ui.list.update.cancelEdition=Annuler les changements pollen.ui.list.update.saveParticipant=Enregistrer les modifications -pollen.ui.list.update.saveParticipant.success=Modification enregistr\u00E9e avec succ\u00E8s. +pollen.ui.list.update.saveParticipant.success=Modification enregistr\u00e9e avec succ\u00e8s. pollen.ui.list.update.updateParticipant=Modifier ce votant pollen.ui.list.update.removeParticipant=Supprimer ce votant -pollen.ui.list.update.removeParticipant.confirmMessage=Etes-vous s\u00FBr de vouloir supprimer %1$s de la liste ? -pollen.ui.list.update.removeParticipant.success=Le votant a \u00E9t\u00E9 supprim\u00E9 avec succ\u00E8s. +pollen.ui.list.update.removeParticipant.confirmMessage=Etes-vous s\u00fbr de vouloir supprimer %1$s de la liste ? +pollen.ui.list.update.removeParticipant.success=Le votant a \u00e9t\u00e9 supprim\u00e9 avec succ\u00e8s. +pollen.ui.participant.name-label=Nom +pollen.ui.participant.email-label=Email +pollen.ui.participant.weight-label=Poids +pollen.ui.participant.add=Nouveau participant # OLD LOGIN_COMPONENT connectionLegend=Connexion @@ -61,7 +66,7 @@ loginFailed=Mauvais identifiant ou mot de passe. # FORM:: user -firstName-label=Pr\u00E9nom +firstName-label=Pr\u00e9nom lastName-label=Nom login-label=Identifiant email-label=Email @@ -77,14 +82,14 @@ editEmail-regexp-message=Adresse email invalide. ############################ CHOICE ############################################ -pollen.ui.choice.delete.confirm=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer ce choix ? +pollen.ui.choice.delete.confirm=Etes-vous s\u00fbr de vouloir d\u00e9finitivement supprimer ce choix ? pollen.ui.choice.delete.title=Supprimer ce choix -pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00E9 au sondage +pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00e9 au sondage pollen.ui.vote.noPager=%1$d votes existants pollen.ui.choice.datePattern=dd/MM/yyyy HH:mm pollen.ui.choice.add.title=Ajout d'un choix pollen.ui.choice.add.submit=Ajouter -pollen.ui.error.upload=Une erreur s'est produite lors du transfert des fichiers. La taille maximale autoris\u00E9e est de %1$s par fichier et %2$s au total. +pollen.ui.error.upload=Une erreur s'est produite lors du transfert des fichiers. La taille maximale autoris\u00e9e est de %1$s par fichier et %2$s au total. # Tapestry messages for VoteForPoll.tml # FORM:: addChoice @@ -93,42 +98,42 @@ addChoice-choiceText-required-message=Vous devez saisir un choix. choiceDate-label=Date et heure addChoice-choiceDate-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? -addChoice-choiceDate-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59. +addChoice-choiceDate-regexp-message=La date de d\u00e9but doit-\u00eatre au format 31/12/2000 23:59. addChoice-choiceDate-required-message=Vous devez saisir un choix. choiceImage-label=Image addChoice-choiceImage-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ -addChoice-choiceImage-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG. +addChoice-choiceImage-regexp-message=L'image doit-\u00eatre au format JPG, GIF ou PNG. addChoice-choiceImage-required-message=Vous devez saisir un choix. # Poll creation emails -#creatorEmail_subject=[Pollen] Cr\u00E9ation d'un sondage (%s) -#creatorEmail_msg=Vous venez de cr\u00E9er le sondage "%s".\nVous pouvez y acc\u00E9der en suivant les liens ci-dessous.\n\nPage de vote : \n%s\nPage de modification : \n%s +#creatorEmail_subject=[Pollen] Cr\u00e9ation d'un sondage (%s) +#creatorEmail_msg=Vous venez de cr\u00e9er le sondage "%s".\nVous pouvez y acc\u00e9der en suivant les liens ci-dessous.\n\nPage de vote : \n%s\nPage de modification : \n%s #votingEmail_subject=[Pollen] Invitation au vote (%s) -#votingEmail_msg=Un nouveau sondage a \u00E9t\u00E9 cr\u00E9\u00E9 : "%s".\nVous pouvez y participer avec l'identifiant %s \u00E0 l'adresse suivante : \n%s +#votingEmail_msg=Un nouveau sondage a \u00e9t\u00e9 cr\u00e9\u00e9 : "%s".\nVous pouvez y participer avec l'identifiant %s \u00e0 l'adresse suivante : \n%s # Notification emails #voteEmail_subject=[Pollen] Notification de vote (%s) -#voteEmail_msg=Un vote vient d'\u00EAtre enregistr\u00E9 pour le sondage "%s". Ce sondage compte d\u00E9sormais %d votes.\nVous pouvez acc\u00E9der \u00E0 ce sondage en suivant les liens ci-dessous.\n\nPage de vote : \n%s\nPage de modification : \n%s +#voteEmail_msg=Un vote vient d'\u00eatre enregistr\u00e9 pour le sondage "%s". Ce sondage compte d\u00e9sormais %d votes.\nVous pouvez acc\u00e9der \u00e0 ce sondage en suivant les liens ci-dessous.\n\nPage de vote : \n%s\nPage de modification : \n%s # Reminder emails #reminderEmail_subject=[Pollen] Rappel (%s) -#reminderEmail_msg=Vous n'avez pas encore vot\u00E9 pour le sondage "%s".\nVous pouvez encore y participer avec l'identifiant %s \u00E0 l'adresse suivante : \n%s +#reminderEmail_msg=Vous n'avez pas encore vot\u00e9 pour le sondage "%s".\nVous pouvez encore y participer avec l'identifiant %s \u00e0 l'adresse suivante : \n%s # Poll feed #pollFeed_title=Pollen : %s #pollFeed_desc=%s -#pollFeed_createTitle=Sondage cr\u00E9\u00E9 par %s +#pollFeed_createTitle=Sondage cr\u00e9\u00e9 par %s #pollFeed_createContent= #pollFeed_voteTitle=Nouveau vote de %s -#pollFeed_voteContent=\u00C9tat du sondage : %s +#pollFeed_voteContent=\u00c9tat du sondage : %s #pollFeed_choiceTitle=Nouveau choix : %s #pollFeed_choiceContent=%s #pollFeed_commentTitle=Nouveau commentaire de %s #pollFeed_commentContent=%s # Actions -#create=Cr\u00E9er +#create=Cr\u00e9er #edit=Modifier #delete=Supprimer #add=Ajouter Modified: trunk/pollen-ui/src/main/webapp/css/poll.css =================================================================== --- trunk/pollen-ui/src/main/webapp/css/poll.css 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/webapp/css/poll.css 2010-05-18 17:09:12 UTC (rev 3000) @@ -70,3 +70,108 @@ float: left; } +/* FOR LISTS */ +TABLE.t-data-grid { + width: 500px; + margin: auto; +} + +TABLE.t-data-grid THEAD TR { + background-color: #98dae4; + color: #727A7E; +} + +INPUT.list-edition { + border: 0; + background-color: transparent; + cursor: pointer; +} + +INPUT.selected { + color: #32B5C9; + font-weight: bold; + font-size: 1.2em; +} + +/*DIV.t-data-grid { + font-family: Arial, Helvetica, sans-serif; + margin-top:20px; + margin-bottom:20px; +} + +DIV.t-data-grid-pager { + margin: 8px 0px; +} + +DIV.t-data-grid-pager A, DIV.t-data-grid-pager SPAN.current { + text-decoration: none; + padding: 2px 5px; + font-size: 14px; + margin-right: 5px; +} + +DIV.t-data-grid-pager A { + background-color: #fc0; + border: 1px solid #aab; + color: #fff; +} + +DIV.t-data-grid-pager A:hover { + border: 1px solid #000; + color: #000; +} + +DIV.t-data-grid-pager SPAN.current { + color: #fff; + border: 1px solid #fc0; + background-color: #000; +} + +TABLE.t-data-grid { + border-collapse: collapse; + border-left: 1px solid #aab; + border-top: 1px solid #aab; + background-color: #fff; + font-size: 14px; + margin: auto; + text-align: center; +} + +TABLE.t-data-grid THEAD { + border-top: 1px solid #aab; / For Firefox / +} + +TABLE.t-data-grid THEAD TR { + color: #fff; + background-color: #fc0; +} + +TABLE.t-data-grid THEAD TR a { + color: #fff; + background-color: #fc0; +} + +TABLE.t-data-grid THEAD TR TH { + text-align: left; + padding: 2px 3px; + white-space: nowrap; + border-right: 1px solid #aab; + border-bottom: 1px solid #aab; + background-color:#fc0; +} + +TABLE.t-data-grid TBODY TR { + background-color: #fff; +} + +TABLE.t-data-grid TBODY TR.odd { + background-color: #ffb; +} + +TABLE.t-data-grid TBODY TR TD { + border-right: 1px solid #aab; + border-bottom: 1px solid #aab; + padding: 2px 5px; +} +*/ + Modified: trunk/pollen-ui/src/main/webapp/js/pollForm.js =================================================================== --- trunk/pollen-ui/src/main/webapp/js/pollForm.js 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/webapp/js/pollForm.js 2010-05-18 17:09:12 UTC (rev 3000) @@ -37,6 +37,8 @@ this.contextPath = contextPath; +// this.form.observe('submit', this.disableEnterSubmit.bindAsEventListener(this)); + // this.contextBlockVisible = ['true', 'false']; // this.contextBlockId = ['mainInfos', 'options']; // @@ -99,6 +101,13 @@ // } // }, +// disableEnterSubmit: function(event) { +// if (event.keyCode != Event.KEY_RETURN) { +// Tapestry.debug('disable enter'); +// event.stop(); +// } +// }, + /* * Action when voteCounting select change. This change affects choiceNb * checkbox : choiceNb is only available if voteCounting is 'NORMAL'. Deleted: trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml.orig =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml.orig 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml.orig 2010-05-18 17:09:12 UTC (rev 3000) @@ -1,301 +0,0 @@ - -<t:border t:address="address" t:pageLogo="literal:Creation" - xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> - - <t:feedback t:id="feedback"/> - <h1 class="titleCreation">${message:title-new}</h1> - <t:zone t:id="pollCreationZone" show="show" update="show"> - <t:form t:id="pollCreationForm" t:zone="pollCreationZone"> - - <!-- Étape POLL --> - <t:formfragment visible="inPoll"> - <div id="pollCreationFormDiv"> - <t:errors/> - <fieldset> - <legend>${stepLegend}</legend> - <div> - <t:label for="votingId" /> - <t:textfield t:id="votingId" t:value="poll.creatorName" t:validate="required,minlength=2"/> - </div> - <div> - <t:label for="email" /> - <t:textfield t:id="email" t:value="poll.creatorEmail" t:validate="regexp" /> - </div> - <br /> - <div> - <t:label for="title" /> - <t:textfield t:id="title" t:value="poll.title" t:validate="required" /> - </div> - <div> - <t:label for="description" /> - <t:textarea cols="23" t:id="description" t:value="poll.description"/> - </div> - <div> - <t:label for="beginDate" /> - <input t:type="ck/dateTimeField" t:id="beginDate" value="poll.beginDate" t:validate="regexp" - t:datePattern="${message:DTF-pattern}" t:timePicker="true" t:timePickerAdjacent="true"/> - </div> - <div> - <t:label for="endDate" /> - <input t:type="ck/dateTimeField" t:id="endDate" value="poll.endDate" t:validate="regexp" - t:datePattern="${message:DTF-pattern}" t:timePicker="true" t:timePickerAdjacent="true"/> - </div> - <div> - <t:label for="pollType" /> - <t:select t:id="pollType" t:value="poll.pollType" t:validate="required"></t:select> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:pollType-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <t:label for="voteCounting" /> - <t:select t:id="voteCounting" t:value="poll.voteCounting" t:validate="required"></t:select> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:voteCounting-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - </fieldset> - <div class="buttons"> - <t:submit t:value="${message:next-button}" t:zone="pollCreationZone" /> - </div> - </div> - </t:formfragment> - - <!-- Étape OPTIONS --> - <t:formfragment visible="inOptions"> - <div id="optionsCreationFormDiv"> - <t:errors/> - <FieldSet> - <legend>${stepLegend}</legend> - <div> - <t:checkbox t:id="anonymous" t:value="poll.anonymous" onChange="cbDisable(this, this.form.anonymousVoteAllowed)" /> - <t:label for="anonymous" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:anonymous-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <t:checkbox t:id="anonymousVoteAllowed" t:value="poll.anonymousVoteAllowed" /> - <t:label for="anonymousVoteAllowed" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:anonymousVoteAllowed-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <t:checkbox t:id="continuousResults" t:value="poll.continuousResults" onChange="cbDisable(this, this.form.publicResults)" /> - <t:label for="continuousResults" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:continuousResults-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <t:checkbox t:id="publicResults" t:value="poll.publicResults" /> - <t:label for="publicResults" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:publicResults-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - <div> - <t:checkbox t:id="addChoiceAllowed" t:value="poll.choiceAddAllowed" onChange="$('choiceDateDiv').toggle()" /> - <t:label for="addChoiceAllowed" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:addChoiceAllowed-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - <br/> - <span id="choiceDateDiv" style="${choiceDateDisplay}"> - <t:label for="beginChoiceDate" /> - <input t:type="ck/dateTimeField" t:id="beginChoiceDate" value="poll.beginChoiceDate" t:validate="regexp" - t:datePattern="${message:DTF-pattern}" t:timePicker="true" t:timePickerAdjacent="true"/> - <br /> - <t:label for="endChoiceDate" /> - <input t:type="ck/dateTimeField" t:id="endChoiceDate" value="poll.endChoiceDate" t:validate="regexp" - t:datePattern="${message:DTF-pattern}" t:timePicker="true" t:timePickerAdjacent="true"/> - </span> - </div> - <t:if test="normalVoteCounting"> - <div> - <t:checkbox t:id="choiceNb" value="choiceNbCheckBox" onChange="$('choiceNbDiv').toggle()"/> - <t:label for="choiceNb" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:choiceNb-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - <br/> - <span id="choiceNbDiv" style="${choiceNbDisplay}"> - <t:label for="maxChoiceNb" /> - <t:TextField t:id="maxChoiceNb" t:value="poll.maxChoiceNb" t:size="1" t:validate="min=0"/> - </span> - </div> - </t:if> - <t:if test="poll.creatorEmail"> - <div> - <t:checkbox t:id="sendNotification" t:value="notificationCheckBox" onChange="$('notificationDiv').toggle()"/> - <t:label for="sendNotification" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:sendNotification-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - <br/> - <span id="notificationDiv" style="${notificationDisplay}"> - <t:label for="notification" /> - <t:TextField t:id="notification" t:value="notificationPreventRule.sensibility" t:size="3" t:validate="min=0"/> - ${message:notification-label2} - </span> - </div> - </t:if> - <t:unless test="freePoll"> - <div> - <t:checkbox t:id="sendReminder" t:value="reminderCheckBox" onChange="$('reminderDiv').toggle()"/> - <t:label for="sendReminder" /> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:sendReminder-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - <br/> - <span id="reminderDiv" style="${reminderDisplay}"> - <t:TextField t:id="reminder" t:value="reminderPreventRule.sensibility" t:size="1" t:validate="min=0"/> - <t:label for="reminder" /> - </span> - </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> - - <!-- Étape LISTS --> - <t:formfragment visible="inLists"> - <div id="listsCreationFormDiv"> - <t:if test="personListsExists"> - <div> - <t:label for="listSelect" />: - <t:select t:id="listSelect" t:model="personLists" t:encoder="personLists" t:value="personList" - t:mixins="ck/onEvent" t:event="change" t:onCompleteCallback="literal:onCompleteZoneUpdate"></t:select> - <span t:type="ck/Tooltip" title="${message:help}" value="${message:listSelect-help}" effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> - </span> - </div> - </t:if> - <t:errors/> - <fieldset> - <legend>${stepLegend}</legend> - <div t:type="loop" t:source="votingLists" t:value="votingList" t:volatile="true" class="${currentListClass}"> - <div t:type="if" test="groupPoll" class="groupTitleDiv"> - <t:if test="severalGroups"> - <span class="cmd"> - <t:submit t:id="editGroup" t:value="${message:edit}" t:context="${votingListIndex}" t:defer="false" t:class="editGroupSubmit"/> - <t:submit t:id="deleteGroup" t:value="${message:delete}" t:context="${votingListIndex}" t:defer="false" t:class="deleteGroupSubmit"/> - </span> - </t:if> - ${message:group-label} ${votingListNumber} >> - <t:label for="groupName" /> - <t:textfield t:id="groupName" t:value="votingList.name" validate="required" /> - - - <t:label for="groupWeight" /> - <t:textfield t:id="groupWeight" t:value="votingList.weight" t:size="1" validate="required,min=1" /> - </div> - <div t:type="loop" t:source="votingList.pollAccountDTOs" t:value="votingListPerson" t:volatile="true"> - <t:label for="personName" /> - <t:textfield t:id="personName" t:value="votingListPerson.votingId" /> - - - <t:label for="personEmail" /> - <t:textfield t:id="personEmail" t:value="votingListPerson.email" validate="regexp" /> - - - <t:label for="personWeight" /> - <t:textfield t:id="personWeight" t:value="votingListPerson.weight" t:size="1" validate="required,min=1" /> - </div> - <t:submit t:id="addPerson" t:value="${message:addPerson}" t:context="${votingListIndex}" t:defer="false"/> - </div> - </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:if test="groupPoll"> - <t:submit t:id="addGroup" t:value="${message:addGroup}" /> - </t:if> - <t:submit t:value="${message:next-button}" t:zone="pollCreationZone" /> - </div> - </div> - </t:formfragment> - - </t:form> - - - <!-- Étape CHOICES - Formulaire différent car t:upload ne fonctionne pas en ajax --> - <t:if test="inChoices"> - <t:FeedContextLink t:id="feedContext" /> - <t:form t:id="choicesCreationForm"> - <div id="choicesCreationFormDiv"> - <t:unless test="numberVoteCounting"> - <div> - <t:label for="choiceType" />: - <t:select t:id="choiceType" t:value="poll.choiceType" t:validate="required" - t:mixins="ck/OnEvent" event="change" onCompleteCallback="onCompleteZoneUpdate"> - </t:select> - </div> - </t:unless> - <t:errors/> - <fieldset> - <legend>${stepLegend}</legend> - <t:formfragment t:id="textChoiceFragment" visible="isTextChoices()"> - <div t:type="loop" t:source="choices" t:value="choice" t:volatile="true"> - <div class="fleft choiceName"> - <t:label for="textName" /> - <t:textfield class="nameField" t:id="textName" t:value="choice.name" /> - - - <t:label for="textDesc" /> - </div> - <div class="fleft"> - <t:textarea cols="30" t:id="textDesc" t:value="choice.description" /> - </div> - <div class="clr" /> - </div> - </t:formfragment> - <t:formfragment t:id="dateChoiceFragment" visible="isDateChoices()"> - <div t:type="loop" t:source="dateTypeChoices" t:value="dateTypeChoice" t:volatile="true"> - <div class="fleft choiceName"> - <t:label for="dateDTF" /> - <input t:type="ck/dateTimeField" t:id="dateDTF" value="dateTypeChoice.date" t:validate="regexp" - t:datePattern="${message:DTF-pattern}" t:timePicker="true" t:timePickerAdjacent="true"/> - - - <t:label for="dateDesc" /> - </div> - <div class="fleft"> - <t:textarea cols="35" t:id="dateDesc" t:value="dateTypeChoice.description" /> - </div> - <div class="clr" /> - </div> - </t:formfragment> - <t:formfragment t:id="imgChoiceFragment" visible="isImgChoices()"> - <t:ImageContextLink t:id="imgContext" t:dir="poll.pollId" /> - <div t:type="loop" t:source="imgTypeChoices" t:value="imgTypeChoice" t:volatile="true"> - <div class="fleft choiceName"> - <t:label for="imgFile" /> - <input class="nameField" t:type="upload" t:id="imgFile" t:value="imgTypeChoice.img" t:validate="regexp" /> - - - <t:label for="imgDesc" /> - </div> - <div class="fleft"> - <t:textarea cols="30" t:id="imgDesc" t:value="imgTypeChoice.description" /> - </div> - <div class="clr" /> - </div> - </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:id="addChoice" t:value="${message:addChoice}" /> - <t:submit t:value="${message:submit}" /> - </div> - </div> - </t:form> - </t:if> - - - </t:zone> -</t:border> \ No newline at end of file Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-14 15:12:25 UTC (rev 2999) +++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-18 17:09:12 UTC (rev 3000) @@ -212,23 +212,72 @@ <img src="${asset:context:img/help.png}" alt="message:help" /> </span> </legend> - <div t:type="zone" id="p-pollForm-lists-zone" t:id="listsZone" class="form-block"> + <div t:type="zone" id="p-pollForm-lists-zone" t:id="listsZone" class="form-block" t:update="show"> <t:if t:test="canDisplayLists()"> - <t:subForm t:visible="flag"> + <t:nuiton.feedback t:id="listsFeedback" /><br /> + <t:subForm t:visible="formActivate"> <t:if t:test="poll.pollType.group"> <p> <label t:type="label" t:for="listName" />: - <input t:type="textfield" t:id="listName" value="listName"/> - <input t:type="submit" t:id="addList" value="ADD"/> + <input t:type="textfield" t:id="listName" value="listName" /> + <input t:type="submit" t:id="addList" value="ADD" /> + <!--<a t:type="actionlink" t:id="addList" t:zone="p-pollForm-lists-zone">--> + <!--ADD--> + <!--</a>--> </p> - <p> - <t:loop t:source="lists.values()" t:value="list" t:volatile="true"> - ${list.name} + <p class="center"> + <t:loop t:source="lists.values()" t:value="list" t:encoder="listEncoder"> + <input class="list-edition${styleSelected}" t:type="nuiton/submitContext" t:context="list.name" t:id="editList" value="${list.name}" /> + <!--<span t:type="any" t:mixins="nuiton/confirm">--> + <!--<input t:type="nuiton/submitContext" t:id="removeList" t:image="context:img/delete.png" t:context="list.name" value="${message:delete}" />--> + <!--</span>--> + <t:if t:test="currentListSelected"> + <input t:type="submit" t:id="saveList" t:image="context:img/save.png" t:zone="p-pollForm-lists-zone" /> + <a t:type="actionlink" t:id="removeList" t:zone="p-pollForm-lists-zone"> + <span t:type="any" t:mixins="nuiton/confirm"> + <img src="${asset:context:img/delete.png}" alt="${message:delete}" /> + </span> + </a> + </t:if> </t:loop> </p> - <p:else> - COOL - </p:else> + </t:if> + <t:if t:test="listSelected"> + <div class="t-data-grid"> + <table class="t-data-grid"> + <thead> + <tr> + <th>${message:pollen.ui.participant.name-label}</th> + <th>${message:pollen.ui.participant.email-label}</th> + <th>${message:pollen.ui.participant.weight-label}</th> + <th></th> + </tr> + </thead> + <tbody> + <tr t:type="ajaxformloop" t:id="participants" source="selectedParticipants.values()" value="participant" t:encoder="participantEncoder"> + <td> + <t:textfield t:id="participantName" value="participant.name" size="20" t:validate="required"/> + </td> + <td> + <t:textfield t:id="participantEmail" value="participant.email" size="25" t:validate="email"/> + </td> + <td> + <t:textfield t:id="participantWeight" value="participant.weight" size="1"/> + </td> + <td> + <t:removerowlink> + <img src="${asset:context:img/delete.png}" alt="${message:delete}"/> + </t:removerowlink> + </td> + <p:addRow> + <td colspan="4" class="center"> + <t:addrowlink>${message:pollen.ui.participant.add}</t:addrowlink> + </td> + </p:addRow> + </tr> + </tbody> + </table> + </div> </t:if> </t:subForm> </t:if>
participants (1)
-
fdesbois@users.chorem.org