Author: fdesbois Date: 2012-04-18 16:51:21 +0200 (Wed, 18 Apr 2012) New Revision: 3297 Url: http://chorem.org/repositories/revision/pollen/3297 Log: - improve date conversion everywhere -> use DateConverter - change tooltip image color and use it in result and vote page Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DateConverter.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayDateChoice.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp trunk/pollen-ui-struts2/src/main/webapp/css/vote.css trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DateConverter.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DateConverter.java 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DateConverter.java 2012-04-18 14:51:21 UTC (rev 3297) @@ -25,25 +25,37 @@ @Override public Date convertFromString(Map context, String[] values, Class toClass) { String value = values[0]; + Date result = convertFromString(value); + return result; + } + + @Override + public String convertToString(Map context, Object o) { + Date date = (Date) o; + String result = convertToString(date); + return result; + } + + public static String convertToString(Date date) { + String result = DateUtil.formatDate(date, getDatePattern()); + return result; + } + + public static Date convertFromString(String value) { Date result = null; - if (StringUtils.isNotBlank(value)) { + if (StringUtils.isNotBlank(value)) { try { result = DateUtil.parseDate(value, getDatePattern()); } catch (ParseException e) { - log.error("Error parsing date '" + value + "'", e); + if (log.isErrorEnabled()) { + log.error("Error parsing date '" + value + "'", e); + } } } - return result; + return result; } - @Override - public String convertToString(Map context, Object o) { - Date date = (Date) o; - String formatedDate = DateUtil.formatDate(date, getDatePattern()); - return formatedDate; - } - - protected String getDatePattern() { + private static String getDatePattern() { Locale locale = ActionContext.getContext().getLocale(); String result = I18n.l_(locale, "pollen.common.datePattern"); return result; Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-18 14:51:21 UTC (rev 3297) @@ -29,6 +29,7 @@ import org.apache.struts2.StrutsStatics; import org.chorem.pollen.PollenConfiguration; import org.chorem.pollen.business.persistence.UserAccount; +import org.chorem.pollen.common.VoteCountingType; import org.chorem.pollen.services.DefaultPollenServiceContext; import org.chorem.pollen.services.PollenService; import org.chorem.pollen.services.PollenServiceContext; @@ -42,9 +43,6 @@ import javax.servlet.http.HttpServletRequest; import java.net.URL; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -65,10 +63,6 @@ private static final long serialVersionUID = 1L; - private static DateFormat dateTimeFormat; - - private DateFormat dateFormat; - public static PollenApplicationContext getPollenApplicationContext() { PollenApplicationContext applicationContext = PollenApplicationContext.get(getActionContext()); @@ -194,53 +188,38 @@ return language; } - protected static DateFormat getDateTimeFormat() { - if (dateTimeFormat == null) { - dateTimeFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm"); - } - return dateTimeFormat; - } - - protected DateFormat getDateFormat() { - if (dateFormat == null) { - dateFormat = new SimpleDateFormat("dd/MM/yyyy"); - } - return dateFormat; - } - - protected void setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - protected static ActionContext getActionContext() { return ActionContext.getContext(); } - public static String getCurrentDateTime() { - String result = getDateTimeFormat().format(new Date()); - return result; + public static Date getCurrentDateTime() { + return new Date(); } - public String formatDate(Date date) { - String result = getDateFormat().format(date); - return result; - } + public String getVoteCountingTypeHelp(VoteCountingType voteCountingType) { + String result; + switch (voteCountingType) { - public Date parseDate(String date) throws ParseException { - Date result = getDateFormat().parse(date); + default: + case NORMAL: + result = + _("pollen.common.voteCountingTypeHelp.normal"); + break; + case PERCENTAGE: + result = + _("pollen.common.voteCountingTypeHelp.percentage"); + break; + case CONDORCET: + result = + _("pollen.common.voteCountingTypeHelp.condorcet"); + break; + case NUMBER: + result = + _("pollen.common.voteCountingTypeHelp.number"); + } return result; } - public Date parseDateTime(String date) throws ParseException { - Date result = getDateTimeFormat().parse(date); - return result; - } - - public String formatDateTime(Date date) { - String result = getDateTimeFormat().format(date); - return result; - } - @Override public void addActionMessage(String message) { List<String> messages = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_MESSAGES); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-18 14:51:21 UTC (rev 3297) @@ -48,7 +48,6 @@ import org.chorem.pollen.services.impl.VoteService; import org.chorem.pollen.ui.actions.PageSkin; -import java.text.DateFormat; import java.util.Date; import java.util.List; import java.util.Map; @@ -79,8 +78,6 @@ private boolean feedFileExisting; - private String voteCountingTypeHelp; - private boolean creatorUser; private PollAccount pollAccount; @@ -149,10 +146,6 @@ return feedFileExisting; } - public String getVoteCountingTypeHelp() { - return voteCountingTypeHelp; - } - public PollAccount getPollAccount() { return pollAccount; } @@ -277,10 +270,6 @@ loadPoll(); - setDateFormat(DateFormat.getDateTimeInstance( - DateFormat.SHORT, - DateFormat.SHORT, getLocale())); - // Current poll account loadPollAccount(); @@ -301,27 +290,6 @@ PollFeedService pollFeedService = newService(PollFeedService.class); feedFileExisting = pollFeedService.isFeedExists(poll); - VoteCountingType voteCountingType = poll.getVoteCountingType(); - switch (voteCountingType) { - - case NORMAL: - voteCountingTypeHelp = - _("pollen.common.voteCountingTypeHelp.normal"); - break; - case PERCENTAGE: - voteCountingTypeHelp = - _("pollen.common.voteCountingTypeHelp.percentage"); - break; - case CONDORCET: - voteCountingTypeHelp = - _("pollen.common.voteCountingTypeHelp.condorcet"); - break; - case NUMBER: - voteCountingTypeHelp = - _("pollen.common.voteCountingTypeHelp.number"); - break; - } - //TODO Deal the case of the not loggued poll (using the pollAccountId creatorUser = getPollenUserAccount() != null && getPollenUserAccount().equals(poll.getCreator().getUserAccount()); @@ -386,8 +354,8 @@ return text; } - public String formatChoiceNameAsDate(Choice choice) { - return formatDate(new Date(Long.valueOf(choice.getName()))); + public Date getChoiceAsDate(Choice choice) { + return new Date(Long.valueOf(choice.getName())); } protected void loadPollAccount() throws PollAccountNotFound { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-04-18 14:51:21 UTC (rev 3297) @@ -44,11 +44,11 @@ import org.chorem.pollen.services.exceptions.PollNotFoundException; import org.chorem.pollen.services.impl.PollResultsService; import org.chorem.pollen.services.impl.PollService; +import org.chorem.pollen.ui.actions.DateConverter; import org.chorem.pollen.ui.actions.PageSkin; import org.nuiton.util.StringUtil; import java.net.URL; -import java.text.DateFormat; import java.util.Date; import java.util.List; import java.util.Map; @@ -106,8 +106,9 @@ return results; } - public String formatResultNameAsDate(PollResult result) { - return getDateTimeFormat().format(new Date(Long.valueOf(result.getName()))); + public Date getResultAsDate(PollResult result) { + Date date = new Date(Long.valueOf(result.getName())); + return date; } public Multimap<String, String> getChoicesResults() { @@ -169,10 +170,6 @@ byGroup = isGroupPoll(); } - setDateFormat(DateFormat.getDateTimeInstance( - DateFormat.SHORT, - DateFormat.SHORT, getLocale())); - String accountId = getAccountId(); if (poll.isPublicResults()) { userAllowed = true; @@ -301,7 +298,7 @@ if (isDateType()) { // mise en forme de la date Date date = new Date(Long.parseLong(name)); - name = getDateFormat().format(date); + name = DateConverter.convertToString(date); } choiceValues.add(name); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-18 14:51:21 UTC (rev 3297) @@ -51,11 +51,11 @@ import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; import org.chorem.pollen.services.impl.PreventRuleService; +import org.chorem.pollen.ui.actions.DateConverter; import org.chorem.pollen.ui.actions.FileUploadAware; import org.nuiton.util.StringUtil; import java.io.File; -import java.text.ParseException; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -956,13 +956,9 @@ String name) { createChoice(choice, prefix, name); if (StringUtils.isNotEmpty(name)) { - Date date = null; - try { - date = parseDateTime(name); - } catch (ParseException e) { - if (log.isErrorEnabled()) { - log.error("Unparseable date " + name, e); - } + Date date = DateConverter.convertFromString(name); + if (date == null) { + addInformationsError(prefix, _("pollen.error.date.format")); } choice.setDate(date); } Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-18 14:51:21 UTC (rev 3297) @@ -1,8 +1,10 @@ email=E-mail pollen.action.addChoice=Add choice pollen.action.addComment=Add a comment +pollen.action.addPersonListFromVotingList=Add voters from a favorite list pollen.action.addPersonToList=Add a voter pollen.action.addVotingList=Add a group +pollen.action.addVotingListFromPersonList=Add a group from a favorite list pollen.action.backToFavoriteLists=Back to favorite lists pollen.action.cancel=Cancel pollen.action.clone=Clone poll @@ -61,7 +63,8 @@ pollen.common.commentText=Comment pollen.common.comments=Comments about this poll pollen.common.csvImport=CSV import -pollen.common.datePattern=MM/dd/yyyy HH\:mm a +pollen.common.datePattern=MM/dd/yyyy HH\:mm +pollen.common.datePickerPattern=mm/dd/yy pollen.common.description=Description pollen.common.displayType-group=Results by groups pollen.common.displayType-normal=Results @@ -138,6 +141,7 @@ pollen.error.choice.empty=%s mandatory pollen.error.comment.name.empty=Comment name mandatory pollen.error.comment.text.empty=Comment text mandatory +pollen.error.date.format=Begin date does not match pattern 12/31/2000 12\:59 pollen.error.email.invalid=The email doesn't have the good format pollen.error.email.required=You must provide an email pollen.error.favoriteList.already.used=List name already used Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-18 14:51:21 UTC (rev 3297) @@ -2,7 +2,6 @@ pollen.action.addChoice=Ajouter un choix pollen.action.addComment=Ajouter un commentaire pollen.action.addPersonListFromVotingList=Ajouter des votants à partir d'une liste de votants -pollen.action.addPersonListToVotingList=Ajouter la liste des votants pollen.action.addPersonToList=Ajouter un votant pollen.action.addVotingList=Ajouter un groupe pollen.action.addVotingListFromPersonList=Ajouter un groupe à partir d'une liste de votants @@ -67,6 +66,7 @@ pollen.common.comments=Commentaire à propos du sondage pollen.common.csvImport=Import CSV pollen.common.datePattern=dd/MM/yyyy HH\:mm +pollen.common.datePickerPattern=dd/mm/yy pollen.common.description=Description pollen.common.displayType-group=Résultats par groupes pollen.common.displayType-normal=Résultats @@ -144,6 +144,7 @@ pollen.error.choice.empty=%s obligatoire pollen.error.comment.name.empty=Nom du commentaire obligatoire pollen.error.comment.text.empty=Texte du commentaire obligatoire +pollen.error.date.format=La date doit être au format 31/12/2000 23\:59 pollen.error.email.invalid=Email non valide pollen.error.email.required=Email obligatoire pollen.error.favoriteList.already.used=Nom de liste déjà utilisé Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-18 14:51:21 UTC (rev 3297) @@ -24,11 +24,13 @@ <%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<link rel="stylesheet" type="text/css" - href="<s:url value='/css/pollCreation.css'/>"/> -<link rel="stylesheet" type="text/css" - href="<s:url value='/css/tipTip.css'/>"/> +<html> +<head> +<sj:head locale="%{locale}"/> +<link rel="stylesheet" type="text/css" href="<s:url value='/css/pollCreation.css'/>"/> +<link rel="stylesheet" type="text/css" href="<s:url value='/css/tipTip.css'/>"/> + <script type="text/javascript"> $(document).data( @@ -60,11 +62,12 @@ ); </script> -<script type="text/javascript" - src='<s:url value="/js/createPoll.js"/>'></script> -<script type="text/javascript" - src='<s:url value="/js/jquery.tipTip.minified.js"/>'></script> +<script type="text/javascript" src='<s:url value="/js/createPoll.js"/>'></script> +<script type="text/javascript" src='<s:url value="/js/jquery.tipTip.minified.js"/>'></script> +</head> +<body> + <s:url id='errorImg' value='/img/exclamation.png'/> <title><s:text name="pollen.title.createPoll"/></title> @@ -156,11 +159,13 @@ <div id='addChoiceAddAllowedPanel' class="hidden"> <sj:datepicker key="poll.beginChoiceDate" label="%{getText('pollen.common.beginChoiceDate')}" - displayFormat="dd/mm/yy" timepicker="true" + displayFormat="%{getText('pollen.common.datePickerPattern')}" + timepicker="true" disabled="%{voteStarted}"/> <sj:datepicker key="poll.endChoiceDate" label="%{getText('pollen.common.endChoiceDate')}" - displayFormat="dd/mm/yy" timepicker="true" + displayFormat="%{getText('pollen.common.datePickerPattern')}" + timepicker="true" disabled="%{voteStarted}"/> </div> <s:checkbox key="limitChoice" @@ -191,11 +196,13 @@ <fieldset> <legend><s:text name="pollen.fieldset.poll.general"/></legend> - <sj:datepicker key="poll.beginDate" displayFormat="dd/mm/yy" + <sj:datepicker key="poll.beginDate" + displayFormat="%{getText('pollen.common.datePickerPattern')}" label="%{getText('pollen.common.beginDate')}" timepicker="true" disabled="%{voteStarted}"/> - <sj:datepicker key="poll.endDate" displayFormat="dd/mm/yy" + <sj:datepicker key="poll.endDate" + displayFormat="%{getText('pollen.common.datePickerPattern')}" timepicker="true" label="%{getText('pollen.common.endDate')}"/> </fieldset> @@ -277,3 +284,6 @@ <sj:dialog id="selectPersonListDialog" resizable="true" autoOpen="false" modal="true" width="500"/> + +</body> +</html> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp 2012-04-18 14:51:21 UTC (rev 3297) @@ -23,6 +23,7 @@ --%> <%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sp" uri="/nuiton-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <fieldset> <legend><s:text name="pollen.fieldset.poll.choices"/></legend> @@ -41,6 +42,7 @@ <s:set name="prefix">textChoice_<s:property value="%{#choiceNumber}"/></s:set> <div id='choicesTEXT_<s:property value="choiceNumber"/>'> <s:hidden key='%{#prefix}.topiaId' value='%{#choice.topiaId}' label=''/> + <sp:fielderror fieldName="%{#prefix}"/> <div class="fleft choiceName"> <s:label for="%{#prefix}.name" id="choicesTEXT_label_%{#choiceNumber}" theme="simple" value=''/> @@ -89,12 +91,14 @@ <div id='choicesDATE_<s:property value="choiceNumber"/>'> <s:hidden key='%{#prefix}.topiaId' id='%{#prefix}.topiaId' value='%{#choice.topiaId}' label='' theme="simple" /> + <sp:fielderror fieldName="%{#prefix}"/> <div class="fleft choiceName"> <s:label for="%{#prefix}.name" id="choicesDATE_label_%{choiceNumber}" theme="simple" value=''/> <sj:datepicker id='%{#prefix}.name' key="%{#prefix}.name" changeMonth="true" changeYear="true" labelSeparator="" theme="simple" label="" - timepicker="true" value="%{choice.date}" displayFormat="dd/mm/yy" + timepicker="true" value="%{choice.date}" + displayFormat="%{getText('pollen.common.datePickerPattern')}" disabled="%{voteStarted}"/> - <s:label for="%{#prefix}.description" key="pollen.common.description" @@ -138,6 +142,7 @@ <s:set name="prefix">imageChoice_<s:property value="%{#choiceNumber}"/></s:set> <div id='choicesIMAGE_<s:property value="choiceNumber"/>'> <s:hidden key='%{#prefix}.topiaId' value='%{#choice.topiaId}' label=''/> + <sp:fielderror fieldName="%{#prefix}"/> <div class="fleft choiceName"> <s:label for="%{#prefix}.name" id="choicesIMAGE_label_%{choiceNumber}" theme="simple" value=''/> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayDateChoice.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayDateChoice.jsp 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayDateChoice.jsp 2012-04-18 14:51:21 UTC (rev 3297) @@ -36,7 +36,8 @@ theme="simple" value=''/> <sj:datepicker id='%{#prefix}.name' key="%{#prefix}.name" changeMonth="true" changeYear="true" labelSeparator="" theme="simple" label="" - timepicker="true" value="%{choice.date}" displayFormat="dd/mm/yy"/> + timepicker="true" value="%{choice.date}" + displayFormat="%{getText('pollen.common.datePickerPattern')}"/> - <s:label for="%{#prefix}.description" key="pollen.common.description" theme="simple"/> Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-04-18 14:51:21 UTC (rev 3297) @@ -86,8 +86,8 @@ label='%{getText("pollen.common.endDate")}'/> <s:label value="%{poll.voteCountingType}" label='%{getText("pollen.common.voteCountingType")}' - tooltip="%{voteCountingTypeHelp}" - tooltipIconPath="/img/help.png"/> + tooltip="%{getVoteCountingTypeHelp(poll.voteCountingType)}" + tooltipIconPath="/img/tooltip.png"/> </fieldset> </div> @@ -100,7 +100,7 @@ <s:property value="name"/> </s:if> <s:elseif test="dateType"> - <s:property value="%{formatResultNameAsDate(#result)}"/> + <s:property value="%{getResultAsDate(#result)}"/> </s:elseif> <s:elseif test="imageType"> <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage" Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-04-18 14:51:21 UTC (rev 3297) @@ -26,6 +26,10 @@ <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> +<html> +<head> +<sj:head locale="%{locale}"/> + <title><s:property value="%{poll.title}"/></title> <link rel="stylesheet" type="text/css" @@ -105,6 +109,9 @@ </script> +</head> +<body> + <h1 class="titleVote"><s:property value="poll.title"/></h1> <!-- Informations sur le sondage --> @@ -137,7 +144,8 @@ <s:label value="%{poll.endDate}" key='pollen.common.endDate'/> <s:label value="%{poll.voteCountingType}" label='%{getText("pollen.common.voteCountingType")}' - tooltip="%{voteCountingTypeHelp}" tooltipIconPath="/img/help.png"/> + tooltip="%{getVoteCountingTypeHelp(poll.voteCountingType)}" + tooltipIconPath="/img/tooltip.png"/> </fieldset> </div> @@ -220,13 +228,13 @@ <th class="desc"> <span title='<s:property value="escapeLineBreak(#choice.description)"/>'> - <s:property value="%{formatChoiceNameAsDate(#choice)}"/> + <s:property value="%{getChoiceAsDate(#choice)}"/> </span> </th> </s:if> <s:else> <th> - <s:property value="%{formatChoiceNameAsDate(#choice)}"/> + <s:property value="%{getChoiceAsDate(#choice)}"/> </th> </s:else> </s:if> @@ -445,7 +453,8 @@ <sj:datepicker key="choice.date" label="%{getText('pollen.common.choice')}" changeMonth="true" changeYear="true" - timepicker="true" displayFormat="dd/mm/yy" + timepicker="true" + displayFormat="%{getText('pollen.common.datePickerPattern')}" required="true"/> </s:elseif> <s:elseif test="imageType"> @@ -455,7 +464,7 @@ required="true"/> </s:elseif> <br/> - <s:textarea cols="30" key="choice.description" + <s:textarea cols="36" key="choice.description" label="%{getText('pollen.common.description')}"/> <br/> <s:submit action="addChoice/%{uriId}" key="pollen.action.addChoice" align="center"/> @@ -549,4 +558,7 @@ autoOpen="false" modal="true" width="800"/> </div> -</s:if> \ No newline at end of file +</s:if> + +</body> +</html> \ No newline at end of file Modified: trunk/pollen-ui-struts2/src/main/webapp/css/vote.css =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/css/vote.css 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/css/vote.css 2012-04-18 14:51:21 UTC (rev 3297) @@ -166,7 +166,7 @@ } #choiceFormDiv form { - width: 200px; + width: 300px; margin: auto; margin-top: 20px; margin-bottom: 20px; Modified: trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png 2012-04-18 14:51:12 UTC (rev 3296) +++ trunk/pollen-ui-struts2/src/main/webapp/img/tooltip.png 2012-04-18 14:51:21 UTC (rev 3297) @@ -1,9 +1,9 @@ �PNG -IHDR��asRGB���bKGD������� pHYs���+tIME�8Vڳ�IDAT8˥��K�Q���;�4_�Ѳ,J�+$J�fP�(��)�hSA�*�V�-�MB""b� -+!��,Ê4G�)����Fc�M=��9~�y��(�S�_,RFz�����_�ȵq/�Żd�_������ ���D<��b��|�/1}}x<�w��D��5��s���v -�Bz;���*Ep�zL����Fv���������ܹF*XLn��L�}'�9�D��&��q��bWU�[�����L���n'O2="��C7I6"r|/іO��6�6$��_��,bm�� ��ᯬD��A��(@wv��茐~����Ռ>gglo �z?�Q�(A��6�˖���w�R�o� -I -eǨ��Q�(����؍G�t�c��`�ZP��&0y6����R��茠����4CZ'qG��+#��*(������<�=��|o�i���D�"������/+�sWE�7g����&��C��ߑZ��+�����"Jl�g���x"�� -uY���iVў�D_v2��{�|�maJ*�me�E�����)n��o_y���^<���QT]�?�HE��|B<#t�w=+�?���� yf��mң�<�Bfm�����x���e���\�F�V/[�IEND�B`� \ No newline at end of file +IHDR��asRGB���bKGD�C� pHYs���+tIME� +3��i�IDAT8˥�KH�q��7c�3�I��V:�����"� �e�nU�v-#ܴ��Đ(�2ʂ����LN9�u�Fg����-�^�:�˽�s�Ǹ�r����ׂӖ�S1��Q��e��l*.&PSG�����~c��|zD�{�Jf�2�� +@6��t�3����CGqni^'17����f/bGh��.r�$S1���[qy��z�Kf��ɂӖ����8���*�g��r�<6���0����N�B�X�<��>���2�jl3L`��J������Y��{�p�27�z� +��V3:����������/�1�+�,�%PJ�D��v���J�ۻa~f���Ɔ +��4.���\%����P߸Q�Tr��d��˷�da��G)�R�����0M:�_�4nu?�Kd���(�Qb;YJ�()��P �ea���{ԍ��D(����J�����QO|<Jɖ�XV��j����s�cX��W��sd��=� +5;�Z�5��yb��;s�8��lr8��<M��E�eW��v�jl3ڎ��g=�PJ��a�"JiJJ}�5411!66�Ɏs�����S�o���Ip{.��5��Eb�V�Y�Ow�>b�1v����0��,}K��������Fc�A����a�|%�J�mkԭIEND�B`� \ No newline at end of file