Pollen-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 3196 discussions
r3526 - trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 15:20:24 +0200 (Tue, 19 Jun 2012)
New Revision: 3526
Url: http://chorem.org/repositories/revision/pollen/3526
Log:
fixes #622: Traduction manquante i18n
Modified:
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp
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-06-19 13:19:34 UTC (rev 3525)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-06-19 13:20:24 UTC (rev 3526)
@@ -123,7 +123,7 @@
<fieldset>
<legend><s:text name="pollen.common.aboutPoll"/></legend>
<div style="float: right">
- <s:if test="creatorUser or userAdmin">
+ <s:if test="creatorOrAdmin">
<s:a href="%{summaryUrl}">
<img src="<s:url value='/img/editSmall.png'/>"
title="<s:text name='pollen.action.summaryPoll'/>"
@@ -161,9 +161,7 @@
<s:if test="poll.anonymous">
<p>
- <s:text name="pollen.common.voteNbVotes">
- <s:param><s:property value="%{poll.sizeVote()}"/></s:param>
- </s:text>
+ <s:property value="%{voteSizeMessage}"/>
</p>
<%--<t:feedback t:id="voteFeedback"/>--%>
</s:if>
@@ -204,7 +202,7 @@
<s:property value="name"/>
</s:else>
<s:if test="pollChoiceRunning">
- <s:if test="creatorUser">
+ <s:if test="creatorOrAdmin">
<s:a action="deleteChoice" namespace="/poll"
onclick="return openDeleteChoiceDialog('%{#choice.topiaId}');">
<s:param name="choiceId"><s:property value="id"/></s:param>
1
0
19 Jun '12
Author: tchemit
Date: 2012-06-19 15:19:34 +0200 (Tue, 19 Jun 2012)
New Revision: 3525
Url: http://chorem.org/repositories/revision/pollen/3525
Log:
after deleting a poll, must redirect ot home (not to summary of no more existing poll...)
Modified:
trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml
Modified: trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-06-19 12:22:07 UTC (rev 3524)
+++ trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-06-19 13:19:34 UTC (rev 3525)
@@ -114,7 +114,7 @@
<action name="delete/*"
class="org.chorem.pollen.ui.actions.poll.DeletePoll">
<param name="uriId">{1}</param>
- <result type="redirect2"/>
+ <result type="redirectToHome"/>
</action>
<!-- vote poll -->
1
0
r3524 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/poll resources/org/chorem/pollen/ui webapp/WEB-INF/jsp/poll
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 14:22:07 +0200 (Tue, 19 Jun 2012)
New Revision: 3524
Url: http://chorem.org/repositories/revision/pollen/3524
Log:
- fixes #620: On ne peut pas d?\195?\169pouiller un sondage priv?\195?\169 m?\195?\170me quand on en est le cr?\195?\169ateur (remove all security stuff from Result action and jsp...)
- remove obsolete resources directory
Removed:
trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp
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-06-19 12:10:43 UTC (rev 3523)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-06-19 12:22:07 UTC (rev 3524)
@@ -30,7 +30,6 @@
import com.google.common.collect.Multimap;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.util.UrlHelper;
@@ -41,7 +40,6 @@
import org.chorem.pollen.common.ChoiceType;
import org.chorem.pollen.common.PollType;
import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.services.exceptions.PollNotFoundException;
import org.chorem.pollen.services.impl.PollResultsService;
import org.chorem.pollen.ui.actions.PageSkin;
import org.chorem.pollen.ui.converters.DateConverter;
@@ -74,15 +72,6 @@
private Boolean byGroup;
/**
- * Can user be on this page ?
- * <p/>
- * TODO-tchemit-2012-06-03 Security is managed by shiro, why doing it here again ?
- *
- * @since 1.3
- */
- private boolean userAllowed;
-
- /**
* Is user is poll's creator ?
*
* @since 1.4
@@ -150,14 +139,10 @@
return poll;
}
- public boolean isUserAllowed() {
- return userAllowed;
+ public boolean isCreatorOrAdmin() {
+ return creatorUser || isUserAdmin();
}
- public boolean isCreatorUser() {
- return creatorUser;
- }
-
public boolean isFeedFileExisting() {
return feedFileExisting;
}
@@ -165,7 +150,6 @@
public String getSummaryUrl() {
PollUrl url = getPollUrlService().getPollSummaryUrl(poll);
url.getPollUri().setAccountId(getAccountId());
- getSecurityService().removeAccountIdWhenConnected(url, getPollenUserAccount());
return url.getUrl();
}
@@ -245,34 +229,50 @@
byGroup = isGroupPoll();
}
- String accountId = getAccountId();
+ creatorUser = getSecurityService().isPollCreator(
+ poll,
+ getAccountId(), getPollenUserAccount());
- creatorUser = poll.getCreator().getAccountId().equals(accountId);
+ if (poll.isRunning(serviceContext.getCurrentTime())) {
+ addFlashWarning(_("pollen.information.pollRunning"));
+ }
- if (poll.isPublicResults()) {
- userAllowed = true;
- } else if (StringUtils.isNotEmpty(accountId)) {
+ // load results
- // create is allowed to be ther
- userAllowed = creatorUser;
+ PollResultsService service = getPollResultsService();
-// PollAccount creator = poll.getCreator();
-// if (accountId.equals(creator.getAccountId())) {
-// userAllowed = true;
-// }
+ PollResultList resultListDTO = service.getResults(poll);
+
+ results = resultListDTO.getPollResults();
+
+ if (log.isDebugEnabled()) {
+ for (PollResult res : results) {
+ log.debug(res
+ + ", (voteCounting=" + res.getVoteCountingType()
+ + ", byGroup=" + res.isByGroup() + ")");
+ }
}
- if (!userAllowed) {
- addFlashError(_("pollen.error.userNotAllowed"));
+ if (isNumberVoteCounting()) {
- } else if (poll.isRunning(serviceContext.getCurrentTime())) {
- addFlashWarning(_("pollen.information.pollRunning"));
- loadResults();
+ // resultats des choix cachés
+ choicesResults = LinkedHashMultimap.create();
- } else {
- loadResults();
+ // sous-titres des vrais choix (les choix pas cachés)
+ subtitles = ArrayListMultimap.create();
+
+ results = service.createNumberVoteCountingResult(
+ resultListDTO,
+ choicesResults,
+ subtitles);
}
+ topRanking = service.getTopRanking(results);
+
+ if (log.isDebugEnabled()) {
+ log.debug("topRanking = " + topRanking);
+ }
+
return SUCCESS;
}
@@ -328,43 +328,6 @@
this.byGroup = byGroup;
}
- protected void loadResults() throws PollNotFoundException {
-
- PollResultsService service = getPollResultsService();
-
- PollResultList resultListDTO = service.getResults(poll);
-
- results = resultListDTO.getPollResults();
-
- if (log.isDebugEnabled()) {
- for (PollResult res : results) {
- log.debug(res
- + ", (voteCounting=" + res.getVoteCountingType()
- + ", byGroup=" + res.isByGroup() + ")");
- }
- }
-
- if (isNumberVoteCounting()) {
-
- // resultats des choix cachés
- choicesResults = LinkedHashMultimap.create();
-
- // sous-titres des vrais choix (les choix pas cachés)
- subtitles = ArrayListMultimap.create();
-
- results = service.createNumberVoteCountingResult(
- resultListDTO,
- choicesResults,
- subtitles);
- }
-
- topRanking = service.getTopRanking(results);
-
- if (log.isInfoEnabled()) {
- log.info("topRanking = " + topRanking);
- }
- }
-
/** @return Récupération de la liste des résultats pour le diagramme. */
public List<String> getChoices() {
@@ -398,7 +361,6 @@
params.put("title", "");
params.put("values", getChoices());
-
urlHelper.buildParametersString(params, url, "&");
String chartUrl = url.toString();
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-06-19 12:10:43 UTC (rev 3523)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-06-19 12:22:07 UTC (rev 3524)
@@ -67,158 +67,155 @@
});
</script>
-<s:if test="userAllowed">
+<h1 class="titleVoteCounting"><s:property value="poll.title"/></h1>
- <h1 class="titleVoteCounting"><s:property value="poll.title"/></h1>
-
- <!-- Informations sur le sondage -->
- <div id="resultTop">
- <div style="white-space:pre-wrap; text-align: start;">
- <s:property value="poll.description"/>
- </div>
- <fieldset>
- <legend><s:text name="pollen.common.aboutPoll"/></legend>
- <div style="float: right">
- <s:if test="creatorUser or userAdmin">
- <s:a href="%{summaryUrl}">
- <img src="<s:url value='/img/editSmall.png'/>"
- title="<s:text name='pollen.action.summaryPoll'/>"
- alt="<s:text name='pollen.action.summaryPoll'/>"/>
- </s:a>
- </s:if>
- <s:a href='%{voteUrl}'>
- <img src="<s:url value='/img/vote.png'/>"
- title="<s:text name="pollen.common.vote.return-help"/>"
- alt="<s:text name="pollen.common.vote.return"/>"/>
- </s:a>
- <s:if test="feedFileExisting">
- <s:a namespace="/poll" action="getFeed">
- <s:param name="pollId" value="poll.pollId"/>
- <img src="<s:url value='/img/feed.png'/>" title="Atom" alt="Atom"/>
- </s:a>
- </s:if>
- </div>
- <s:label value="%{poll.creator.votingId}"
- key='pollen.common.pollCreator'/>
- <s:label value="%{poll.beginDate}" key='pollen.common.beginDate'/>
- <s:label value="%{poll.endDate}"
- label='%{getText("pollen.common.endDate")}'/>
- <s:label value="%{poll.voteCountingType}"
- label='%{getText("pollen.common.voteCountingType")}'
- tooltip="%{getVoteCountingTypeHelp(poll.voteCountingType)}"
- tooltipIconPath="/img/tooltip.png"/>
- </fieldset>
+<!-- Informations sur le sondage -->
+<div id="resultTop">
+ <div style="white-space:pre-wrap; text-align: start;">
+ <s:property value="poll.description"/>
</div>
+ <fieldset>
+ <legend><s:text name="pollen.common.aboutPoll"/></legend>
+ <div style="float: right">
+ <s:if test="creatorOrAdmin">
+ <s:a href="%{summaryUrl}">
+ <img src="<s:url value='/img/editSmall.png'/>"
+ title="<s:text name='pollen.action.summaryPoll'/>"
+ alt="<s:text name='pollen.action.summaryPoll'/>"/>
+ </s:a>
+ </s:if>
+ <s:a href='%{voteUrl}'>
+ <img src="<s:url value='/img/vote.png'/>"
+ title="<s:text name="pollen.common.vote.return-help"/>"
+ alt="<s:text name="pollen.common.vote.return"/>"/>
+ </s:a>
+ <s:if test="feedFileExisting">
+ <s:a namespace="/poll" action="getFeed">
+ <s:param name="pollId" value="poll.pollId"/>
+ <img src="<s:url value='/img/feed.png'/>" title="Atom" alt="Atom"/>
+ </s:a>
+ </s:if>
+ </div>
+ <s:label value="%{poll.creator.votingId}"
+ key='pollen.common.pollCreator'/>
+ <s:label value="%{poll.beginDate}" key='pollen.common.beginDate'/>
+ <s:label value="%{poll.endDate}"
+ label='%{getText("pollen.common.endDate")}'/>
+ <s:label value="%{poll.voteCountingType}"
+ label='%{getText("pollen.common.voteCountingType")}'
+ tooltip="%{getVoteCountingTypeHelp(poll.voteCountingType)}"
+ tooltipIconPath="/img/tooltip.png"/>
+ </fieldset>
+</div>
- <!-- Victoire -->
- <s:if test="victoryMessage != ''">
- <h4><s:property value="victoryMessage"/>
+<!-- Victoire -->
+<s:if test="victoryMessage != ''">
+ <h4><s:property value="victoryMessage"/>
+ <br/>
+ <s:iterator value="topRanking" var="result">
+ <s:if test="textType">
+ <s:property value="name"/>
+ </s:if>
+ <s:elseif test="dateType">
+ <s:property value="%{getResultAsDate(#result)}"/>
+ </s:elseif>
+ <s:elseif test="imageType">
+ <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
+ escapeAmp="false">
+ <s:param name="choiceId" value="name"/>
+ <s:param name="pollId" value="poll.pollId"/>
+ <s:param name="thumb" value="false"/>
+ </s:url>
+ <s:url id="imageUrlThumb" namespace="/io" action="getPollChoiceImage"
+ escapeAmp="false">
+ <s:param name="choiceId" value="name"/>
+ <s:param name="pollId" value="poll.pollId"/>
+ <s:param name="thumb" value="true"/>
+ </s:url>
+ <a href="<s:property value='imageUrl'/>" rel="lightbox">
+ <img alt="<s:property value='name'/>"
+ title="<s:property value='name'/>"
+ src="<s:property value='imageUrlThumb'/>">
+ </a>
+
+ </s:elseif>
<br/>
- <s:iterator value="topRanking" var="result">
- <s:if test="textType">
- <s:property value="name"/>
- </s:if>
- <s:elseif test="dateType">
- <s:property value="%{getResultAsDate(#result)}"/>
- </s:elseif>
- <s:elseif test="imageType">
- <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
- escapeAmp="false">
- <s:param name="choiceId" value="name"/>
- <s:param name="pollId" value="poll.pollId"/>
- <s:param name="thumb" value="false"/>
- </s:url>
- <s:url id="imageUrlThumb" namespace="/io" action="getPollChoiceImage"
- escapeAmp="false">
- <s:param name="choiceId" value="name"/>
- <s:param name="pollId" value="poll.pollId"/>
- <s:param name="thumb" value="true"/>
- </s:url>
- <a href="<s:property value='imageUrl'/>" rel="lightbox">
- <img alt="<s:property value='name'/>"
- title="<s:property value='name'/>"
- src="<s:property value='imageUrlThumb'/>">
- </a>
+ </s:iterator>
+ </h4>
+</s:if>
- </s:elseif>
- <br/>
- </s:iterator>
- </h4>
- </s:if>
+<!-- Diagramme -->
+<div id="resultChart">
+ <div class="chartTypeDiv">
+ <sj:a id='displayChart1' href="#" onclick="return displayCharts(1);">
+ <img src="<s:url value='/img/rep1.png'/>"
+ title='<s:text name="pollen.common.chartType-pie"/>' alt="1"/>
+ </sj:a>
+ <sj:a id='displayChart2' href="#" onclick="return displayCharts(2);">
+ <img src="<s:url value='/img/rep2.png'/>"
+ title='<s:text name="pollen.common.chartType-pie3d"/>' alt="2"/>
+ </sj:a>
+ <sj:a id='displayChart3' href="#" onclick="return displayCharts(3);">
+ <img src="<s:url value='/img/rep3.png'/>"
+ title='<s:text name="pollen.common.chartType-ring"/>' alt="3"/>
+ </sj:a>
+ </div>
- <!-- Diagramme -->
- <div id="resultChart">
- <div class="chartTypeDiv">
- <sj:a id='displayChart1' href="#" onclick="return displayCharts(1);">
- <img src="<s:url value='/img/rep1.png'/>"
- title='<s:text name="pollen.common.chartType-pie"/>' alt="1"/>
- </sj:a>
- <sj:a id='displayChart2' href="#" onclick="return displayCharts(2);">
- <img src="<s:url value='/img/rep2.png'/>"
- title='<s:text name="pollen.common.chartType-pie3d"/>' alt="2"/>
- </sj:a>
- <sj:a id='displayChart3' href="#" onclick="return displayCharts(3);">
- <img src="<s:url value='/img/rep3.png'/>"
- title='<s:text name="pollen.common.chartType-ring"/>' alt="3"/>
- </sj:a>
- </div>
-
- <div class="displayTypeDiv">
- <s:if test="groupPoll">
- <s:text name="pollen.common.results"/>
- <s:if test="byGroup">
- <s:a namespace="/poll" action="results/%{poll.pollId}">
- <s:param name="byGroup" value="false"/>
- <s:text name="pollen.common.normal"/>
- </s:a>
- - <s:text name="pollen.common.group"/>
- </s:if>
- <s:else>
- <s:text name="pollen.common.normal"/> -
- <s:a namespace="/poll" action="results/%{poll.pollId}">
- <s:text name="pollen.common.group"/>
- </s:a>
- </s:else>
+ <div class="displayTypeDiv">
+ <s:if test="groupPoll">
+ <s:text name="pollen.common.results"/>
+ <s:if test="byGroup">
+ <s:a namespace="/poll" action="results/%{poll.pollId}">
+ <s:param name="byGroup" value="false"/>
+ <s:text name="pollen.common.normal"/>
+ </s:a>
+ - <s:text name="pollen.common.group"/>
</s:if>
- </div>
+ <s:else>
+ <s:text name="pollen.common.normal"/> -
+ <s:a namespace="/poll" action="results/%{poll.pollId}">
+ <s:text name="pollen.common.group"/>
+ </s:a>
+ </s:else>
+ </s:if>
+ </div>
- <sj:div id='chartContainer'>
- <img id='chart_normal'/>
- </sj:div>
+ <sj:div id='chartContainer'>
+ <img id='chart_normal'/>
+ </sj:div>
- <!-- Diagramme par choix -->
- <s:if test="choicesResults != null">
- <div id="resultChart">
- <div>
- <s:iterator value="choicesResultNames" var="choicesResultName"
- status="status">
- <img id='chart_<s:property value="#status.index"/>'
- alt="<s:property/>"
- title="<s:property/>"
- src="<s:property value='%{getChoicesResultCharUrl(400,300, #choicesResultName)}'/>">
- </s:iterator>
- </div>
+ <!-- Diagramme par choix -->
+ <s:if test="choicesResults != null">
+ <div id="resultChart">
+ <div>
+ <s:iterator value="choicesResultNames" var="choicesResultName"
+ status="status">
+ <img id='chart_<s:property value="#status.index"/>'
+ alt="<s:property/>"
+ title="<s:property/>"
+ src="<s:property value='%{getChoicesResultCharUrl(400,300, #choicesResultName)}'/>">
+ </s:iterator>
</div>
- </s:if>
- </div>
- <!-- Classement -->
- <%--<t:remove>--%>
- <%--<div id="resultList">--%>
- <%--<ol>--%>
- <%--<s:iterator value="ranking" var="result">--%>
- <%--<li>--%>
- <%--<s:if test="dateType">--%>
- <%--<s:property value="%{getResultNameAsDate(#result.name)}"/>--%>
- <%--<%–<t:output value="resultNameAsDate" format="dateFormat"/>–%>--%>
- <%--</s:if>--%>
- <%--<s:else>--%>
- <%--<s:property value="name"/>--%>
- <%--</s:else>--%>
- <%--(<s:property value="%{getTrimValue(#result)}"/>)--%>
- <%--</li>--%>
- <%--</s:iterator>--%>
- <%--</ol>--%>
- <%--</div>--%>
- <%--</t:remove>--%>
+ </div>
+ </s:if>
+</div>
+<!-- Classement -->
+<%--<t:remove>--%>
+<%--<div id="resultList">--%>
+<%--<ol>--%>
+<%--<s:iterator value="ranking" var="result">--%>
+<%--<li>--%>
+<%--<s:if test="dateType">--%>
+<%--<s:property value="%{getResultNameAsDate(#result.name)}"/>--%>
+<%--<%–<t:output value="resultNameAsDate" format="dateFormat"/>–%>--%>
+<%--</s:if>--%>
+<%--<s:else>--%>
+<%--<s:property value="name"/>--%>
+<%--</s:else>--%>
+<%--(<s:property value="%{getTrimValue(#result)}"/>)--%>
+<%--</li>--%>
+<%--</s:iterator>--%>
+<%--</ol>--%>
+<%--</div>--%>
+<%--</t:remove>--%>
-</s:if>
1
0
r3523 - trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 14:10:43 +0200 (Tue, 19 Jun 2012)
New Revision: 3523
Url: http://chorem.org/repositories/revision/pollen/3523
Log:
improve validation
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-06-19 10:18:41 UTC (rev 3522)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-06-19 12:10:43 UTC (rev 3523)
@@ -102,9 +102,7 @@
if (StringUtils.isBlank(user.getEmail())) {
addFieldError("user.email", _("pollen.error.email.required"));
- }
-
- if (!StringUtil.isEmail(user.getEmail())) {
+ } else if (!StringUtil.isEmail(user.getEmail())) {
addFieldError("user.email", _("pollen.error.email.invalid"));
}
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-06-19 10:18:41 UTC (rev 3522)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-06-19 12:10:43 UTC (rev 3523)
@@ -86,9 +86,7 @@
if (StringUtils.isBlank(user.getEmail())) {
addFieldError("user.email", _("pollen.error.email.required"));
- }
-
- if (!StringUtil.isEmail(user.getEmail())) {
+ } else if (!StringUtil.isEmail(user.getEmail())) {
addFieldError("user.email", _("pollen.error.email.invalid"));
}
}
1
0
r3522 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/admin java/org/chorem/pollen/ui/actions/user resources/org/chorem/pollen/ui/actions webapp/WEB-INF/jsp/admin webapp/WEB-INF/jsp/poll webapp/WEB-INF/jsp/user
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 12:18:41 +0200 (Tue, 19 Jun 2012)
New Revision: 3522
Url: http://chorem.org/repositories/revision/pollen/3522
Log:
remove old xml validation files + fix some jps bugs
Removed:
trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/
trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-06-19 10:18:41 UTC (rev 3522)
@@ -23,11 +23,14 @@
package org.chorem.pollen.ui.actions.admin;
import com.google.common.base.Preconditions;
+import org.apache.commons.lang3.StringUtils;
+import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException;
import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.nuiton.util.StringUtil;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -68,6 +71,44 @@
this.action = action;
}
+ @Override
+ public void validate() {
+
+ if ("create".equals(action)) {
+
+ UserAccount account = getCreateUser();
+
+ if (StringUtils.isBlank(account.getLogin())) {
+ addFieldError("createUser.login",
+ _("pollen.error.login.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("createUser.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("createUser.email",
+ _("pollen.error.email.invalid"));
+ }
+ } else if ("edit".equals(action)) {
+
+ UserAccount account = getEditUser();
+
+ if (StringUtils.isBlank(account.getLogin())) {
+ addFieldError("editUser.login",
+ _("pollen.error.pollAccount.votingId.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("editUser.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("editUser.email",
+ _("pollen.error.email.invalid"));
+ }
+ }
+ }
+
public String create() throws Exception {
Preconditions.checkNotNull(user);
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-06-19 10:18:41 UTC (rev 3522)
@@ -22,11 +22,14 @@
*/
package org.chorem.pollen.ui.actions.user;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
import org.chorem.pollen.ui.actions.PageSkin;
import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.nuiton.util.StringUtil;
/**
* Update a user.
@@ -79,7 +82,34 @@
return INPUT;
}
+
@Override
+ public void validate() {
+
+ if (StringUtils.isBlank(user.getLogin())) {
+ addFieldError("user.login", _("pollen.error.login.required"));
+ }
+
+ if (StringUtils.isBlank(user.getPassword())) {
+ addFieldError("user.password", _("pollen.error.password.required"));
+ }
+
+ if (StringUtils.isNotBlank(getNewPassword())) {
+ if (ObjectUtils.notEqual(getNewPassword(), getNewPassword2())) {
+ addFieldError("newPassword", _("pollen.error.passwords.not.equals"));
+ }
+ }
+
+ if (StringUtils.isBlank(user.getEmail())) {
+ addFieldError("user.email", _("pollen.error.email.required"));
+ }
+
+ if (!StringUtil.isEmail(user.getEmail())) {
+ addFieldError("user.email", _("pollen.error.email.invalid"));
+ }
+ }
+
+ @Override
public String execute() throws Exception {
// let's push back admin property to user to save
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-06-19 10:18:41 UTC (rev 3522)
@@ -24,15 +24,16 @@
import com.google.common.base.Preconditions;
import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.interceptor.ParameterAware;
import org.chorem.pollen.business.persistence.PersonList;
import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
-import org.chorem.pollen.services.impl.FavoriteService;
import org.chorem.pollen.ui.actions.PageSkin;
import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.nuiton.util.StringUtil;
import java.util.Map;
@@ -108,6 +109,44 @@
}
}
+ @Override
+ public void validate() {
+
+ if ("create".equals(action)) {
+
+ PollAccount account = getCreatePollAccount();
+
+ if (StringUtils.isBlank(account.getVotingId())) {
+ addFieldError("createPollAccount.votingId",
+ _("pollen.error.pollAccount.votingId.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("createPollAccount.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("createPollAccount.email",
+ _("pollen.error.email.invalid"));
+ }
+ } else if ("edit".equals(action)) {
+
+ PollAccount account = getEditPollAccount();
+
+ if (StringUtils.isBlank(account.getVotingId())) {
+ addFieldError("editPollAccount.votingId",
+ _("pollen.error.pollAccount.votingId.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("editPollAccount.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("editPollAccount.email",
+ _("pollen.error.email.invalid"));
+ }
+ }
+ }
+
public String create() throws Exception {
Preconditions.checkNotNull(favoriteList);
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-06-19 10:18:41 UTC (rev 3522)
@@ -102,6 +102,18 @@
return PageSkin.EDITION;
}
+ @Override
+ public void validate() {
+
+ if ("create".equals(action)) {
+
+ if( StringUtils.isBlank(getCreateFavoriteList().getName())) {
+ addFieldError("createFavoriteList.name",
+ _("pollen.error.favoriteListName.required"));
+ }
+ }
+ }
+
public String create() throws Exception {
Preconditions.checkNotNull(favoriteList);
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-06-19 10:18:41 UTC (rev 3522)
@@ -22,11 +22,14 @@
*/
package org.chorem.pollen.ui.actions.user;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException;
import org.chorem.pollen.ui.actions.PageSkin;
import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.nuiton.util.StringUtil;
/**
* Register a new user.
@@ -63,6 +66,34 @@
}
@Override
+ public void validate() {
+
+ if (StringUtils.isBlank(user.getLogin())) {
+ addFieldError("user.login", _("pollen.error.login.required"));
+ }
+
+ if (StringUtils.isBlank(user.getPassword())) {
+ addFieldError("user.password", _("pollen.error.password.required"));
+ }
+
+ if (StringUtils.isBlank(getPassword2())) {
+ addFieldError("password2", _("pollen.error.password2.required"));
+ }
+
+ if (ObjectUtils.notEqual(getPassword2(), user.getPassword())) {
+ addFieldError("password2", _("pollen.error.passwords.not.equals"));
+ }
+
+ if (StringUtils.isBlank(user.getEmail())) {
+ addFieldError("user.email", _("pollen.error.email.required"));
+ }
+
+ if (!StringUtil.isEmail(user.getEmail())) {
+ addFieldError("user.email", _("pollen.error.email.invalid"));
+ }
+ }
+
+ @Override
public String execute() throws Exception {
String result = INPUT;
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp 2012-06-19 10:18:41 UTC (rev 3522)
@@ -30,7 +30,7 @@
<fieldset class="ui-widget-content ui-corner-all">
<s:hidden key="redirectUrl" label=''/>
- <s:hidden key="userId" value='%{user.topiaId}' label=''/>
+ <s:hidden key="userId" value='%{#user.topiaId}' label=''/>
<s:text name="pollen.information.confirmDeleteUser"/>
<div align="center" style="padding-top: 1em;">
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-06-19 10:18:41 UTC (rev 3522)
@@ -51,8 +51,8 @@
var deleteImg = '<s:url value='/img/delete.png'/>';
jQuery(document).ready(function () {
- initUsersPage("<s:property value='%{action}'/>",
- "<s:property value='%{user.topiaId}'/>");
+ initUsersPage("<s:property value='%{#action.action}'/>",
+ "<s:property value='%{#user.topiaId}'/>");
});
</script>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-06-19 10:18:41 UTC (rev 3522)
@@ -56,31 +56,6 @@
return false;
}
- var autoSelect = function () {
- var el = $(this)[0];
- if (/textarea/i.test(el.tagName) || (/input/i.test(el.tagName) && /text/i.test(el.type))) {
- el.select();
- } else if (!!window.getSelection) { // FF, Safari, Chrome, Opera
- var sel = window.getSelection();
- var range = document.createRange();
- range.selectNodeContents(el);
- sel.removeAllRanges();
- sel.addRange(range);
- } else if (!!document.selection) { // IE
- document.selection.empty();
- var range = document.body.createTextRange();
- range.moveToElementText(el);
- range.select();
- }
- };
-
- $(document).load(function() {
-
-
- $('.url').click(autoSelect);
-
- })
-
</script>
<h1 class="titleCreation"><s:property value="poll.title"/></h1>
@@ -194,3 +169,34 @@
</div>
<sj:dialog id="confirmDialog" autoOpen="false" modal="true" width="500"/>
+
+
+
+<script type="text/javascript">
+
+ var autoSelect = function () {
+ var el = $(this)[0];
+ if (/textarea/i.test(el.tagName) || (/input/i.test(el.tagName) && /text/i.test(el.type))) {
+ el.select();
+ } else if (!!window.getSelection) { // FF, Safari, Chrome, Opera
+ var sel = window.getSelection();
+ var range = document.createRange();
+ range.selectNodeContents(el);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ } else if (!!document.selection) { // IE
+ document.selection.empty();
+ var range = document.body.createTextRange();
+ range.moveToElementText(el);
+ range.select();
+ }
+ };
+
+ $(document).load(function() {
+
+
+ $('.url').click(autoSelect);
+
+ })
+
+</script>
\ No newline at end of file
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp 2012-06-19 10:18:41 UTC (rev 3522)
@@ -52,7 +52,7 @@
jQuery(document).ready(function () {
- initFavoritePage("<s:property value='%{action}'/>");
+ initFavoritePage("<s:property value='%{#action.action}'/>");
});
</script>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-06-19 08:53:57 UTC (rev 3521)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-06-19 10:18:41 UTC (rev 3522)
@@ -57,7 +57,7 @@
jQuery(document).ready(function () {
- initFavoritesPage("<s:property value='%{action}'/>");
+ initFavoritesPage("<s:property value='%{#action.action}'/>");
});
</script>
1
0
r3521 - trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 10:53:57 +0200 (Tue, 19 Jun 2012)
New Revision: 3521
Url: http://chorem.org/repositories/revision/pollen/3521
Log:
connected user is hidden
Modified:
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-06-19 08:52:49 UTC (rev 3520)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-06-19 08:53:57 UTC (rev 3521)
@@ -109,7 +109,7 @@
<s:if test="userExists">
<span class="menu_elt" onmouseover="$('#compte_menu').show()"
onmouseout="$('#compte_menu').hide()">
- <s:property value='%{user.displayName}'/>
+ <s:property value='%{#user.displayName}'/>
<div class="dropdown_menu" id="compte_menu" style="display: none;">
<div class="top_right<s:property value='%{pageLogo}'/>"></div>
<div class="top_left<s:property value='%{pageLogo}'/>"></div>
1
0
r3520 - trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll
by ymartel@users.chorem.org 19 Jun '12
by ymartel@users.chorem.org 19 Jun '12
19 Jun '12
Author: ymartel
Date: 2012-06-19 10:52:49 +0200 (Tue, 19 Jun 2012)
New Revision: 3520
Url: http://chorem.org/repositories/revision/pollen/3520
Log:
fix #596 : on image choice, only accept image/* mimetype file for upload
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-19 08:18:29 UTC (rev 3519)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-19 08:52:49 UTC (rev 3520)
@@ -891,7 +891,24 @@
addInformationsError(
choiceErrorField,
_("pollen.error.poll.imageChoice.upload.badContentType"));
- //TODO ymartel 2012/06/18
+ //Remove the file and its thumb
+ PollImageChoice imageChoice = (PollImageChoice) choice;
+ File imageFile = new File(imageChoice.getLocation());
+ File imageThumbFile = getPollService().getImageThumbFile(imageFile);
+ FileUtils.deleteQuietly(imageThumbFile);
+ FileUtils.deleteQuietly(imageFile);
+ // The choice has no more location
+ String choiceId = imageChoice.getTopiaId();
+ if (StringUtils.isBlank(choiceId)) {
+ imageChoice.setLocation(null);
+ // As the name of the choice is the fileName, remove it too.
+ imageChoice.setName(null);
+ } else {
+ // in case of update, get back the old values for name and location and keep the old choice
+ PollImageChoice pollChoice = (PollImageChoice) poll.getChoiceByTopiaId(choiceId);
+ imageChoice.setName(pollChoice.getName());
+ imageChoice.setLocation(pollChoice.getLocation());
+ }
continue;
}
}
1
0
r3519 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/json java/org/chorem/pollen/ui/actions/poll resources resources/config resources/i18n webapp/WEB-INF/decorators webapp/WEB-INF/jsp webapp/WEB-INF/jsp/admin webapp/WEB-INF/jsp/poll webapp/WEB-INF/jsp/security webapp/WEB-INF/jsp/user webapp/css webapp/js
by tchemit@users.chorem.org 19 Jun '12
by tchemit@users.chorem.org 19 Jun '12
19 Jun '12
Author: tchemit
Date: 2012-06-19 10:18:29 +0200 (Tue, 19 Jun 2012)
New Revision: 3519
Url: http://chorem.org/repositories/revision/pollen/3519
Log:
- refs #562: improve choice layout
- reformat jsp
- do not use jstl anyway in jsp (prefer use struts)
Added:
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp
Removed:
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/adminRequired.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml
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/resources/struts.xml
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.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/displayImageChoice.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPersonToList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComments.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayTextChoice.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingListPersons.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/security/connected_required.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/dialogLostPassword.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp
trunk/pollen-ui-struts2/src/main/webapp/css/pollCreation.css
trunk/pollen-ui-struts2/src/main/webapp/css/summary.css
trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js
trunk/pollen-ui-struts2/src/main/webapp/js/favoriteList.js
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-06-19 08:18:29 UTC (rev 3519)
@@ -30,7 +30,6 @@
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* Obtain paginated users.
@@ -84,28 +83,11 @@
Map<String, Object> map = pollService.pollToMap(poll, binder);
map.put("adminId", poll.getAdminId());
-
- Set<String> functions = getPollFunctions(poll);
- map.put("functions", functions);
+ map.put("functions", Sets.newHashSet("summary"));
polls[index++] = map;
}
return SUCCESS;
}
- protected Set<String> getPollFunctions(Poll poll) {
- Set<String> result = Sets.newHashSet();
- result.add("summary");
-// result.add("result");
-// if (!poll.isClosed()) {
-//
-// // poll is not closed
-// result.add("edit");
-// result.add("close");
-// }
-// result.add("export");
-// result.add("clone");
- result.add("delete");
- return result;
- }
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-19 08:18:29 UTC (rev 3519)
@@ -181,6 +181,13 @@
private Map<Integer, Choice> choices;
/**
+ * Contains the order of choices (given by the xxx.order field.
+ *
+ * @since 1.4
+ */
+ private Map<Integer, Integer> choicesOrder;
+
+ /**
* Indexed voting lists retreive from parameters for the pollType selected
* in form. (Other voting lists are lost).
*
@@ -250,6 +257,8 @@
ChoiceType pollChoiceType = ChoiceType.valueOf(choiceTypeParam);
poll.setChoiceType(pollChoiceType);
+ choicesOrder = Maps.newTreeMap();
+
// build poll choices
switch (pollChoiceType) {
@@ -1356,20 +1365,26 @@
// can keep this none empty text choice name
Integer choiceNumber = Integer.valueOf(matcher.group(1));
+
if (choiceNumber > maxNumber) {
maxNumber = choiceNumber;
}
+ String choicePrefix = fieldPrefix + choiceNumber;
Choice choice = createChoice(new ChoiceImpl(),
- fieldPrefix + choiceNumber,
+ choicePrefix,
paramValue);
if (!isTextChoiceEmpty(choice)) {
// This is not an empty choice keep it
result.put(choiceNumber, choice);
+
+ // keep order
+ int order = getIntegerValue(choicePrefix + ".order");
+ choicesOrder.put(order, choiceNumber);
}
}
}
- result = reindexMap(result, maxNumber);
+ result = reindexChoiceMap(result, maxNumber);
int size = result.size();
if (log.isInfoEnabled()) {
@@ -1400,10 +1415,10 @@
if (choiceNumber > maxNumber) {
maxNumber = choiceNumber;
}
- String choiceFieldPrefix = fieldPrefix + choiceNumber;
+ String choicePrefix = fieldPrefix + choiceNumber;
PollDateChoice choice = createChoice(new PollDateChoice(),
- choiceFieldPrefix,
+ choicePrefix,
paramValue);
if (StringUtils.isNotBlank(paramValue)) {
Date date = DateConverter.convertFromString(paramValue);
@@ -1414,10 +1429,14 @@
// This is not an empty choice keep it
result.put(choiceNumber, choice);
+
+ // keep order
+ int order = getIntegerValue(choicePrefix + ".order");
+ choicesOrder.put(order, choiceNumber);
}
}
}
- result = reindexMap(result, maxNumber);
+ result = reindexChoiceMap(result, maxNumber);
int size = result.size();
if (log.isInfoEnabled()) {
@@ -1451,13 +1470,13 @@
maxNumber = choiceNumber;
}
- String choiceFieldPrefix = fieldPrefix + choiceNumber;
+ String choicePrefix = fieldPrefix + choiceNumber;
PollImageChoice choice = createChoice(new PollImageChoice(),
- choiceFieldPrefix,
+ choicePrefix,
null);
String location = getNonEmptyParameterValue(
- choiceFieldPrefix + ".newLocation");
+ choicePrefix + ".newLocation");
if (StringUtils.isNotBlank(location)) {
// found a real upload file (not jus the location of an
@@ -1466,24 +1485,24 @@
// ok so now use also newName
String paramValue = getNonEmptyParameterValue(
- choiceFieldPrefix + ".newName");
+ choicePrefix + ".newName");
choice.setName(paramValue);
- parametersToSwitch.put(choiceFieldPrefix + ".newLocation",
- choiceFieldPrefix + ".location");
+ parametersToSwitch.put(choicePrefix + ".newLocation",
+ choicePrefix + ".location");
- parametersToSwitch.put(choiceFieldPrefix + ".newName",
- choiceFieldPrefix + ".name");
+ parametersToSwitch.put(choicePrefix + ".newName",
+ choicePrefix + ".name");
} else {
// try with old location
location = getNonEmptyParameterValue(
- choiceFieldPrefix + ".location");
+ choicePrefix + ".location");
choice.setLocation(location);
String paramValue = getNonEmptyParameterValue(
- choiceFieldPrefix + ".name");
+ choicePrefix + ".name");
choice.setName(paramValue);
}
@@ -1491,6 +1510,10 @@
// This is not an empty choice keep it
result.put(choiceNumber, choice);
+
+ // keep order
+ int order = getIntegerValue(choicePrefix + ".order");
+ choicesOrder.put(order, choiceNumber);
}
}
}
@@ -1502,7 +1525,7 @@
String[] valueToSwitch = parameters.remove(paramNameSource);
parameters.put(paramNameTarget, valueToSwitch);
}
- result = reindexMap(result, maxNumber);
+ result = reindexChoiceMap(result, maxNumber);
int size = result.size();
if (log.isInfoEnabled()) {
log.info("nbImageChoices (from request) = " + size);
@@ -1590,6 +1613,24 @@
return result;
}
+ private int getIntegerValue(String parameterName) {
+ String parameterValue = getNonEmptyParameterValue(parameterName);
+ int result = 0;
+ if (StringUtils.isNotEmpty(parameterValue)) {
+
+ try {
+ result = Integer.valueOf(parameterValue);
+ } catch (NumberFormatException e) {
+ //bad conversion, will be treated later
+ if (log.isDebugEnabled()) {
+ log.debug("Bad double conversion from param [" +
+ parameterName + "] : " + parameterValue);
+ }
+ }
+ }
+ return result;
+ }
+
private int buildVotingList(String votingListParameterName,
String votingListPrefix,
int votingListNumber,
@@ -1737,6 +1778,40 @@
return result2;
}
+ protected <T> Map<Integer, T> reindexChoiceMap(Map<Integer, T> result, int maxNumber) {
+ Map<Integer, T> result2 = Maps.newTreeMap();
+
+ for (Integer choiceOrder : choicesOrder.keySet()) {
+ Integer choiceNumber = choicesOrder.get(choiceOrder);
+ T choice = result.get(choiceNumber );
+ if (choice != null) {
+ result2.put(choiceOrder, choice);
+ }
+ }
+
+// if (maxNumber != result.size() - 1) {
+//
+// // means there is a hole inside the result (a empty choice was
+// // submitted)
+//
+// // le'ts remove this
+// List<Integer> numbers = Lists.newArrayList(result.keySet());
+//
+// Collections.sort(numbers);
+//
+// result2 = Maps.newTreeMap();
+// int i = 0;
+// for (Integer number : numbers) {
+// T choice = result.get(number);
+// result2.put(i++, choice);
+// }
+// } else {
+// result2 = result;
+// }
+ return result2;
+ }
+
+
protected String getNonEmptyParameterValue(String paramName) {
String[] paramValues = parameters.get(paramName);
String result = null;
Modified: trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-06-19 08:18:29 UTC (rev 3519)
@@ -37,46 +37,37 @@
<param name="actionName">votefor/${uriId}</param>
</result-type>
+ <result-type name="redirectToSummary"
+ class="org.chorem.pollen.ui.results.PollenServletActionRedirectResult">
+ <param name="namespace">/poll</param>
+ <param name="actionName">summary/${uriId}</param>
+ </result-type>
+
</result-types>
<!-- create poll -->
<action name="create" class="org.chorem.pollen.ui.actions.poll.CreatePoll"
method="execute">
- <result name="input">/WEB-INF/jsp/poll/create.jsp</result>
- <result type="pollenRedirectAction">
- <param name="namespace">/poll</param>
- <param name="actionName">summary/${uriId}</param>
- </result>
+ <result name="input">/WEB-INF/jsp/poll/pollForm.jsp</result>
+ <result type="redirectToSummary"/>
</action>
<!-- edit poll -->
<action name="edit/*" class="org.chorem.pollen.ui.actions.poll.EditPoll"
method="execute">
<param name="uriId">{1}</param>
- <result name="input">/WEB-INF/jsp/poll/create.jsp</result>
- <result type="pollenRedirectAction">
- <param name="namespace">/poll</param>
- <param name="actionName">summary/${uriId}</param>
- </result>
+ <result name="input">/WEB-INF/jsp/poll/pollForm.jsp</result>
+ <result type="redirectToSummary"/>
</action>
<!-- clone poll -->
<action name="clone/*" class="org.chorem.pollen.ui.actions.poll.ClonePoll"
method="execute">
<param name="uriId">{1}</param>
- <result name="input">/WEB-INF/jsp/poll/create.jsp</result>
- <result type="pollenRedirectAction">
- <param name="namespace">/poll</param>
- <param name="actionName">summary/${uriId}</param>
- </result>
+ <result name="input">/WEB-INF/jsp/poll/pollForm.jsp</result>
+ <result type="redirectToSummary"/>
</action>
- <!-- display * -->
- <action name="display*"
- class="org.chorem.pollen.ui.actions.poll.Display{1}">
- <result>/WEB-INF/jsp/poll/display{1}.jsp</result>
- </action>
-
<!-- resume poll -->
<action name="summary/*" method="execute"
class="org.chorem.pollen.ui.actions.poll.SummaryPoll">
@@ -126,19 +117,6 @@
<result type="redirect2"/>
</action>
- <!-- display poll result -->
- <action name="results/*" method="execute"
- class="org.chorem.pollen.ui.actions.poll.ResultForPoll">
- <param name="uriId">{1}</param>
- <result>/WEB-INF/jsp/poll/result.jsp</result>
- </action>
-
- <!-- confirm delete comment -->
- <action name="confirmDeleteComment"
- class="org.chorem.pollen.ui.actions.poll.ConfirmDeleteComment">
- <result>/WEB-INF/jsp/poll/confirmDeletePollComment.jsp</result>
- </action>
-
<!-- vote poll -->
<action name="vote/*" method="execute"
class="org.chorem.pollen.ui.actions.poll.VoteForPoll">
@@ -184,14 +162,24 @@
<result name="input">/WEB-INF/jsp/poll/vote.jsp</result>
</action>
- <!-- add a choice -->
- <action name="addChoice/*"
- class="org.chorem.pollen.ui.actions.poll.AddChoice">
- <param name="uriId">{1}</param>
- <result name="input">/WEB-INF/jsp/poll/vote.jsp</result>
+ <!-- edit poll vote -->
+ <action name="editVote"
+ class="org.chorem.pollen.ui.actions.poll.EditVote">
<result type="redirectToVote"/>
</action>
+ <!-- confirm delete poll vote -->
+ <action name="confirmDeleteVote"
+ class="org.chorem.pollen.ui.actions.poll.ConfirmDeleteVote">
+ <result>/WEB-INF/jsp/poll/confirmDeletePollVote.jsp</result>
+ </action>
+
+ <!-- delete poll vote -->
+ <action name="deleteVote"
+ class="org.chorem.pollen.ui.actions.poll.DeleteVote">
+ <result type="redirectToVote"/>
+ </action>
+
<!-- add a poll comment -->
<action name="addComment/*"
class="org.chorem.pollen.ui.actions.poll.AddComment">
@@ -200,41 +188,26 @@
<result type="redirectToVote"/>
</action>
+ <!-- confirm delete comment -->
+ <action name="confirmDeleteComment"
+ class="org.chorem.pollen.ui.actions.poll.ConfirmDeleteComment">
+ <result>/WEB-INF/jsp/poll/confirmDeletePollComment.jsp</result>
+ </action>
+
<!-- delete a poll comment -->
<action name="deleteComment"
class="org.chorem.pollen.ui.actions.poll.DeleteComment">
<result type="redirectToVote"/>
</action>
- <!-- get the feed of a given poll -->
- <action name="getFeed"
- class="org.chorem.pollen.ui.actions.poll.GetPollFeed">
- <result type="stream">
- <param name="contentCharSet">UTF-8</param>
- <param name="contentType">application/atom+xml</param>
- <param name="encode">true</param>
- <param name="bufferSize">4096</param>
- </result>
- </action>
-
- <!-- confirm delete poll vote -->
- <action name="confirmDeleteVote"
- class="org.chorem.pollen.ui.actions.poll.ConfirmDeleteVote">
- <result>/WEB-INF/jsp/poll/confirmDeletePollVote.jsp</result>
- </action>
-
- <!-- delete poll vote -->
- <action name="deleteVote"
- class="org.chorem.pollen.ui.actions.poll.DeleteVote">
+ <!-- add a choice -->
+ <action name="addChoice/*"
+ class="org.chorem.pollen.ui.actions.poll.AddChoice">
+ <param name="uriId">{1}</param>
+ <result name="input">/WEB-INF/jsp/poll/vote.jsp</result>
<result type="redirectToVote"/>
</action>
- <!-- edit poll vote -->
- <action name="editVote"
- class="org.chorem.pollen.ui.actions.poll.EditVote">
- <result type="redirectToVote"/>
- </action>
-
<!-- confirm delete poll choice -->
<action name="confirmDeleteChoice"
class="org.chorem.pollen.ui.actions.poll.ConfirmDeleteChoice">
@@ -247,6 +220,30 @@
<result type="redirectToVote"/>
</action>
+ <!-- display * -->
+ <action name="display*"
+ class="org.chorem.pollen.ui.actions.poll.Display{1}">
+ <result>/WEB-INF/jsp/poll/display{1}.jsp</result>
+ </action>
+
+ <!-- display poll result -->
+ <action name="results/*" method="execute"
+ class="org.chorem.pollen.ui.actions.poll.ResultForPoll">
+ <param name="uriId">{1}</param>
+ <result>/WEB-INF/jsp/poll/result.jsp</result>
+ </action>
+
+ <!-- get the feed of a given poll -->
+ <action name="getFeed"
+ class="org.chorem.pollen.ui.actions.poll.GetPollFeed">
+ <result type="stream">
+ <param name="contentCharSet">UTF-8</param>
+ <param name="contentType">application/atom+xml</param>
+ <param name="encode">true</param>
+ <param name="bufferSize">4096</param>
+ </result>
+ </action>
+
<!-- Select a favorite list to add to a voting list -->
<action name="selectPersonListToAddToVotingList"
class="org.chorem.pollen.ui.actions.poll.SelectPersonListToVotingList">
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-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-06-19 08:18:29 UTC (rev 3519)
@@ -11,7 +11,9 @@
pollen.action.backToFavoriteLists=Back to favorite lists
pollen.action.cancel=Cancel
pollen.action.clone=Clone poll
+pollen.action.clonePoll.help=Cloner this poll
pollen.action.close=Close the poll
+pollen.action.closePoll.help=Close this poll
pollen.action.create=Create
pollen.action.createFavoriteList=Create a new list
pollen.action.createPoll=Create the poll
@@ -21,14 +23,17 @@
pollen.action.deleteChoice=Delete the choice
pollen.action.deleteFavoriteList=Delete a list
pollen.action.deletePoll=Delete the poll
+pollen.action.deletePoll.help=Delete this poll
pollen.action.deletePollAccount=Delete selected member
pollen.action.deleteUser=Delete selected user
pollen.action.deleteVote=Delete this vote
pollen.action.editFavoriteList=Edit a list
pollen.action.editPoll=Edit the poll
+pollen.action.editPoll.help=Edit this poll
pollen.action.editPollAccount=Edit selected member
pollen.action.editUser=Edit selected user
pollen.action.editVote=Modifier le vote
+pollen.action.exportPoll.help=Export this poll (xml format)
pollen.action.importPersonListToExistingVotingList=Add selected voting list
pollen.action.importPersonListToNewVotingList=Create a new group from the selected voting list
pollen.action.login=Log me In
@@ -44,8 +49,10 @@
pollen.action.pollEdit=Edit poll
pollen.action.pollExport=Export poll
pollen.action.pollModerateVote=Administrate votes
+pollen.action.pollModerateVote.help=Moderate votes and comments for this poll
pollen.action.pollPersonToListDelete=Delete this voter
pollen.action.pollResult=Display poll results
+pollen.action.pollResult.help=vote count and display results for this poll
pollen.action.pollSummary=Poll summary
pollen.action.pollVote=Vote
pollen.action.pollVotingListDelete=Delete the voting list
@@ -54,6 +61,7 @@
pollen.action.send=Send
pollen.action.summaryPoll=Goto administration page of the poll
pollen.action.validate=Submit
+pollen.action.voteAction.help=Share this link with people to vote
pollen.banner.newVersion=New version\!
pollen.common.aboutPoll=About the poll
pollen.common.addingChoices=Adding choices
@@ -287,15 +295,15 @@
pollen.information.vote.deleted=Vote deleted.
pollen.information.your.are.loggued=You are logged.
pollen.label.contact.administrator=Send an email to an administrator
-pollen.label.pollClonePage=<strong>Clone your poll</strong>
-pollen.label.pollClosePage=<strong>Close your poll</strong>
-pollen.label.pollDeletePage=<strong>Delete your poll</strong>
-pollen.label.pollEditPage=<strong>To modify your poll</strong>. Save it to be able to modify your poll later if you need it or to close it\:
-pollen.label.pollExportPage=<strong>Export your poll</strong>
-pollen.label.pollModerateVotePage=<strong>To moderate your poll (you can't vote from this url)</strong>. Save it to be able to delete votes and comments\:
+pollen.label.pollClonePage=Clone your poll
+pollen.label.pollClosePage=Close your poll
+pollen.label.pollDeletePage=Delete your poll
+pollen.label.pollEditPage=Edit your poll
+pollen.label.pollExportPage=Export your poll
+pollen.label.pollModerateVotePage=Moderate your poll
pollen.label.pollRegisterPage=If you are a logged user, you can find these links on the page
-pollen.label.pollResultPage=<strong>To count the vote</strong>.Save it to be able to count the vote later\:
-pollen.label.pollVotePage=<strong>To vote on your poll</strong>. Save it and send it to the people that you want to vote\:
+pollen.label.pollResultPage=Count votes
+pollen.label.pollVotePage=Vote on your poll
pollen.legend.attachPoll=Attach an anonymous poll to your user account
pollen.legend.login=Login
pollen.legend.select.favoriteList.to.add=Sélectionner la liste de favoris à ajouter
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-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-06-19 08:18:29 UTC (rev 3519)
@@ -11,7 +11,9 @@
pollen.action.backToFavoriteLists=Retour à la liste des favoris
pollen.action.cancel=Annuler
pollen.action.clone=Cloner le sondage
+pollen.action.clonePoll.help=Cloner ce sondage
pollen.action.close=Fermer le sondage
+pollen.action.closePoll.help=Fermer ce sondage
pollen.action.create=Créer
pollen.action.createFavoriteList=Créer une ouvelle liste
pollen.action.createPoll=Créer le sondage
@@ -21,14 +23,17 @@
pollen.action.deleteChoice=Supprimer le choix
pollen.action.deleteFavoriteList=Supprimer une liste sélectionnée
pollen.action.deletePoll=Supprimer le sondage
+pollen.action.deletePoll.help=Supprimer ce sondage
pollen.action.deletePollAccount=Supprimer une membre de la liste
pollen.action.deleteUser=Supprimer un utilisateur sélectionné
pollen.action.deleteVote=Supprimer ce vote
pollen.action.editFavoriteList=Editer une liste sélectionnée
pollen.action.editPoll=Modifier le sondage
+pollen.action.editPoll.help=Éditer ce sondage
pollen.action.editPollAccount=Editer le membre sélectionné
pollen.action.editUser=Editer un utilisateur sélectionné
pollen.action.editVote=Modifier le vote
+pollen.action.exportPoll.help=Exporter ce sondage au format xml
pollen.action.importPersonListToExistingVotingList=Ajouter la liste sélectionnée de votants
pollen.action.importPersonListToNewVotingList=Créer un groupe à partir de la liste sélectionnée
pollen.action.login=M'identifier
@@ -44,8 +49,10 @@
pollen.action.pollEdit=Editer le sondage
pollen.action.pollExport=Exporter le sondage
pollen.action.pollModerateVote=Administrer les votes
+pollen.action.pollModerateVote.help=Modérer les votes et commentaires du sondage
pollen.action.pollPersonToListDelete=Supprimer ce votant
pollen.action.pollResult=Afficher les résultats du sondage
+pollen.action.pollResult.help=Dépouiller et afficher les résultats du sondage
pollen.action.pollSummary=Résumé du sondage
pollen.action.pollVote=Voter
pollen.action.pollVotingListDelete=Supprimer le groupe de votants
@@ -54,6 +61,7 @@
pollen.action.send=Envoyer
pollen.action.summaryPoll=Aller sur la page d'administration du sondage
pollen.action.validate=Valider
+pollen.action.voteAction.help=Partager ce lien avec ceux que vous voulez voir voter
pollen.banner.newVersion=Nouvelle version \!
pollen.common.aboutPoll=A propos du sondage
pollen.common.addingChoices=Ajout des choix
@@ -287,15 +295,15 @@
pollen.information.vote.deleted=Vote supprimé.
pollen.information.your.are.loggued=Vous êtes connecté.
pollen.label.contact.administrator=Contacter un administrateur
-pollen.label.pollClonePage=<strong>Cloner le sondage</strong>
-pollen.label.pollClosePage=<strong>Fermer le sondage</strong>
-pollen.label.pollDeletePage=<strong>Supprimer le sondage</strong>
-pollen.label.pollEditPage=<strong>Lien pour configurer le sondage</strong>. Enregistrez-le pour pouvoir modifier votre sondage au besoin ou le clore \:
-pollen.label.pollExportPage=<strong>Exporter le sondage</strong>
-pollen.label.pollModerateVotePage=<strong>Lien pour modérer le sondage (ce lien ne permet pas de voter)</strong>. Enregistrez-le pour pouvoir supprimer des votes et commentaires \:
+pollen.label.pollClonePage=Cloner le sondage
+pollen.label.pollClosePage=Fermer le sondage
+pollen.label.pollDeletePage=Supprimer le sondage
+pollen.label.pollEditPage=Configurer le sondage
+pollen.label.pollExportPage=Exporter le sondage
+pollen.label.pollModerateVotePage=Modérer le sondage
pollen.label.pollRegisterPage=Si vous êtes un utilisateur identifié, vous pouvez retrouver ces liens dans la page
-pollen.label.pollResultPage=<strong>Lien pour dépouiller le sondage</strong>. Enregistrez-le pour pouvoir accéder au dépouillement plus tard \:
-pollen.label.pollVotePage=<strong>Lien pour voter</strong>. Enregistrez-le et envoyez-le à ceux que vous voulez voir voter \:
+pollen.label.pollResultPage=Dépouiller le sondage
+pollen.label.pollVotePage=Voter
pollen.legend.attachPoll=Attacher un sondage anonyme à votre compte
pollen.legend.login=Login
pollen.legend.select.favoriteList.to.add=Sélectionner la liste de favoris à ajouter
Modified: trunk/pollen-ui-struts2/src/main/resources/struts.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/struts.xml 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/resources/struts.xml 2012-06-19 08:18:29 UTC (rev 3519)
@@ -121,14 +121,6 @@
<default-class-ref
class="org.chorem.pollen.ui.actions.PollenActionSupport"/>
- <action name="notLoggued">
- <result>/WEB-INF/jsp/user/login.jsp</result>
- </action>
-
- <action name="notAdmin">
- <result>/WEB-INF/jsp/adminRequired.jsp</result>
- </action>
-
<!-- go to home -->
<action name="home"
class="org.chorem.pollen.ui.actions.PollenActionSupport">
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -44,7 +44,9 @@
<%-- TODO AThimel 24/01/2012 Remove this when refactoring is over --%>
<div id="in-progress">
- <a href="http://chorem.org/projects/pollen"><s:text name="pollen.banner.newVersion"/></a>
+ <a href="http://chorem.org/projects/pollen">
+ <s:text name="pollen.banner.newVersion"/>
+ </a>
</div>
@@ -72,10 +74,10 @@
<s:set var="userExists" value="%{#user != null}"/>
<s:set var="userIsAdmin" value="%{#userExists && #user.administrator}"/>
-<body id="${pageLogo}Body">
+<body id="<s:property value="%{pageLogo}"/>Body">
<!-- Langue -->
-<div id="po-header-localization" class="${pageLogo}Localization">
+<div id="po-header-localization" class="<s:property value='%{pageLogo}'/>Localization">
<s:a title="Contacter un administrateur"
href="mailto:%{configuration.adminEmail}">
<img src="<s:url value='/img/contact.png' />" alt="Contact"/>
@@ -100,18 +102,18 @@
</s:a>
</p>
-<div id="top" class="${pageLogo}">
+<div id="top" class="<s:property value="%{pageLogo}"/>">
<!-- Login -->
- <div id="po-header-connection" class="${pageLogo}">
+ <div id="po-header-connection" class="<s:property value='%{pageLogo}'/>">
<s:if test="userExists">
<span class="menu_elt" onmouseover="$('#compte_menu').show()"
onmouseout="$('#compte_menu').hide()">
- ${user.displayName}
+ <s:property value='%{user.displayName}'/>
<div class="dropdown_menu" id="compte_menu" style="display: none;">
- <div class="top_right${pageLogo}"></div>
- <div class="top_left${pageLogo}"></div>
- <ul class="top_middle${pageLogo}">
+ <div class="top_right<s:property value='%{pageLogo}'/>"></div>
+ <div class="top_left<s:property value='%{pageLogo}'/>"></div>
+ <ul class="top_middle<s:property value='%{pageLogo}'/>">
<li>
<s:a action="show" namespace="/user">
<s:text name="pollen.menu.preferences"/>
@@ -132,26 +134,27 @@
</span>
<div class="dropdown_menu" id="login_menu" style="display: none;">
- <div class="top_right${pageLogo}"></div>
- <div class="top_left${pageLogo}"></div>
+ <div class="top_right<s:property value='%{pageLogo}'/>"></div>
+ <div class="top_left<s:property value='%{pageLogo}'/>"></div>
<sj:dialog id="lostPasswordDialog" autoOpen="false" modal="true" width="500"/>
<s:form id="connection" method="POST" namespace="/user" action="login">
<s:hidden name="redirectUrl" value="%{currentUrl}"/>
- <ul class="top_middle${pageLogo}">
+ <ul class="top_middle<s:property value='%{pageLogo}'/>">
<li>
<label for="connection_login">
<s:text name="pollen.common.login"/> :
</label>
<s:textfield key="login" size="10" required="true" theme="simple"
- label=''/>
+ label='' id='connection_login'/>
</li>
<li>
<label for="connection_password">
<s:text name="pollen.common.password"/> :
</label>
<s:password key="password" size="10" required="true"
+ id='connection_password'
label="" theme="simple"/>
</li>
<li>
@@ -186,9 +189,9 @@
<a><s:text name="pollen.menu.polls"/></a>
<div class="dropdown_menu" id="menu1" style="display:none">
- <div class="top_right${pageLogo}"></div>
- <div class="top_left${pageLogo}"></div>
- <ul class="top_middle${pageLogo}">
+ <div class="top_right<s:property value='%{pageLogo}'/>"></div>
+ <div class="top_left<s:property value='%{pageLogo}'/>"></div>
+ <ul class="top_middle<s:property value='%{pageLogo}'/>">
<li>
<s:a action="create" namespace="/poll">
<s:text name="pollen.menu.createPoll"/>
@@ -226,9 +229,9 @@
<a><s:text name="pollen.menu.admin"/></a>
<div class="dropdown_menu" id="menu2" style="display:none">
- <div class="top_right${pageLogo}"></div>
- <div class="top_left${pageLogo}"></div>
- <ul class="top_middle${pageLogo}">
+ <div class="top_right<s:property value='%{pageLogo}'/>"></div>
+ <div class="top_left<s:property value='%{pageLogo}'/>"></div>
+ <ul class="top_middle<s:property value='%{pageLogo}'/>">
<li>
<s:a action="pollsList" namespace="/admin">
<s:text name="pollen.menu.managePolls"/>
@@ -252,7 +255,7 @@
<div id="corps">
<!-- Barre d'adresse -->
- <div id="po-header-addressBar" class="${pageLogo}Address">
+ <div id="po-header-addressBar" class="<s:property value='%{pageLogo}'/>Address">
<%--<t:loop t:source="addressBar.items" t:value="item">--%>
<%-->--%>
<%--<strong>--%>
@@ -267,7 +270,7 @@
</div>
<!-- Contenu -->
- <div id="${pageBodyId}" class="content">
+ <div id="<s:property value='%{pageBobyId}'/>" class="content">
<noscript>
<%--<div t:type="nuiton/feedback" t:id="errorJs" />--%>
</noscript>
@@ -306,7 +309,7 @@
</div>
<!-- Pied de page -->
-<div id="po-footer" class="${pageLogo}" xml:space="preserve">
+<div id="po-footer" class="<s:property value='%{pageLogo}'/>" xml:space="preserve">
<a href="http://maven-site.chorem.org/pollen">Pollen</a>
<a href="http://www.chorem.org/projects/pollen/files">
<%=PollenActionSupport.getApplicationVersion()%>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -26,11 +26,13 @@
<script type="text/javascript">
var redirectUrl = '<s:url namespace="/admin" action="pollsList"/>';
</script>
-<%@include file="/WEB-INF/jsp/pollListHelper.jsp"%>
+<%@include file="/WEB-INF/jsp/pollListHelper.jsp" %>
<title><s:text name="pollen.title.pollsList"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsList"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.pollsList"/>
+</h1>
<s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/>
@@ -45,10 +47,13 @@
rowList="10,15,20,50,100" rowNum="10">
<sjg:gridColumn name="id" title="id" hidden="true"/>
- <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}' />
- <sjg:gridColumn name="description" title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices" title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate" title='%{getText("pollen.common.beginDate")}'/>
+ <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
+ <sjg:gridColumn name="description"
+ title='%{getText("pollen.common.description")}'/>
+ <sjg:gridColumn name="addingChoices"
+ title='%{getText("pollen.common.addingChoices")}'/>
+ <sjg:gridColumn name="beginDate"
+ title='%{getText("pollen.common.beginDate")}'/>
<sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="55" sortable="false"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -32,7 +32,9 @@
<title><s:text name="pollen.title.usersList"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.usersList"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.usersList"/>
+</h1>
<s:url id="loadUsers" action="getUsers" namespace="/json" escapeAmp="false"/>
@@ -49,7 +51,8 @@
var deleteImg = '<s:url value='/img/delete.png'/>';
jQuery(document).ready(function () {
- initUsersPage('${action}', '${user.topiaId}');
+ initUsersPage("<s:property value='%{action}'/>",
+ "<s:property value='%{user.topiaId}'/>");
});
</script>
Deleted: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/adminRequired.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/adminRequired.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/adminRequired.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -1,31 +0,0 @@
-<%--
- #%L
- Pollen :: UI (struts2)
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-
-<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<br/>
-
-<div>
- La page demandé n'est accessible que par un administrateur.
-</div>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -27,13 +27,16 @@
<br/>
<div class="center" style="margin-bottom:20px;">
- <img src="<s:url value='/img/pollen_%{safeLanguage}.png' />" alt="Pollen logo"/>
+ <img src="<s:url value='/img/pollen_%{safeLanguage}.png' />"
+ alt="Pollen logo"/>
</div>
<div class="center">
<s:a action="create" namespace="/poll">
- <img src="<s:url value='/img/smallCreation_%{safeLanguage}.png' />" alt="poll creation"/>
+ <img src="<s:url value='/img/smallCreation_%{safeLanguage}.png' />"
+ alt="poll creation"/>
</s:a>
<img src="<s:url value='/img/smallVote_%{safeLanguage}.png' />" alt="vote"/>
- <img src="<s:url value='/img/smallVoteCounting_%{safeLanguage}.png' />" alt="voteCounting"/>
+ <img src="<s:url value='/img/smallVoteCounting_%{safeLanguage}.png' />"
+ alt="voteCounting"/>
</div>
Deleted: 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-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -1,353 +0,0 @@
-<%--
- #%L
- Pollen :: UI (struts2)
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@ 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'/>"/>
-
-<script type="text/javascript">
-
- $(document).data(
- {
- selectPersonListToAddToVotingListTitle:'<s:text name="pollen.title.selectPersonListToAddVotingList"/>',
- selectPersonListToCreateNewVotingListTitle:'<s:text name="pollen.title.selectPersonListToCreateVotingList"/>',
-
- votingListText:'<s:text name="pollen.common.votingList"/>',
- personToListText:'<s:text name="pollen.common.personToList"/>',
- choiceText:'<s:text name="pollen.common.choice"/>',
-
- displayVotingListUrl:'<s:url namespace="/poll" action="displayVotingList"/>',
- displayPersonToListUrl:'<s:url namespace="/poll" action="displayPersonToList"/>',
- importPersonListToVotingListUrl:'<s:url namespace="/poll" action="importPersonListToVotingList"/>',
- importPersonListToNewVotingListUrl:'<s:url namespace="/poll" action="importPersonListToNewVotingList"/>',
- displayImageChoiceUrl:'<s:url namespace="/poll" action="displayImageChoice"/>',
- displayDateChoiceUrl:'<s:url namespace="/poll" action="displayDateChoice"/>',
- displayTextChoiceUrl:'<s:url namespace="/poll" action="displayTextChoice"/>',
- selectPersonListToAddToVotingListUrl:'<s:url action="selectPersonListToAddToVotingList" namespace="/poll"/>',
- selectPersonListToCreateNewVotingListUrl:'<s:url action="selectPersonListToCreateNewVotingList" namespace="/poll"/>',
-
- choiceAddAllowed:'<s:property value="%{poll.choiceAddAllowed}"/>',
- limitChoice:'<s:property value="%{limitChoice}"/>',
- reminder:'<s:property value="%{reminder}"/>',
- publicOption:'<s:property value="%{poll.publicResults}"/>',
- anonymousOption:'<s:property value="%{poll.anonymous}"/>',
- voteCountingType:'<s:property value="%{poll.voteCountingType.name()}"/>',
- choiceType:'<s:property value="%{poll.choiceType.name()}"/>',
- pollType:'<s:property value="%{poll.pollType.name()}"/>',
- confirmCloseTitle:"<s:text name='pollen.title.close.poll'/>",
- confirmCloseUrl:'<s:url action="confirmClosePoll/%{poll.adminId}" namespace="/poll"/>',
- confirmCloseRedirectUrl:'<s:url action="summary/%{poll.adminId}" namespace="/poll"/>'
- }
- );
-</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>
-
-<s:url id='errorImg' value='/img/exclamation.png'/>
-
-<title>
- <s:if test="edit">
- <s:text name="pollen.title.editPoll"/>
- </s:if>
- <s:else>
- <s:text name="pollen.title.createPoll"/>
- </s:else>
-</title>
-
-<h1 class="title${pageLogo}"><s:property value="%{pageTitle}"/></h1>
-
-<s:form method="POST" id="registerForm" namespace="/poll"
- enctype="multipart/form-data">
-
- <s:hidden key="poll.topiaId" label=""/>
-
- <sj:tabbedpanel id="formTabs" selectedTab="%{selectedTab}">
-
- <sj:tab id="tabGeneral" target="tgeneral" key="pollen.tab.poll.general"/>
- <sj:tab id="tabOptions" target="toptions" key="pollen.tab.poll.options"/>
-
- <div id="tgeneral">
-
- <fieldset>
-
- <s:textfield key="poll.title" label="%{getText('pollen.common.title')}"
- required="true" size="80"/>
- <s:textarea key="poll.description" rows="3" cols="54"
- label="%{getText('pollen.common.description')}"/>
- <s:hidden key="poll.pollId" label=""/>
- </fieldset>
-
- <br/>
-
- <fieldset class="disableForVoteStarted">
- <legend>
- <s:text name="pollen.common.voteCountingType"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- alt="<s:text name='pollen.common.voteCountingType.help'/>"
- title="<s:text name='pollen.common.voteCountingType.help'/>"/>
- </legend>
- <s:radio key='poll.voteCountingType' list="voteCountingTypes"
- label='' theme="simple"/>
- </fieldset>
- <br/>
-
- <%@include file="createPoll_choices.jsp" %>
-
- </div>
-
- <div id="toptions">
-
- <fieldset>
- <legend>
- <s:text name="pollen.fieldset.creator.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.creator.options.help'/>"
- alt="<s:text name='pollen.fieldset.creator.options.help'/>"/>
- </legend>
- <s:textfield key="poll.creator.votingId" size="80"
- label="%{getText('pollen.common.login')}"/>
- <s:textfield key="poll.creator.email" size="80"
- label="%{getText('pollen.common.email')}"/>
- <s:hidden key="poll.creator.accountId" label=""/>
- <s:hidden key="poll.creator.topiaId" label=""/>
- <s:if test="creatorUserAccountDefined">
- <s:hidden name="userId" value="%{poll.creator.userAccount.topiaId}"/>
- </s:if>
- </fieldset>
- <br/>
-
- <fieldset>
- <legend>
- <s:text name="pollen.fieldset.pollDate.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.pollDate.options.help'/>"
- alt="<s:text name='pollen.fieldset.pollDate.options.help'/>"/>
- </legend>
-
- <sj:datepicker key="poll.beginDate" cssClass="disableForVoteStarted"
- displayFormat="%{getText('pollen.common.datePickerPattern')}"
- label="%{getText('pollen.common.beginDate')}"
- timepicker="true"/>
- <sj:datepicker key="poll.endDate"
- displayFormat="%{getText('pollen.common.datePickerPattern')}"
- timepicker="true"
- label="%{getText('pollen.common.endDate')}"/>
- </fieldset>
- <br/>
-
- <fieldset class="disableForVoteStarted">
- <legend>
- <s:text name="pollen.fieldset.choice.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.choice.options.help'/>"
- alt="<s:text name='pollen.fieldset.choice.options.help'/>"/>
- </legend>
- <s:checkbox key="poll.choiceAddAllowed"
- label="%{getText('pollen.common.pollOption.choiceAddAllowed')}"
- disabled="%{voteStarted}"
- tooltip="%{getText('pollen.common.pollOption.choiceAddAllowed.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <sj:datepicker key="poll.beginChoiceDate"
- label="%{getText('pollen.common.beginChoiceDate')}"
- displayFormat="%{getText('pollen.common.datePickerPattern')}"
- timepicker="true"
- disabled="%{voteStarted}"/>
- <sj:datepicker key="poll.endChoiceDate"
- label="%{getText('pollen.common.endChoiceDate')}"
- displayFormat="%{getText('pollen.common.datePickerPattern')}"
- timepicker="true"
- disabled="%{voteStarted}"/>
- <s:checkbox key="limitChoice"
- label="%{getText('pollen.common.pollOption.limitChoice')}"
- disabled="%{voteStarted}"
- tooltip="%{getText('pollen.common.pollOption.limitChoice.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <s:textfield key="maxChoices"
- label="%{getText('pollen.common.pollOption.maxChoiceNb')}"
- disabled="%{voteStarted}"/>
- </fieldset>
- <br/>
-
- <fieldset class="disableForVoteStarted">
- <legend>
- <s:text name="pollen.fieldset.vote.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.vote.options.help'/>"
- alt="<s:text name='pollen.fieldset.vote.options.help'/>"/>
- </legend>
-
- <s:checkbox key="poll.anonymous"
- label="%{getText('pollen.common.pollOption.anonymous')}"
- disabled="%{voteStarted}"
- tooltip="%{getText('pollen.common.pollOption.anonymous.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <s:checkbox key="poll.anonymousVoteAllowed"
- label="%{getText('pollen.common.pollOption.anonymousVoteAllowed')}"
- disabled="%{voteStarted}"
- tooltip="%{getText('pollen.common.pollOption.anonymousVoteAllowed.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- </fieldset>
- <br/>
- <fieldset>
- <legend>
- <s:text name="pollen.fieldset.result.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.result.options.help'/>"
- alt="<s:text name='pollen.fieldset.result.options.help'/>"/>
- </legend>
-
- <s:checkbox key="poll.publicResults"
- label="%{getText('pollen.common.pollOption.publicResults')}"
- tooltip="%{getText('pollen.common.pollOption.publicResults.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <s:checkbox key="poll.continuousResults"
- label="%{getText('pollen.common.pollOption.continuousResults')}"
- tooltip="%{getText('pollen.common.pollOption.continuousResults.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- </fieldset>
- <br/>
-
- <fieldset>
- <legend>
- <s:text name="pollen.fieldset.notification.options"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.fieldset.notification.options.help'/>"
- alt="<s:text name='pollen.fieldset.notification.options.help'/>"/>
- </legend>
- <s:checkbox key="notification"
- label="%{getText('pollen.common.pollOption.notification')}"
- tooltip="%{getText('pollen.common.pollOption.notification.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <s:checkbox key="reminder"
- label="%{getText('pollen.common.pollOption.reminder')}"
- tooltip="%{getText('pollen.common.pollOption.reminder.help')}"
- tooltipIconPath="/img/tooltip.png"/>
- <s:textfield key="reminderHourCountdown"
- label="%{getText('pollen.common.pollOption.reminderHourCountdown')}"/>
- </fieldset>
- <br/>
-
- <fieldset class="disableForVoteStarted">
- <legend>
- <s:text name="pollen.common.pollType"/>
- <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
- title="<s:text name='pollen.common.pollType.help'/>"
- alt="<s:text name='pollen.common.pollType.help'/>"/>
- </legend>
- <s:radio key='poll.pollType' list="pollTypes"
- label='%{getText("pollen.common.pollType")}'/>
- <hr/>
-
- <div id="pollTypeFREE" class="pollType">
- <%--Nothing to show for a free poll--%>
- </div>
-
- <div id="pollTypeRESTRICTED" class="pollType">
- <s:iterator value="restrictedVotingList" status="status"
- var="votingList">
- <s:set name="votingListNumber"><s:property
- value="%{#status.index}"/></s:set>
- <s:set name="votingListType">RESTRICTED</s:set>
- <%@include file="displayVotingList.jsp" %>
- </s:iterator>
- </div>
-
- <div id="pollTypeGROUP" class="pollType">
- <div id="votingListGROUP">
- <s:iterator value="groupVotingList" status="status"
- var="votingList">
- <s:set name="votingListNumber"><s:property
- value="%{#status.index}"/></s:set>
- <s:set name="votingListType">GROUP</s:set>
- <%@include file="displayVotingList.jsp" %>
- </s:iterator>
- </div>
- <div align="center">
- <s:submit key="pollen.action.addVotingList" theme="simple"
- onclick="return addNewVotingList();"/>
- <s:if test="userLoggued">
- <s:submit key="pollen.action.addVotingListFromPersonList"
- onclick='return selectPersonListToCreateNewVotingList();'
- theme="simple"/>
- </s:if>
- </div>
- </div>
- </fieldset>
- </div>
-
- </sj:tabbedpanel>
-
- <br/>
- <s:if test="edit">
- <s:submit action="edit/%{uriId}" value="%{actionLabel}" align="center"/>
- <div align="center" style="margin-top: 10px">
- <button onclick="return confirmClose();">
- <s:text name="pollen.action.close"/>
- </button>
- </div>
- </s:if>
- <s:elseif test="clone">
- <s:submit action="clone/%{uriId}" value="%{actionLabel}" align="center"/>
- </s:elseif>
- <s:else>
- <s:submit action="create" value="%{actionLabel}" align="center"/>
- </s:else>
-</s:form>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- function addErrorImage(element) {
- element.append(
- '<image src="${errorImg}">'
- );
- element.attr('title', '<s:text name="pollen.error.pollTabErrorFound"/>');
- }
-
- if (<s:property value="%{informationsError}"/>) {
- addErrorImage($('#tabGeneral a'));
- }
- if (<s:property value="%{optionsError}"/>) {
- addErrorImage($('#tabOptions a'));
- }
-
- if (<s:property value="%{poll.closed}"/>) {
- disablePoll();
- }
- if (<s:property value="%{voteStarted}"/>) {
- disableWhenVoteStarted();
- }
- });
-</script>
-
-<sj:dialog id="selectPersonListDialog" resizable="true" autoOpen="false"
- modal="true" width="500"/>
-
-<sj:dialog id="confirmDialog" autoOpen="false" modal="true" width="500"/>
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-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll_choices.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -25,211 +25,216 @@
<%@ taglib prefix="sp" uri="/nuiton-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<fieldset class="disableForVoteStarted">
- <legend><s:text name="pollen.fieldset.poll.choices"/></legend>
- <s:radio key='poll.choiceType' list="choiceTypes" label='' theme="simple"/>
- <hr/>
- <s:fielderror fieldName="poll.choices" id="poll_choices_error"/>
+<legend><s:text name="pollen.fieldset.poll.choices"/></legend>
+<s:radio key='poll.choiceType' list="choiceTypes" label='' theme="simple"/>
+<hr/>
+<s:fielderror fieldName="poll.choices" id="poll_choices_error"/>
- <s:set id='deleteTitle'><s:text
- name="pollen.action.pollChoiceDelete"/></s:set>
- <s:set id='upTitle'><s:text name="pollen.action.pollChoiceUp"/></s:set>
- <s:set id='downTitle'><s:text name="pollen.action.pollChoiceDown"/></s:set>
+<s:set id='deleteTitle'><s:text
+ name="pollen.action.pollChoiceDelete"/></s:set>
+<s:set id='upTitle'><s:text name="pollen.action.pollChoiceUp"/></s:set>
+<s:set id='downTitle'><s:text name="pollen.action.pollChoiceDown"/></s:set>
- <div id="choicesTEXT" class="choices">
- <s:iterator value="textChoices" status="status" var="choice">
- <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
- <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}" id="%{#prefix}_error"/>
- <div class="fleft choiceName">
- <sp:fielderror fieldName="%{#prefix}.name"
- id="%{#prefix}.name_error"/>
- <s:label for="%{#prefix}.name" id="choicesTEXT_label_%{#choiceNumber}"
- theme="simple" value=''/>
- <s:textfield cssClass="nameField" id='%{#prefix}.name' theme="simple"
- key="%{#prefix}.name" label='' value="%{#choice.name}"/>
- -
- <s:label for="%{#prefix}.description" key="pollen.common.description"
- theme="simple"/>
- <%--/div>
- <div class="fleft"--%>
- <s:textarea cols="30" id="%{#prefix}.description" label=''
- theme="simple" key="%{#prefix}.description"
- value="%{#choice.description}"/>
+<div id="choicesTEXT" class="choices">
+ <s:iterator value="textChoices" status="status" var="choice">
+ <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
+ <s:set name="prefix">textChoice_<s:property
+ value="%{#choiceNumber}"/></s:set>
+ <div id='choicesTEXT_<s:property value="choiceNumber"/>' class="ui-state-default">
+ <%--<div id='choicesTEXT_<s:property value="choiceNumber"/>'>--%>
+ <s:hidden key='%{#prefix}.topiaId' value='%{#choice.topiaId}' label=''/>
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
+ <sp:fielderror fieldName="%{#prefix}" id="%{#prefix}_error"/>
+ <div class="fleft choiceName">
+ <sp:fielderror fieldName="%{#prefix}.name" id="%{#prefix}.name_error"/>
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"></span>
+ <s:label for="%{#prefix}.name" id="choicesTEXT_label_%{#choiceNumber}"
+ theme="simple" value=''/>
+ <s:textfield cssClass="nameField" id='%{#prefix}.name' theme="simple"
+ key="%{#prefix}.name" label='' value="%{#choice.name}"/>
+ -
+ <s:label for="%{#prefix}.description" key="pollen.common.description"
+ theme="simple"/>
+ <%--/div>
+ <div class="fleft"--%>
+ <s:textarea cols="30" id="%{#prefix}.description" label=''
+ theme="simple" key="%{#prefix}.description"
+ value="%{#choice.description}"/>
+ </div>
+ <s:if test="!voteStarted">
+ <div class="fright">
+ <%--s:a id='choicesTEXT_down_%{choiceNumber}'
+ cssClass="hidden" href='#'
+ onclick="return downChoice('choicesTEXT_%{choiceNumber}')">
+ <image alt='<s:property value="downTitle"/>'
+ title='<s:property value="downTitle"/>'
+ src="<s:url value='/img/1downarrow.png'/>"></image>
+ </s:a>
+ <s:a id='choicesTEXT_up_%{choiceNumber}' href='#' cssClass="hidden"
+ onclick="return upChoice('choicesTEXT_%{choiceNumber}')">
+ <image alt='<s:property value="upTitle"/>'
+ title='<s:property value="upTitle"/>'
+ src="<s:url value='/img/1uparrow.png'/>"></image>
+ </s:a--%>
+ <s:a href='#'
+ onclick="return deleteChoice('choicesTEXT_%{choiceNumber}')">
+ <image alt='<s:property value="deleteTitle"/>'
+ title='<s:property value="deleteTitle"/>'
+ src="<s:url value='/img/delete.png'/>"></image>
+ </s:a>
</div>
- <s:if test="!voteStarted">
- <div class="fright">
- <s:a id='choicesTEXT_down_%{choiceNumber}'
- cssClass="hidden" href='#'
- onclick="return downChoice('choicesTEXT_%{choiceNumber}')">
- <image alt='<s:property value="downTitle"/>'
- title='<s:property value="downTitle"/>'
- src="<s:url value='/img/1downarrow.png'/>"></image>
- </s:a>
- <s:a id='choicesTEXT_up_%{choiceNumber}' href='#' cssClass="hidden"
- onclick="return upChoice('choicesTEXT_%{choiceNumber}')">
- <image alt='<s:property value="upTitle"/>'
- title='<s:property value="upTitle"/>'
- src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
- <s:a href='#'
- onclick="return deleteChoice('choicesTEXT_%{choiceNumber}')">
- <image alt='<s:property value="deleteTitle"/>'
- title='<s:property value="deleteTitle"/>'
- src="<s:url value='/img/delete.png'/>"></image>
- </s:a>
- </div>
- </s:if>
- <div class="cleanBoth"></div>
+ </s:if>
+ <div class="cleanBoth"></div>
+ </div>
+ </s:iterator>
+</div>
+<div id="choicesDATE" class="choices">
+ <s:iterator value="dateChoices" status="status" var="choice">
+ <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
+ <s:set name="prefix">dateChoice_<s:property
+ value="%{#choiceNumber}"/></s:set>
+ <div id='choicesDATE_<s:property value="choiceNumber"/>'
+ class="ui-state-default">
+ <s:hidden key='%{#prefix}.topiaId' id='%{#prefix}.topiaId'
+ theme="simple" value='%{#choice.topiaId}' label=''/>
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
+ <sp:fielderror fieldName="%{#prefix}" id="%{#prefix}_error"/>
+ <div class="fleft choiceName">
+ <sp:fielderror fieldName="%{#prefix}.name" id="%{#prefix}.name_error"/>
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"> </span>
+ <s:label for="%{#prefix}.name" id="choicesDATE_label_%{choiceNumber}"
+ theme="simple" value=''/>
+ <sj:datepicker id='%{#prefix}.name' key="%{#prefix}.name" label=""
+ changeMonth="true" changeYear="true" labelSeparator=""
+ theme="simple" timepicker="true"
+ value="%{#choice.name}"
+ displayFormat="%{getText('pollen.common.datePickerPattern')}"/>
+ -
+ <s:label for="%{#prefix}.description" key="pollen.common.description"
+ theme="simple"/>
</div>
- </s:iterator>
- </div>
- <div id="choicesDATE" class="choices">
- <s:iterator value="dateChoices" status="status" var="choice">
- <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
- <s:set name="prefix">dateChoice_<s:property
- value="%{#choiceNumber}"/></s:set>
- <div id='choicesDATE_<s:property value="choiceNumber"/>'>
- <s:hidden key='%{#prefix}.topiaId' id='%{#prefix}.topiaId'
- theme="simple"
- value='%{#choice.topiaId}' label=''/>
- <sp:fielderror fieldName="%{#prefix}" id="%{#prefix}_error"/>
- <div class="fleft choiceName">
- <sp:fielderror fieldName="%{#prefix}.name"
- id="%{#prefix}.name_error"/>
- <s:label for="%{#prefix}.name" id="choicesDATE_label_%{choiceNumber}"
- theme="simple" value=''/>
- <sj:datepicker id='%{#prefix}.name' key="%{#prefix}.name" label=""
- changeMonth="true" changeYear="true" labelSeparator=""
- theme="simple" timepicker="true"
- value="%{#choice.name}"
- displayFormat="%{getText('pollen.common.datePickerPattern')}"/>
- -
- <s:label for="%{#prefix}.description" key="pollen.common.description"
- theme="simple"/>
+ <div class="fleft">
+ <s:textarea cols="30" id="%{#prefix}.description" theme="simple"
+ key="%{#prefix}.description" label=''
+ value="%{#choice.description}"/>
+ </div>
+ <s:if test="!voteStarted">
+ <div class="fright">
+ <%--s:a id='choicesDATE_down_%{choiceNumber}' cssClass="hidden"
+ href='#'
+ onclick="return downChoice('choicesDATE_%{choiceNumber}')">
+ <image alt='<s:property value="downTitle"/>'
+ title='<s:property value="downTitle"/>'
+ src="<s:url value='/img/1downarrow.png'/>"></image>
+ </s:a>
+ <s:a id='choicesDATE_up_%{choiceNumber}' href='#' cssClass="hidden"
+ onclick="return upChoice('choicesDATE_%{choiceNumber}')">
+ <image alt='<s:property value="upTitle"/>'
+ title='<s:property value="upTitle"/>'
+ src="<s:url value='/img/1uparrow.png'/>"></image>
+ </s:a--%>
+ <s:a href='#'
+ onclick="return deleteChoice('choicesDATE_%{choiceNumber}')">
+ <image alt='<s:property value="deleteTitle"/>'
+ title='<s:property value="deleteTitle"/>'
+ src="<s:url value='/img/delete.png'/>"></image>
+ </s:a>
</div>
- <div class="fleft">
- <s:textarea cols="30" id="%{#prefix}.description" theme="simple"
- key="%{#prefix}.description" label=''
- value="%{#choice.description}"/>
- </div>
- <s:if test="!voteStarted">
- <div class="fright">
- <s:a id='choicesDATE_down_%{choiceNumber}' cssClass="hidden"
- href='#'
- onclick="return downChoice('choicesDATE_%{choiceNumber}')">
- <image alt='<s:property value="downTitle"/>'
- title='<s:property value="downTitle"/>'
- src="<s:url value='/img/1downarrow.png'/>"></image>
- </s:a>
- <s:a id='choicesDATE_up_%{choiceNumber}' href='#' cssClass="hidden"
- onclick="return upChoice('choicesDATE_%{choiceNumber}')">
- <image alt='<s:property value="upTitle"/>'
- title='<s:property value="upTitle"/>'
- src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
- <s:a href='#'
- onclick="return deleteChoice('choicesDATE_%{choiceNumber}')">
- <image alt='<s:property value="deleteTitle"/>'
- title='<s:property value="deleteTitle"/>'
- src="<s:url value='/img/delete.png'/>"></image>
- </s:a>
- </div>
- </s:if>
- <div class="cleanBoth"></div>
- </div>
- </s:iterator>
- </div>
- <div id="choicesIMAGE" class="choices">
- <s:iterator value="imageChoices" status="status" var="choice">
- <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
- <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}" id="%{#prefix}_error"/>
- <div class="fleft choiceName">
- <sp:fielderror fieldName="%{#prefix}.name"
- id="%{#prefix}.name_error"/>
- <s:label for="%{#prefix}.name" id="choicesIMAGE_label_%{choiceNumber}"
- theme="simple" value=''/>
- <s:if test="#choice.name != null">
+ </s:if>
+ <div class="cleanBoth"></div>
+ </div>
+ </s:iterator>
+</div>
+<div id="choicesIMAGE" class="choices">
+ <s:iterator value="imageChoices" status="status" var="choice">
+ <s:set name="choiceNumber"><s:property value="%{#status.index}"/></s:set>
+ <s:set name="prefix">imageChoice_<s:property
+ value="%{#choiceNumber}"/></s:set>
+ <div id='choicesIMAGE_<s:property value="choiceNumber"/>'
+ class="ui-state-default">
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
+ <s:hidden key='%{#prefix}.topiaId' value='%{#choice.topiaId}' label=''/>
+ <sp:fielderror fieldName="%{#prefix}" id="%{#prefix}_error"/>
+ <div class="fleft choiceName">
+ <sp:fielderror fieldName="%{#prefix}.name" id="%{#prefix}.name_error"/>
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"></span>
+ <s:label for="%{#prefix}.name" id="choicesIMAGE_label_%{choiceNumber}"
+ theme="simple" value=''/>
+ <s:if test="#choice.name != null">
- <%--Uploaded image--%>
- <s:hidden id="%{#prefix}.name" name="%{#prefix}.name"
- value="%{#choice.name}" label='' theme="simple"/>
+ <%--Uploaded image--%>
+ <s:hidden id="%{#prefix}.name" name="%{#prefix}.name"
+ value="%{#choice.name}" label='' theme="simple"/>
- <s:hidden id="%{#prefix}.location" name="%{#prefix}.location"
- value="%{#choice.location}" label='' theme="simple"/>
- <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
- escapeAmp="true">
- <s:param name="choiceTokenId">
- imagechoicesThumb_<s:property value='name'/>
- </s:param>
- </s:url>
- <img name="<s:property value="#prefix"/>.thumb"
- alt="<s:property value='name'/>"
- title="<s:property value='name'/>"
- src="<s:property value='imageUrl'/>">
+ <s:hidden id="%{#prefix}.location" name="%{#prefix}.location"
+ value="%{#choice.location}" label='' theme="simple"/>
+ <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
+ escapeAmp="true">
+ <s:param name="choiceTokenId">
+ imagechoicesThumb_<s:property value='name'/>
+ </s:param>
+ </s:url>
+ <img name="<s:property value="#prefix"/>.thumb"
+ alt="<s:property value='name'/>"
+ title="<s:property value='name'/>"
+ src="<s:property value='imageUrl'/>">
- <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple"
- cssClass="nameField fleft" cssStyle="margin-left:50px;"/>
- </s:if>
- <s:else>
- <%--New image--%>
- <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
- escapeAmp="false" value="/img/7ter.jpg"/>
- <img name="<s:property value="#prefix"/>.thumb"
- alt="<s:text name='pollen.image.not.loaded'/>"
- title="<s:text name='pollen.image.not.loaded'/>"
- src="<s:property value='imageUrl'/>" width="100px"
- height="75px">
- <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple"
- cssClass="nameField fleft"
- cssStyle="margin-left:50px;"/>
+ <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple"
+ cssClass="nameField fleft" cssStyle="margin-left:50px;"/>
+ </s:if>
+ <s:else>
+ <%--New image--%>
+ <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
+ escapeAmp="false" value="/img/7ter.jpg"/>
+ <img name="<s:property value="#prefix"/>.thumb"
+ alt="<s:text name='pollen.image.not.loaded'/>"
+ title="<s:text name='pollen.image.not.loaded'/>"
+ src="<s:property value='imageUrl'/>" width="100px"
+ height="75px">
+ <s:file key='imageChoice[%{#choiceNumber}]' label='' theme="simple"
+ cssClass="nameField fleft"
+ cssStyle="margin-left:50px;"/>
- </s:else>
+ </s:else>
+ </div>
+ <div class="fleft">
+ -
+ <s:label for="%{#prefix}.description" key="pollen.common.description"
+ theme="simple"/>
+ <s:textarea cols="30" id="%{#prefix}.description" label=''
+ theme="simple" key="%{#prefix}.description"
+ value="%{#choice.description}"/>
+ </div>
+ <s:if test="!voteStarted">
+ <div class="fright">
+ <%--s:a id='choicesIMAGE_down_%{choiceNumber}' cssClass="hidden"
+ href='#'
+ onclick="return downChoice('choicesIMAGE_%{choiceNumber}')">
+ <image alt='<s:property value="downTitle"/>'
+ title='<s:property value="downTitle"/>'
+ src="<s:url value='/img/1downarrow.png'/>"></image>
+ </s:a>
+ <s:a id='choicesIMAGE_up_%{choiceNumber}' href='#' cssClass="hidden"
+ onclick="return upChoice('choicesIMAGE_%{choiceNumber}')">
+ <image alt='<s:property value="upTitle"/>'
+ title='<s:property value="upTitle"/>'
+ src="<s:url value='/img/1uparrow.png'/>"></image>
+ </s:a--%>
+ <s:a href='#'
+ onclick="return deleteChoice('choicesIMAGE_%{choiceNumber}')">
+ <image alt='<s:property value="deleteTitle"/>'
+ title='<s:property value="deleteTitle"/>'
+ src="<s:url value='/img/delete.png'/>"></image>
+ </s:a>
</div>
- <div class="fleft">
- -
- <s:label for="%{#prefix}.description" key="pollen.common.description"
- theme="simple"/>
- <s:textarea cols="30" id="%{#prefix}.description" label=''
- theme="simple" key="%{#prefix}.description"
- value="%{#choice.description}"/>
- </div>
- <s:if test="!voteStarted">
- <div class="fright">
- <s:a id='choicesIMAGE_down_%{choiceNumber}' cssClass="hidden"
- href='#'
- onclick="return downChoice('choicesIMAGE_%{choiceNumber}')">
- <image alt='<s:property value="downTitle"/>'
- title='<s:property value="downTitle"/>'
- src="<s:url value='/img/1downarrow.png'/>"></image>
- </s:a>
- <s:a id='choicesIMAGE_up_%{choiceNumber}' href='#' cssClass="hidden"
- onclick="return upChoice('choicesIMAGE_%{choiceNumber}')">
- <image alt='<s:property value="upTitle"/>'
- title='<s:property value="upTitle"/>'
- src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
- <s:a href='#'
- onclick="return deleteChoice('choicesIMAGE_%{choiceNumber}')">
- <image alt='<s:property value="deleteTitle"/>'
- title='<s:property value="deleteTitle"/>'
- src="<s:url value='/img/delete.png'/>"></image>
- </s:a>
- </div>
- </s:if>
+ </s:if>
- <div class="cleanBoth"></div>
- </div>
- </s:iterator>
- </div>
- <hr/>
- <s:submit key="pollen.action.addChoice" align="center"
- onclick="return addNewChoice();"/>
+ <div class="cleanBoth"></div>
+ </div>
+ </s:iterator>
+</div>
+<hr/>
+<s:submit key="pollen.action.addChoice" align="center"
+ onclick="return addNewChoice();"/>
</fieldset>
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-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayDateChoice.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -28,9 +28,12 @@
<s:set id='deleteTitle'><s:text name="pollen.action.pollChoiceDelete"/></s:set>
<s:set id='upTitle'><s:text name="pollen.action.pollChoiceUp"/></s:set>
<s:set id='downTitle'><s:text name="pollen.action.pollChoiceDown"/></s:set>
-<div id='choicesDATE_<s:property value="choiceNumber"/>'>
+<div id='choicesDATE_<s:property value="choiceNumber"/>'
+ class="ui-state-default">
<s:hidden key='%{#prefix}.topiaId' value='%{choice.topiaId}' label=''/>
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
<div class="fleft choiceName">
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"></span>
<s:label for="%{#prefix}.name" id="choicesDATE_label_%{choiceNumber}"
theme="simple" value=''/>
<sj:datepicker id='%{#prefix}.name' key="%{#prefix}.name" changeMonth="true"
@@ -47,7 +50,7 @@
value="%{choice.description}"/>
</div>
<div class="fright">
- <s:a id='choicesDATE_down_%{choiceNumber}'
+ <%--s:a id='choicesDATE_down_%{choiceNumber}'
cssClass="hidden" href='#'
onclick="return downChoice('choicesDATE_%{choiceNumber}')">
<image alt='<s:property value="downTitle"/>'
@@ -59,7 +62,7 @@
<image alt='<s:property value="upTitle"/>'
title='<s:property value="upTitle"/>'
src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
+ </s:a--%>
<s:a href='#' onclick="return deleteChoice('choicesDATE_%{choiceNumber}')">
<image alt='<s:property value="deleteTitle"/>'
title='<s:property value="deleteTitle"/>'
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayImageChoice.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -28,40 +28,26 @@
<s:set id='deleteTitle'><s:text name="pollen.action.pollChoiceDelete"/></s:set>
<s:set id='upTitle'><s:text name="pollen.action.pollChoiceUp"/></s:set>
<s:set id='downTitle'><s:text name="pollen.action.pollChoiceDown"/></s:set>
-<div id='choicesIMAGE_<s:property value="choiceNumber"/>'>
+<div id='choicesIMAGE_<s:property value="choiceNumber"/>'
+ class="ui-state-default">
<s:hidden key='%{#prefix}.topiaId' value='%{choice.topiaId}' label=''/>
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
<div class="fleft choiceName">
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"></span>
<s:label for="%{#prefix}.name" id="choicesIMAGE_label_%{choiceNumber}"
theme="simple" value=''/>
- <%--<s:if test="choice.name != ''">--%>
-
- <%--<%–Uploaded image–%>--%>
- <%--<s:hidden id="%{#prefix}.name" name="%{#prefix}.name"--%>
- <%--value="%{choice.name}" label='' theme="simple"/>--%>
-
- <%--<s:hidden id="%{#prefix}.location" name="%{#prefix}.location"--%>
- <%--value="%{choice.location}" label='' theme="simple"/>--%>
-
- <%--<s:label label='' theme="simple" cssClass="nameField"--%>
- <%--value="%{choice.name}" readonly="true"/>--%>
- <%--</s:if>--%>
- <%--<s:else>--%>
- <%--New image--%>
- <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
- escapeAmp="false" value="/img/7ter.jpg"/>
- <img name="<s:property value="#prefix"/>.thumb"
- alt="<s:text name='pollen.image.not.loaded'/>"
- title="<s:text name='pollen.image.not.loaded'/>"
- src="<s:property value='imageUrl'/>" width="100px" height="75">
+ <s:url id="imageUrl" namespace="/io" action="getPollChoiceImage"
+ escapeAmp="false" value="/img/7ter.jpg"/>
+ <img name="<s:property value="#prefix"/>.thumb"
+ alt="<s:text name='pollen.image.not.loaded'/>"
+ title="<s:text name='pollen.image.not.loaded'/>"
+ src="<s:property value='imageUrl'/>" width="100px" height="75">
<span style="float: left; margin-left:50px; ">
<s:file key='%{#prefix2}' label=''
theme="simple"
cssClass="nameField"
disabled="%{voteStarted}" cssStyle="clear: both;"/>
</span>
-
- <%--<s:file key='%{#prefix2}' label='' theme="simple" cssClass="nameField"/>--%>
- <%--</s:else>--%>
</div>
<div class="fleft">
-
@@ -71,7 +57,7 @@
key="%{#prefix}.description" value="%{choice.description}"/>
</div>
<div class="fright">
- <s:a id='choicesIMAGE_down_%{choiceNumber}'
+ <%--s:a id='choicesIMAGE_down_%{choiceNumber}'
cssClass="hidden" href='#'
onclick="return downChoice('choicesIMAGE_%{choiceNumber}')">
<image alt='<s:property value="downTitle"/>'
@@ -83,7 +69,7 @@
<image alt='<s:property value="upTitle"/>'
title='<s:property value="upTitle"/>'
src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
+ </s:a--%>
<s:a href='#' onclick="return deleteChoice('choicesIMAGE_%{choiceNumber}')">
<image alt='<s:property value="deleteTitle"/>'
title='<s:property value="deleteTitle"/>'
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPersonToList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPersonToList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPersonToList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -24,7 +24,10 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sp" uri="/nuiton-tags" %>
-<s:set name="personPrefix">votingList<s:property value="votingListType"/>_<s:property value="votingListNumber"/>PersonToList_<s:property value="personToListNumber"/>
+<s:set name="personPrefix">votingList<s:property
+ value="votingListType"/>_<s:property
+ value="votingListNumber"/>PersonToList_<s:property
+ value="personToListNumber"/>
</s:set>
<s:set name="personToList" value="%{personToList}"/>
@@ -32,25 +35,32 @@
<s:text name="pollen.action.pollPersonToListDelete"/>
</s:set>
<s:div id='%{#personPrefix}' cssClass="personToList">
- <s:hidden key='%{#personPrefix}.topiaId' value='%{#personToList.topiaId}' label=''/>
- <s:hidden key='%{#personPrefix}.accountId' value='%{#personToList.pollAccount.accountId}' label=''/>
+ <s:hidden key='%{#personPrefix}.topiaId' value='%{#personToList.topiaId}'
+ label=''/>
+ <s:hidden key='%{#personPrefix}.accountId'
+ value='%{#personToList.pollAccount.accountId}' label=''/>
<sp:fielderror fieldName="%{#personPrefix}"/>
<div class="fleft choiceName">
- <s:label for="%{#personPrefix}.votingId" id="%{#personPrefix}_label" theme="simple"
+ <s:label for="%{#personPrefix}.votingId" id="%{#personPrefix}_label"
+ theme="simple"
value=''/>
<s:textfield cssClass="nameField" id='%{#personPrefix}.votingId'
key="%{#personPrefix}.votingId" label='' theme="simple"
value="%{#personToList.pollAccount.votingId}"
disabled="%{voteStarted}"/>
-
- <s:label for="%{#personPrefix}.email" key="pollen.common.email" theme="simple"/>
- <s:textfield cols="30" id="%{#personPrefix}.email" key="%{#personPrefix}.email"
+ <s:label for="%{#personPrefix}.email" key="pollen.common.email"
+ theme="simple"/>
+ <s:textfield cols="30" id="%{#personPrefix}.email"
+ key="%{#personPrefix}.email"
label='' theme="simple" size="30"
value="%{#personToList.pollAccount.email}"
disabled="%{voteStarted}"/>
-
- <s:label for="%{#personPrefix}.weight" key="pollen.common.weight" theme="simple"/>
- <s:textfield id="%{#personPrefix}.weight" key="%{#personPrefix}.weight" size="1"
+ <s:label for="%{#personPrefix}.weight" key="pollen.common.weight"
+ theme="simple"/>
+ <s:textfield id="%{#personPrefix}.weight" key="%{#personPrefix}.weight"
+ size="1"
label='' theme="simple" value="%{#personToList.weight}"
disabled="%{voteStarted}"/>
</div>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -37,7 +37,6 @@
<span class="name"><s:property value='%{#comment.author}'/></span> :
<span class="date">
<s:property value='#comment.postDate'/>
- <%--<s:property value='%{formatDateTime(#postDate)}'/>--%>
</span>
<p>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComments.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComments.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComments.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -25,7 +25,7 @@
<%--<link rel="stylesheet" href="<s:url value='/css/pagination.css'/>"/>--%>
<%--<script type="text/javascript"--%>
- <%--src="<s:url value='/js/jquery.pagination.js' />"></script>--%>
+<%--src="<s:url value='/js/jquery.pagination.js' />"></script>--%>
<%--
<input type="text" value="5" name="items_per_page" id="items_per_page" class="numeric"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayTextChoice.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayTextChoice.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayTextChoice.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -27,9 +27,12 @@
<s:set id='deleteTitle'><s:text name="pollen.action.pollChoiceDelete"/></s:set>
<s:set id='upTitle'><s:text name="pollen.action.pollChoiceUp"/></s:set>
<s:set id='downTitle'><s:text name="pollen.action.pollChoiceDown"/></s:set>
-<div id='choicesTEXT_<s:property value="choiceNumber"/>'>
+<div id='choicesTEXT_<s:property value="choiceNumber"/>'
+ class="ui-state-default">
<s:hidden key='%{#prefix}.topiaId' value='%{choice.topiaId}' label=''/>
+ <s:hidden key='%{#prefix}.order' value='%{#choiceNumber}' label=''/>
<div class="fleft choiceName">
+ <span class="choicesImage ui-icon ui-icon-arrowthick-2-n-s"></span>
<s:label for="%{#prefix}.name" id="choicesTEXT_label_%{choiceNumber}"
theme="simple" value=''/>
<s:textfield cssClass="nameField" id='%{#prefix}.name' key="%{#prefix}.name"
@@ -43,7 +46,7 @@
key="%{#prefix}.description" value="%{choice.description}"/>
</div>
<div class="fright">
- <s:a id='choicesTEXT_down_%{choiceNumber}'
+ <%--s:a id='choicesTEXT_down_%{choiceNumber}'
cssClass="hidden" href='#'
onclick="return downChoice('choicesTEXT_%{choiceNumber}')">
<image alt='<s:property value="downTitle"/>'
@@ -55,7 +58,7 @@
<image alt='<s:property value="upTitle"/>'
title='<s:property value="upTitle"/>'
src="<s:url value='/img/1uparrow.png'/>"></image>
- </s:a>
+ </s:a--%>
<s:a href='#' onclick="return deleteChoice('choicesTEXT_%{choiceNumber}')">
<image alt='<s:property value="deleteTitle"/>'
title='<s:property value="deleteTitle"/>'
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -39,25 +39,25 @@
<sp:fielderror fieldName="%{#prefix}"/>
<s:if test='%{#votingListType == "GROUP"}'>
<%--<div>--%>
- <div class="fleft choiceName">
- <s:label for="%{#prefix}.name" theme="simple" id="%{#prefix}_label"/>
- <s:textfield id='%{#prefix}.name' key="%{#prefix}.name" label=''
- theme="simple" value="%{#votingList.name}"/>
- -
- <s:label for="%{#prefix}.weight" key="pollen.common.weight"
- theme="simple"/>
- <s:textfield id="%{#prefix}.weight" key="%{#prefix}.weight"
- value="%{#votingList.weight}"
- size="1" label='' theme="simple"/>
- </div>
- <div id='<s:property value="%{#prefix}"/>_actions' class="fright">
- <s:a href='#' onclick="return deleteVotingList('%{#prefix}')">
- <image alt='<s:property value="deleteVotingListTitle"/>'
- title='<s:property value="deleteVotingListTitle"/>'
- src="<s:url value='/img/delete.png'/>"></image>
- </s:a>
- </div>
- <hr/>
+ <div class="fleft choiceName">
+ <s:label for="%{#prefix}.name" theme="simple" id="%{#prefix}_label"/>
+ <s:textfield id='%{#prefix}.name' key="%{#prefix}.name" label=''
+ theme="simple" value="%{#votingList.name}"/>
+ -
+ <s:label for="%{#prefix}.weight" key="pollen.common.weight"
+ theme="simple"/>
+ <s:textfield id="%{#prefix}.weight" key="%{#prefix}.weight"
+ value="%{#votingList.weight}"
+ size="1" label='' theme="simple"/>
+ </div>
+ <div id='<s:property value="%{#prefix}"/>_actions' class="fright">
+ <s:a href='#' onclick="return deleteVotingList('%{#prefix}')">
+ <image alt='<s:property value="deleteVotingListTitle"/>'
+ title='<s:property value="deleteVotingListTitle"/>'
+ src="<s:url value='/img/delete.png'/>"></image>
+ </s:a>
+ </div>
+ <hr/>
<%--</div>--%>
</s:if>
<s:else>
@@ -74,7 +74,8 @@
status="pstatus" var="personToList">
<s:set name="personToListNumber"><s:property value="%{#pstatus.index}"/></s:set>
- <s:set name="personPrefix"><s:property value="%{#prefix}"/>PersonToList_<s:property value="%{#personToListNumber}"/></s:set>
+ <s:set name="personPrefix"><s:property value="%{#prefix}"/>PersonToList_<s:property
+ value="%{#personToListNumber}"/></s:set>
<%@include file="displayPersonToList.jsp" %>
</s:iterator>
</s:div>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingListPersons.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingListPersons.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayVotingListPersons.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -36,7 +36,8 @@
<s:property value="%{#pstatus.index + #startNumber}"/>
</s:set>
<s:set name="personPrefix">
- <s:property value="%{#prefix}"/>PersonToList_<s:property value="%{#personToListNumber}"/></s:set>
+ <s:property value="%{#prefix}"/>PersonToList_<s:property
+ value="%{#personToListNumber}"/></s:set>
<%@include file="displayPersonToList.jsp" %>
</s:iterator>
Copied: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp (from rev 3518, trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp)
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp (rev 0)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -0,0 +1,355 @@
+<%--
+ #%L
+ Pollen :: UI (struts2)
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@ 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'/>"/>
+
+<script type="text/javascript">
+
+ $(document).data(
+ {
+ selectPersonListToAddToVotingListTitle:'<s:text name="pollen.title.selectPersonListToAddVotingList"/>',
+ selectPersonListToCreateNewVotingListTitle:'<s:text name="pollen.title.selectPersonListToCreateVotingList"/>',
+
+ votingListText:'<s:text name="pollen.common.votingList"/>',
+ personToListText:'<s:text name="pollen.common.personToList"/>',
+ choiceText:'<s:text name="pollen.common.choice"/>',
+
+ displayVotingListUrl:'<s:url namespace="/poll" action="displayVotingList"/>',
+ displayPersonToListUrl:'<s:url namespace="/poll" action="displayPersonToList"/>',
+ importPersonListToVotingListUrl:'<s:url namespace="/poll" action="importPersonListToVotingList"/>',
+ importPersonListToNewVotingListUrl:'<s:url namespace="/poll" action="importPersonListToNewVotingList"/>',
+ displayImageChoiceUrl:'<s:url namespace="/poll" action="displayImageChoice"/>',
+ displayDateChoiceUrl:'<s:url namespace="/poll" action="displayDateChoice"/>',
+ displayTextChoiceUrl:'<s:url namespace="/poll" action="displayTextChoice"/>',
+ selectPersonListToAddToVotingListUrl:'<s:url action="selectPersonListToAddToVotingList" namespace="/poll"/>',
+ selectPersonListToCreateNewVotingListUrl:'<s:url action="selectPersonListToCreateNewVotingList" namespace="/poll"/>',
+
+ choiceAddAllowed:'<s:property value="%{poll.choiceAddAllowed}"/>',
+ limitChoice:'<s:property value="%{limitChoice}"/>',
+ reminder:'<s:property value="%{reminder}"/>',
+ publicOption:'<s:property value="%{poll.publicResults}"/>',
+ anonymousOption:'<s:property value="%{poll.anonymous}"/>',
+ voteCountingType:'<s:property value="%{poll.voteCountingType.name()}"/>',
+ choiceType:'<s:property value="%{poll.choiceType.name()}"/>',
+ pollType:'<s:property value="%{poll.pollType.name()}"/>',
+ confirmCloseTitle:"<s:text name='pollen.title.close.poll'/>",
+ confirmCloseUrl:'<s:url action="confirmClosePoll/%{poll.adminId}" namespace="/poll"/>',
+ confirmCloseRedirectUrl:'<s:url action="summary/%{poll.adminId}" namespace="/poll"/>'
+ }
+ );
+</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>
+
+<s:url id='errorImg' value='/img/exclamation.png'/>
+
+<title>
+ <s:if test="edit">
+ <s:text name="pollen.title.editPoll"/>
+ </s:if>
+ <s:else>
+ <s:text name="pollen.title.createPoll"/>
+ </s:else>
+</title>
+
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:property value="%{pageTitle}"/>
+</h1>
+
+<s:form method="POST" id="registerForm" namespace="/poll"
+ enctype="multipart/form-data">
+
+<s:hidden key="poll.topiaId" label=""/>
+
+<sj:tabbedpanel id="formTabs" selectedTab="%{selectedTab}">
+
+<sj:tab id="tabGeneral" target="tgeneral" key="pollen.tab.poll.general"/>
+<sj:tab id="tabOptions" target="toptions" key="pollen.tab.poll.options"/>
+
+<div id="tgeneral">
+
+ <fieldset>
+
+ <s:textfield key="poll.title" label="%{getText('pollen.common.title')}"
+ required="true" size="80"/>
+ <s:textarea key="poll.description" rows="3" cols="54"
+ label="%{getText('pollen.common.description')}"/>
+ <s:hidden key="poll.pollId" label=""/>
+ </fieldset>
+
+ <br/>
+
+ <fieldset class="disableForVoteStarted">
+ <legend>
+ <s:text name="pollen.common.voteCountingType"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ alt="<s:text name='pollen.common.voteCountingType.help'/>"
+ title="<s:text name='pollen.common.voteCountingType.help'/>"/>
+ </legend>
+ <s:radio key='poll.voteCountingType' list="voteCountingTypes"
+ label='' theme="simple"/>
+ </fieldset>
+ <br/>
+
+ <%@include file="createPoll_choices.jsp" %>
+
+</div>
+
+<div id="toptions">
+
+ <fieldset>
+ <legend>
+ <s:text name="pollen.fieldset.creator.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.creator.options.help'/>"
+ alt="<s:text name='pollen.fieldset.creator.options.help'/>"/>
+ </legend>
+ <s:textfield key="poll.creator.votingId" size="80"
+ label="%{getText('pollen.common.login')}"/>
+ <s:textfield key="poll.creator.email" size="80"
+ label="%{getText('pollen.common.email')}"/>
+ <s:hidden key="poll.creator.accountId" label=""/>
+ <s:hidden key="poll.creator.topiaId" label=""/>
+ <s:if test="creatorUserAccountDefined">
+ <s:hidden name="userId" value="%{poll.creator.userAccount.topiaId}"/>
+ </s:if>
+ </fieldset>
+ <br/>
+
+ <fieldset>
+ <legend>
+ <s:text name="pollen.fieldset.pollDate.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.pollDate.options.help'/>"
+ alt="<s:text name='pollen.fieldset.pollDate.options.help'/>"/>
+ </legend>
+
+ <sj:datepicker key="poll.beginDate" cssClass="disableForVoteStarted"
+ displayFormat="%{getText('pollen.common.datePickerPattern')}"
+ label="%{getText('pollen.common.beginDate')}"
+ timepicker="true"/>
+ <sj:datepicker key="poll.endDate"
+ displayFormat="%{getText('pollen.common.datePickerPattern')}"
+ timepicker="true"
+ label="%{getText('pollen.common.endDate')}"/>
+ </fieldset>
+ <br/>
+
+ <fieldset class="disableForVoteStarted">
+ <legend>
+ <s:text name="pollen.fieldset.choice.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.choice.options.help'/>"
+ alt="<s:text name='pollen.fieldset.choice.options.help'/>"/>
+ </legend>
+ <s:checkbox key="poll.choiceAddAllowed"
+ label="%{getText('pollen.common.pollOption.choiceAddAllowed')}"
+ disabled="%{voteStarted}"
+ tooltip="%{getText('pollen.common.pollOption.choiceAddAllowed.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <sj:datepicker key="poll.beginChoiceDate"
+ label="%{getText('pollen.common.beginChoiceDate')}"
+ displayFormat="%{getText('pollen.common.datePickerPattern')}"
+ timepicker="true"
+ disabled="%{voteStarted}"/>
+ <sj:datepicker key="poll.endChoiceDate"
+ label="%{getText('pollen.common.endChoiceDate')}"
+ displayFormat="%{getText('pollen.common.datePickerPattern')}"
+ timepicker="true"
+ disabled="%{voteStarted}"/>
+ <s:checkbox key="limitChoice"
+ label="%{getText('pollen.common.pollOption.limitChoice')}"
+ disabled="%{voteStarted}"
+ tooltip="%{getText('pollen.common.pollOption.limitChoice.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <s:textfield key="maxChoices"
+ label="%{getText('pollen.common.pollOption.maxChoiceNb')}"
+ disabled="%{voteStarted}"/>
+ </fieldset>
+ <br/>
+
+ <fieldset class="disableForVoteStarted">
+ <legend>
+ <s:text name="pollen.fieldset.vote.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.vote.options.help'/>"
+ alt="<s:text name='pollen.fieldset.vote.options.help'/>"/>
+ </legend>
+
+ <s:checkbox key="poll.anonymous"
+ label="%{getText('pollen.common.pollOption.anonymous')}"
+ disabled="%{voteStarted}"
+ tooltip="%{getText('pollen.common.pollOption.anonymous.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <s:checkbox key="poll.anonymousVoteAllowed"
+ label="%{getText('pollen.common.pollOption.anonymousVoteAllowed')}"
+ disabled="%{voteStarted}"
+ tooltip="%{getText('pollen.common.pollOption.anonymousVoteAllowed.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ </fieldset>
+ <br/>
+ <fieldset>
+ <legend>
+ <s:text name="pollen.fieldset.result.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.result.options.help'/>"
+ alt="<s:text name='pollen.fieldset.result.options.help'/>"/>
+ </legend>
+
+ <s:checkbox key="poll.publicResults"
+ label="%{getText('pollen.common.pollOption.publicResults')}"
+ tooltip="%{getText('pollen.common.pollOption.publicResults.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <s:checkbox key="poll.continuousResults"
+ label="%{getText('pollen.common.pollOption.continuousResults')}"
+ tooltip="%{getText('pollen.common.pollOption.continuousResults.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ </fieldset>
+ <br/>
+
+ <fieldset>
+ <legend>
+ <s:text name="pollen.fieldset.notification.options"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.fieldset.notification.options.help'/>"
+ alt="<s:text name='pollen.fieldset.notification.options.help'/>"/>
+ </legend>
+ <s:checkbox key="notification"
+ label="%{getText('pollen.common.pollOption.notification')}"
+ tooltip="%{getText('pollen.common.pollOption.notification.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <s:checkbox key="reminder"
+ label="%{getText('pollen.common.pollOption.reminder')}"
+ tooltip="%{getText('pollen.common.pollOption.reminder.help')}"
+ tooltipIconPath="/img/tooltip.png"/>
+ <s:textfield key="reminderHourCountdown"
+ label="%{getText('pollen.common.pollOption.reminderHourCountdown')}"/>
+ </fieldset>
+ <br/>
+
+ <fieldset class="disableForVoteStarted">
+ <legend>
+ <s:text name="pollen.common.pollType"/>
+ <img src="<s:url value='/img/tooltip.png'/>" class="tooltip"
+ title="<s:text name='pollen.common.pollType.help'/>"
+ alt="<s:text name='pollen.common.pollType.help'/>"/>
+ </legend>
+ <s:radio key='poll.pollType' list="pollTypes"
+ label='%{getText("pollen.common.pollType")}'/>
+ <hr/>
+
+ <div id="pollTypeFREE" class="pollType">
+ <%--Nothing to show for a free poll--%>
+ </div>
+
+ <div id="pollTypeRESTRICTED" class="pollType">
+ <s:iterator value="restrictedVotingList" status="status"
+ var="votingList">
+ <s:set name="votingListNumber"><s:property
+ value="%{#status.index}"/></s:set>
+ <s:set name="votingListType">RESTRICTED</s:set>
+ <%@include file="displayVotingList.jsp" %>
+ </s:iterator>
+ </div>
+
+ <div id="pollTypeGROUP" class="pollType">
+ <div id="votingListGROUP">
+ <s:iterator value="groupVotingList" status="status"
+ var="votingList">
+ <s:set name="votingListNumber"><s:property
+ value="%{#status.index}"/></s:set>
+ <s:set name="votingListType">GROUP</s:set>
+ <%@include file="displayVotingList.jsp" %>
+ </s:iterator>
+ </div>
+ <div align="center">
+ <s:submit key="pollen.action.addVotingList" theme="simple"
+ onclick="return addNewVotingList();"/>
+ <s:if test="userLoggued">
+ <s:submit key="pollen.action.addVotingListFromPersonList"
+ onclick='return selectPersonListToCreateNewVotingList();'
+ theme="simple"/>
+ </s:if>
+ </div>
+ </div>
+ </fieldset>
+</div>
+
+</sj:tabbedpanel>
+
+<br/>
+<s:if test="edit">
+ <s:submit action="edit/%{uriId}" value="%{actionLabel}" align="center"/>
+ <div align="center" style="margin-top: 10px">
+ <button onclick="return confirmClose();">
+ <s:text name="pollen.action.close"/>
+ </button>
+ </div>
+</s:if>
+<s:elseif test="clone">
+ <s:submit action="clone/%{uriId}" value="%{actionLabel}" align="center"/>
+</s:elseif>
+<s:else>
+ <s:submit action="create" value="%{actionLabel}" align="center"/>
+</s:else>
+</s:form>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ function addErrorImage(element) {
+ element.append(
+ '<image src="${errorImg}">'
+ );
+ element.attr('title', '<s:text name="pollen.error.pollTabErrorFound"/>');
+ }
+
+ if (<s:property value="%{informationsError}"/>) {
+ addErrorImage($('#tabGeneral a'));
+ }
+ if (<s:property value="%{optionsError}"/>) {
+ addErrorImage($('#tabOptions a'));
+ }
+
+ if (<s:property value="%{poll.closed}"/>) {
+ disablePoll();
+ }
+ if (<s:property value="%{voteStarted}"/>) {
+ disableWhenVoteStarted();
+ }
+ });
+</script>
+
+<sj:dialog id="selectPersonListDialog" resizable="true" autoOpen="false"
+ modal="true" width="500"/>
+
+<sj:dialog id="confirmDialog" autoOpen="false" modal="true" width="500"/>
Property changes on: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/pollForm.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -55,6 +55,32 @@
dialog.dialog('open');
return false;
}
+
+ var autoSelect = function () {
+ var el = $(this)[0];
+ if (/textarea/i.test(el.tagName) || (/input/i.test(el.tagName) && /text/i.test(el.type))) {
+ el.select();
+ } else if (!!window.getSelection) { // FF, Safari, Chrome, Opera
+ var sel = window.getSelection();
+ var range = document.createRange();
+ range.selectNodeContents(el);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ } else if (!!document.selection) { // IE
+ document.selection.empty();
+ var range = document.body.createTextRange();
+ range.moveToElementText(el);
+ range.select();
+ }
+ };
+
+ $(document).load(function() {
+
+
+ $('.url').click(autoSelect);
+
+ })
+
</script>
<h1 class="titleCreation"><s:property value="poll.title"/></h1>
@@ -72,13 +98,14 @@
<s:if test="canVote">
<div class="ui-widget-content-green ui-corner-all">
<img src="<s:url value='/img/vote.png'/>" class="imgAction"
- alt="<s:text name='pollen.common.voteAction'/>"
- title="<s:text name='pollen.common.voteAction'/>"/>
- <s:text name="pollen.label.pollVotePage"/>
- <br/>
+ alt="<s:text name='pollen.action.voteAction.help'/>"
+ title="<s:text name='pollen.action.voteAction.help'/>"/>
<s:a href="%{voteUrl}">
+ <strong><s:text name="pollen.label.pollVotePage"/></strong>
+ </s:a>
+ <span class="fright url" id='voteUrl'>
<s:property value="%{voteUrl}"/>
- </s:a>
+ </span>
</div>
</s:if>
@@ -86,57 +113,60 @@
<s:if test="canShowResult">
<div class="ui-widget-content-green ui-corner-all">
<img src="<s:url value='/img/count.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.pollResult'/>"
- title="<s:text name='pollen.action.pollResult'/>"/>
- <s:text name='pollen.label.pollResultPage'/>
- <br/>
+ alt="<s:text name='pollen.action.pollResult.help'/>"
+ title="<s:text name='pollen.action.pollResult.help'/>"/>
<s:a href="%{resultUrl}">
+ <strong><s:text name='pollen.label.pollResultPage'/></strong>
+ </s:a>
+ <span class="fright url" id='voteUrl'>
<s:property value="%{resultUrl}"/>
- </s:a>
+ </span>
</div>
</s:if>
<%--Moderate--%>
<div class="ui-widget-content-yellow ui-corner-all">
<img src="<s:url value='/img/moderate.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.pollModerateVote'/>"
- title="<s:text name='pollen.action.pollModerateVote'/>"/>
- <s:text name='pollen.label.pollModerateVotePage'/>
- <br/>
+ alt="<s:text name='pollen.action.pollModerateVote.help'/>"
+ title="<s:text name='pollen.action.pollModerateVote.help'/>"/>
<s:a href="%{moderateUrl}">
- <s:property value="%{moderateUrl}"/>
+ <strong><s:text name='pollen.label.pollModerateVotePage'/></strong>
</s:a>
+ <span class="fright url" id='voteUrl'>
+ <s:property value="%{moderateUrl}"/>
+ </span>
</div>
<%--Edit--%>
<div class="ui-widget-content-yellow ui-corner-all">
<img src="<s:url value='/img/edit.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.editPoll'/>"
- title="<s:text name='pollen.action.editPoll'/>"/>
- <s:text name='pollen.label.pollEditPage'/>
- <br/>
+ alt="<s:text name='pollen.action.editPoll.help'/>"
+ title="<s:text name='pollen.action.editPoll.help'/>"/>
<s:a href="%{editUrl}">
- <s:property value="%{editUrl}"/>
+ <strong><s:text name='pollen.label.pollEditPage'/></strong>
</s:a>
+ <span class="fright url" id='voteUrl'>
+ <s:property value="%{editUrl}"/>
+ </span>
</div>
<%--Export--%>
<div class="ui-widget-content-blue ui-corner-all">
<img src="<s:url value='/img/export.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.pollExport'/>"
- title="<s:text name='pollen.action.pollExport'/>"/>
+ alt="<s:text name='pollen.action.exportPoll.help'/>"
+ title="<s:text name='pollen.action.exportPoll.help'/>"/>
<s:a href="%{exportUrl}">
- <s:text name='pollen.label.pollExportPage'/>
+ <strong><s:text name='pollen.label.pollExportPage'/></strong>
</s:a>
</div>
<%--Clone--%>
<div class="ui-widget-content-blue ui-corner-all">
<img src="<s:url value='/img/copy.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.clone'/>"
- title="<s:text name='pollen.action.clone'/>"/>
+ alt="<s:text name='pollen.action.clonePoll.help'/>"
+ title="<s:text name='pollen.action.clonePoll.help'/>"/>
<s:a href="%{cloneUrl}">
- <s:text name='pollen.label.pollClonePage'/>
+ <strong> <s:text name='pollen.label.pollClonePage'/></strong>
</s:a>
</div>
@@ -144,10 +174,10 @@
<s:if test="canClose">
<div class="ui-widget-content-red ui-corner-all">
<img src="<s:url value='/img/close.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.close'/>"
- title="<s:text name='pollen.action.close'/>"/>
+ alt="<s:text name='pollen.action.closePoll.help'/>"
+ title="<s:text name='pollen.action.closePoll.help'/>"/>
<s:a href="#" onclick="return confirmClosePoll('%{uriId}')">
- <s:text name='pollen.label.pollClosePage'/>
+ <strong><s:text name='pollen.label.pollClosePage'/></strong>
</s:a>
</div>
@@ -156,8 +186,8 @@
<%--Delete --%>
<div class="ui-widget-content-red ui-corner-all">
<img src="<s:url value='/img/delete.png'/>" class="imgAction"
- alt="<s:text name='pollen.action.deletePoll'/>"
- title="<s:text name='pollen.action.deletePoll'/>"/>
+ alt="<s:text name='pollen.action.deletePoll.help'/>"
+ title="<s:text name='pollen.action.deletePoll.help'/>"/>
<s:a href="#" onclick="return confirmDeletePoll('%{uriId}')">
<s:text name='pollen.label.pollDeletePage'/>
</s:a>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -27,7 +27,7 @@
<script type="text/javascript"
src="<s:url value='/js/gridHelper.js' />"></script>
-<s:url id="loadUrl" action="getPolls" namespace="/json" method="input"/>
+<s:url id="loadUrl" action="getPolls" namespace="/json"/>
<s:url id="voteUrl" action="votefor/" namespace="/poll"/>
<s:url id='voteImg' value='/img/vote.png'/>
@@ -83,7 +83,7 @@
result += formatLink("${voteUrl}" + voteId, "${voteImg}", "Vote", "${voteTitle}")
}
if (cellvalue.indexOf('novote') > -1) {
- result +="<image src='${blankImg}'>";
+ result += "<image src='${blankImg}'>";
}
if (cellvalue.indexOf('summary') > -1) {
result += formatLink("${summaryUrl}" + adminId, "${summaryImg}", "Moderate", "${summaryTitle}")
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/security/connected_required.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/security/connected_required.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/security/connected_required.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -28,6 +28,6 @@
<span>
<s:text name="pollen.security.error.connected_required"/>
</span>
- </li>
+ </li>
</ul>
</div>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -37,7 +37,7 @@
<script type="text/javascript">
var redirectUrl = '<s:url namespace="/user" action="createdList"/>';
- $(function(){
+ $(function () {
$('img[src$="tooltip.png"]').addClass('tooltip');
$(".tooltip").tipTip();
});
@@ -46,7 +46,9 @@
<title><s:text name="pollen.title.pollsCreatedList"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsCreatedList"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.pollsCreatedList"/>
+</h1>
<h4><s:text name="pollen.title.pollsCreatedList.legend"/></h4>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/dialogLostPassword.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/dialogLostPassword.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/dialogLostPassword.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -38,7 +38,9 @@
<hr/>
<div align="right">
- <button onclick="return cancel();"><s:text name="pollen.action.cancel"/></button>
+ <button onclick="return cancel();">
+ <s:text name="pollen.action.cancel"/>
+ </button>
<s:submit key="pollen.action.send" theme="simple"
action="lostPassword"/>
</div>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -25,7 +25,9 @@
<title><s:text name="pollen.title.myAccount"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.myAccount"/>
+</h1>
<s:form method="POST" namespace="/user">
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -42,7 +42,7 @@
<script type="text/javascript">
var favoriteListId = '<s:property value="favoriteList.topiaId"/>';
- var redirectUrl = '${editPollAccounts}';
+ var redirectUrl = "<s:property value='%{editPollAccounts}'/>";
var deleteTitle = '<s:text name="pollen.action.deletePollAccount"/>';
var deleteUrl = '<s:url action="confirmDeletePollAccount" namespace="/user" />';
var loadPollActionUrl = '<s:url action="getFavoriteListPollAccount" namespace="/json"/>';
@@ -52,7 +52,7 @@
jQuery(document).ready(function () {
- initFavoritePage('${action}');
+ initFavoritePage("<s:property value='%{action}'/>");
});
</script>
@@ -61,7 +61,7 @@
value="favoriteList.name"/>
</title>
-<h1 class="title${pageLogo}">
+<h1 class="title<s:property value='%{pageLogo}'/>">
<s:text name="pollen.title.editFavoriteList"/> <s:property
value="favoriteList.name"/>
</h1>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -37,7 +37,9 @@
<title><s:text name="pollen.title.favoriteLists"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.favoriteLists"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.favoriteLists"/>
+</h1>
<s:url id="loadFavoriteLists" action="getFavoriteLists" namespace="/json"/>
@@ -51,11 +53,11 @@
var editTitle = '<s:text name="pollen.action.editFavoriteList"/>';
var deleteImg = '<s:url value='/img/delete.png'/>';
var csvHelp = "<div><s:text name='pollen.common.favoriteList.csvImport.help'/>" +
- "<br/><img src=\"<s:url value="/img/import_csv_help.png"/>\"/></div>";
+ "<br/><img src=\"<s:url value="/img/import_csv_help.png"/>\"/></div>";
jQuery(document).ready(function () {
- initFavoritesPage('${action}');
+ initFavoritesPage("<s:property value='%{action}'/>");
});
</script>
@@ -82,8 +84,7 @@
<br/>
<s:form id='createForm' method="POST" namespace="/user"
- cssClass="hidden favoriteForm"
- enctype="multipart/form-data">
+ cssClass="hidden favoriteForm" enctype="multipart/form-data">
<s:hidden name="action" value="create"/>
<fieldset>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -26,11 +26,13 @@
<script type="text/javascript">
var redirectUrl = '<s:url namespace="/user" action="invitedList"/>';
</script>
-<%@include file="/WEB-INF/jsp/pollListHelper.jsp"%>
+<%@include file="/WEB-INF/jsp/pollListHelper.jsp" %>
<title><s:text name="pollen.title.pollsInvitedList"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsInvitedList"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.pollsInvitedList"/>
+</h1>
<h4><s:text name="pollen.title.pollsInvitedList.legend"/></h4>
@@ -48,10 +50,13 @@
rowList="10,15,20,50,100" rowNum="10">
<sjg:gridColumn name="id" title="id" hidden="true"/>
- <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}' />
- <sjg:gridColumn name="description" title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices" title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate" title='%{getText("pollen.common.beginDate")}'/>
+ <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
+ <sjg:gridColumn name="description"
+ title='%{getText("pollen.common.description")}'/>
+ <sjg:gridColumn name="addingChoices"
+ title='%{getText("pollen.common.addingChoices")}'/>
+ <sjg:gridColumn name="beginDate"
+ title='%{getText("pollen.common.beginDate")}'/>
<sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="55" sortable="false"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -34,8 +34,8 @@
<s:form id="connection" action="login" method="POST" namespace="/user">
-<fieldset>
- <legend><s:text name="pollen.fieldset.login"/></legend>
+ <fieldset>
+ <legend><s:text name="pollen.fieldset.login"/></legend>
<s:textfield key="login" size="10" label="%{getText('pollen.common.login')}"
required="true"/>
@@ -44,11 +44,11 @@
required="true"/>
-</fieldset>
+ </fieldset>
<br/>
<s:submit id="submitform" action="login" key="pollen.action.login"
align="center"/>
- </s:form>
+</s:form>
<div class="center" style="margin-bottom:20px;">
<img src="<s:url value='/img/pollen_%{safeLanguage}.png' />"
alt="Pollen logo"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -26,11 +26,13 @@
<script type="text/javascript">
var redirectUrl = '<s:url namespace="/user" action="participatedList"/>';
</script>
-<%@include file="/WEB-INF/jsp/pollListHelper.jsp"%>
+<%@include file="/WEB-INF/jsp/pollListHelper.jsp" %>
<title><s:text name="pollen.title.pollsParticipatedList"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsParticipatedList"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.pollsParticipatedList"/>
+</h1>
<h4><s:text name="pollen.title.pollsParticipatedList.legend"/></h4>
@@ -48,10 +50,13 @@
rowList="10,15,20,50,100" rowNum="10">
<sjg:gridColumn name="id" title="id" hidden="true"/>
- <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}' />
- <sjg:gridColumn name="description" title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices" title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate" title='%{getText("pollen.common.beginDate")}'/>
+ <sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
+ <sjg:gridColumn name="description"
+ title='%{getText("pollen.common.description")}'/>
+ <sjg:gridColumn name="addingChoices"
+ title='%{getText("pollen.common.addingChoices")}'/>
+ <sjg:gridColumn name="beginDate"
+ title='%{getText("pollen.common.beginDate")}'/>
<sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="55" sortable="false"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -25,7 +25,9 @@
<title><s:text name="pollen.title.register"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.register"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.register"/>
+</h1>
<s:form method="POST" key="registerForm">
@@ -33,7 +35,8 @@
<legend><s:text name="pollen.fieldset.connexionInformation"/></legend>
<s:textfield name="user.login" key="pollen.common.login" required="true"/>
- <s:password name="user.password" key="pollen.common.password" required="true"/>
+ <s:password name="user.password" key="pollen.common.password"
+ required="true"/>
<s:password name="password2" key="pollen.common.password2" required="true"/>
</fieldset>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp 2012-06-19 08:18:29 UTC (rev 3519)
@@ -25,23 +25,27 @@
<title><s:text name="pollen.title.myAccount"/></title>
-<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1>
+<h1 class="title<s:property value='%{pageLogo}'/>">
+ <s:text name="pollen.title.myAccount"/>
+</h1>
<s:form method="POST" namespace="/user">
<fieldset>
<legend><s:text name="pollen.fieldset.connexionInformation"/></legend>
- <s:hidden key="user.topiaId" label="" />
+ <s:hidden key="user.topiaId" label=""/>
<s:label name="user.login" key="pollen.common.login"/>
</fieldset>
<fieldset>
<legend><s:text name="pollen.fieldset.userInformation"/></legend>
- <s:label name="user.email" key="pollen.common.email" />
- <s:label name="user.firstName" value="%{user.firstName}" key="pollen.common.firstName" />
- <s:label name="user.lastName" value="%{user.lastName}" key="pollen.common.lastName" />
+ <s:label name="user.email" key="pollen.common.email"/>
+ <s:label name="user.firstName" value="%{user.firstName}"
+ key="pollen.common.firstName"/>
+ <s:label name="user.lastName" value="%{user.lastName}"
+ key="pollen.common.lastName"/>
</fieldset>
<br/>
<s:submit action="edit" method="input"
Modified: trunk/pollen-ui-struts2/src/main/webapp/css/pollCreation.css
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/css/pollCreation.css 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/css/pollCreation.css 2012-06-19 08:18:29 UTC (rev 3519)
@@ -20,6 +20,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
+.choicesImage { position: absolute; margin-left: 1.3em; }
+.choices div { height: 4em; line-height: 1.2em; }
+.ui-state-highlight { height: 4em; line-height: 1.2em; }
+
#pollCreationZone {
width: 550px;
margin: auto;
Modified: trunk/pollen-ui-struts2/src/main/webapp/css/summary.css
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/css/summary.css 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/css/summary.css 2012-06-19 08:18:29 UTC (rev 3519)
@@ -20,27 +20,61 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-.ui-widget-content-green { border: 1px solid #aaaaaa; background: #b0f580 url(images/ui-bg_flat_75_b0f580_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content-green a { color: #222222; }
+.ui-widget-content-green {
+ border: 1px solid #aaaaaa;
+ background: #b0f580 url(images/ui-bg_flat_75_b0f580_40x100.png) 50% 50% repeat-x;
+ color: #222222;
+}
-.ui-widget-content-yellow { border: 1px solid #aaaaaa; background: #ffffaa url(images/ui-bg_flat_75_ffffaa_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content-yellow a { color: #222222; }
+.ui-widget-content-green a {
+ color: #222222;
+}
-.ui-widget-content-red { border: 1px solid #aaaaaa; background: #FFAAAA url(images/ui-bg_flat_75_ffffaa_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content-red a { color: #222222; }
+.ui-widget-content-yellow {
+ border: 1px solid #aaaaaa;
+ background: #ffffaa url(images/ui-bg_flat_75_ffffaa_40x100.png) 50% 50% repeat-x;
+ color: #222222;
+}
-.ui-widget-content-blue { border: 1px solid #dddddd; background: #A9D4E3 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; color: #362b36; }
-.ui-widget-content-blue a { color: #362b36; }
+.ui-widget-content-yellow a {
+ color: #222222;
+}
+.ui-widget-content-red {
+ border: 1px solid #aaaaaa;
+ background: #FFAAAA url(images/ui-bg_flat_75_ffffaa_40x100.png) 50% 50% repeat-x;
+ color: #222222;
+}
+
+.ui-widget-content-red a {
+ color: #222222;
+}
+
+.ui-widget-content-blue {
+ border: 1px solid #dddddd;
+ background: #A9D4E3 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x;
+ color: #362b36;
+}
+
+.ui-widget-content-blue a {
+ color: #362b36;
+}
+
.ui-corner-all {
margin-top: 10px;
padding: 10px;
}
.showResultIcon {
- background: #FFE3E3 url(../img/count.png) 80% 80% repeat-x;
+ background: #FFE3E3 url(../img/count.png) 80% 80% repeat-x;
}
+
.imgAction {
margin-right: 20px;
}
+.url {
+ margin-left: 2em;
+ background-color: #ffffff;
+}
+
Modified: trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/js/createPoll.js 2012-06-19 08:18:29 UTC (rev 3519)
@@ -354,7 +354,8 @@
function updateUpdownActions(containerId) {
- var firstChoice = getFirstChoice(containerId);
+ reorder(containerId);
+ /*var firstChoice = getFirstChoice(containerId);
var lastChoice = getLastChoice(containerId);
getAllChoices(containerId).each(function (index) {
@@ -381,7 +382,7 @@
//show down
downWidget.removeClass('hidden');
}
- });
+ });*/
}
@@ -467,7 +468,7 @@
return false;
}
-function upChoice(choiceId) {
+/*function upChoice(choiceId) {
var choice = $('#' + choiceId);
var choicePrefix = choice.data('choicePrefix');
var choiceNumber = choice.data('choiceNumber');
@@ -483,9 +484,9 @@
var newChoiceNumber = (choiceNumber + 1);
return switchChoices(choicePrefix, choiceNumber, newChoiceNumber);
-}
+}*/
-function switchChoices( choicePrefix, choiceNumber, newChoiceNumber) {
+/*function switchChoices(choicePrefix, choiceNumber, newChoiceNumber) {
// change topiaId
switchValue(choicePrefix, choiceNumber, newChoiceNumber, '.topiaId');
@@ -537,7 +538,7 @@
//console.info("switch " + choiceTIVal + " to " + newChoiceTIVal);
choiceTI.attr("src", newChoiceTIVal);
newChoiceTI.attr("src", choiceTIVal);
-}
+}*/
function confirmClose() {
$('.ui-dialog-title').html(datas['confirmCloseTitle']);
@@ -566,6 +567,25 @@
$('#registerForm .disableForVoteStarted input[type="file"]').hide();
}
+function reorder(containerId) {
+
+ var choices = getAllChoices(containerId);
+
+ choices.each(function (index) {
+
+ var currentChoiceNumber = $(this).data('choiceNumber');
+
+ var choicePrefix = $(this).data('choicePrefix');
+
+ $('#' + containerId + "_label_" + currentChoiceNumber).html(
+ datas['choiceText'] + ' ' + (index + 1));
+
+ var orderWidget = $('[name="' + choicePrefix + currentChoiceNumber +".order" + '"]');
+
+ orderWidget.val(index);
+ });
+
+}
jQuery(document).ready(function () {
function changeChoiceAddAllowed(val) {
@@ -668,4 +688,19 @@
$('img[src$="tooltip.png"]').addClass("tooltip");
$('.tooltip').tipTip({ defaultPosition:'top' });
+
+ $.struts2_jquery.require('js/base/jquery.ui.sortable.js', function () {
+
+ $(".choices").sortable({placeholder:"ui-state-highlight",
+ update:function (event, ui) {
+ var item = $(ui.item);
+ var container = item.data('choiceType');
+ var choiceNumber = item.data('choiceNumber');
+ console.info('Moved ' + container + ' -- ' + choiceNumber);
+ reorder(container);
+ }
+ }).disableSelection();
+ });
+
+
});
Modified: trunk/pollen-ui-struts2/src/main/webapp/js/favoriteList.js
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/js/favoriteList.js 2012-06-18 17:25:39 UTC (rev 3518)
+++ trunk/pollen-ui-struts2/src/main/webapp/js/favoriteList.js 2012-06-19 08:18:29 UTC (rev 3519)
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-function initFavoritePage(action, loadPollActionUrl) {
+function initFavoritePage(action) {
if (action == 'create') {
$('#createForm').show();
} else if (action == 'edit') {
@@ -47,7 +47,7 @@
});
// to create a new row
- $.listenRowTopic('pollAccounts-addRow', function (event) {
+ $.listenRowTopic('pollAccounts-addRow', function () {
$('#createForm [name="createPollAccount.votingId"]').val("");
$('#createForm [name="createPollAccount.email"]').val("");
$('#deleteForm').hide();
@@ -92,7 +92,7 @@
}
function confirmDelete(id) {
- $('.ui-dialog-title').html(deleteTitle)
+ $('.ui-dialog-title').html(deleteTitle);
var dialog = $("#confirmDialog");
var url = deleteUrl + '?' + $.param({favoriteListId:favoriteListId,
pollAccountId:id,
1
0
r3518 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/poll resources/i18n
by ymartel@users.chorem.org 18 Jun '12
by ymartel@users.chorem.org 18 Jun '12
18 Jun '12
Author: ymartel
Date: 2012-06-18 19:25:39 +0200 (Mon, 18 Jun 2012)
New Revision: 3518
Url: http://chorem.org/repositories/revision/pollen/3518
Log:
refs #596 : dont allow non image file
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.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
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-18 16:59:38 UTC (rev 3517)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-06-18 17:25:39 UTC (rev 3518)
@@ -531,6 +531,8 @@
@Override
public void addFileContentType(int index, String contentType) {
+ parameters.put("imageChoice_" + index + ".newContentType",
+ new String[]{contentType});
// not used here
}
@@ -873,6 +875,16 @@
continue;
}
choiceNames.add(choiceName);
+ String contentTypeField = choicePrefix + choiceIndex + ".newContentType";
+ String contentTypes = getNonEmptyParameterValue(contentTypeField);
+ if (contentTypes != null && !contentTypes.startsWith("image/")) {
+ // Bad content Type
+ addInformationsError(
+ choiceErrorField,
+ _("pollen.error.poll.imageChoice.upload.badContentType"));
+ //TODO ymartel 2012/06/18
+ continue;
+ }
}
}
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-06-18 16:59:38 UTC (rev 3517)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-06-18 17:25:39 UTC (rev 3518)
@@ -185,6 +185,7 @@
pollen.error.poll.endDate.before.beginDate=The poll end date must be later than the begin date.
pollen.error.poll.endDate.before.now=The poll end date must be later than current date.
pollen.error.poll.imageChoice.already.used=Image choice name already used.
+pollen.error.poll.imageChoice.upload.badContentType=Only images are allowed.
pollen.error.poll.imageChoice.upload.required=Upload an image is mandatory.
pollen.error.poll.maxChoice.greater.than.0=Number of choices must be strictly greater than 0
pollen.error.poll.maxChoice.required=Number of choices mandatory
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-06-18 16:59:38 UTC (rev 3517)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-06-18 17:25:39 UTC (rev 3518)
@@ -185,6 +185,7 @@
pollen.error.poll.endDate.before.beginDate=La date de fin du sondage doit-être postérieure à la date de début.
pollen.error.poll.endDate.before.now=La date de fin du sondage doit-être postérieure à la date actuelle.
pollen.error.poll.imageChoice.already.used=Choix d'image déjà utilisé (les noms doivent être tous différents).
+pollen.error.poll.imageChoice.upload.badContentType=Seules les images sont autorisées.
pollen.error.poll.imageChoice.upload.required=Le choix d'une image est obligatoire.
pollen.error.poll.maxChoice.greater.than.0=Nombre de choix maximum doit être strictement supérieur à 0
pollen.error.poll.maxChoice.required=Nombre de choix maximum obligatoire
1
0
r3517 - in trunk: pollen-persistence/src/main/java/org/chorem/pollen pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll pollen-ui-struts2/src/main/resources/i18n
by tchemit@users.chorem.org 18 Jun '12
by tchemit@users.chorem.org 18 Jun '12
18 Jun '12
Author: tchemit
Date: 2012-06-18 18:59:38 +0200 (Mon, 18 Jun 2012)
New Revision: 3517
Url: http://chorem.org/repositories/revision/pollen/3517
Log:
refs #576 (NPE if no values) + improve validation for condorcet
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenFunctions.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.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
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenFunctions.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenFunctions.java 2012-06-18 16:19:22 UTC (rev 3516)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenFunctions.java 2012-06-18 16:59:38 UTC (rev 3517)
@@ -164,10 +164,12 @@
new VotingPersonDTO(input.getPollAccount().getVotingId(), input.getWeight());
result.setEmail(input.getPollAccount().getEmail());
- for (VoteToChoice vToChoice : input.getChoiceVoteToChoice()) {
- if (vToChoice != null && vToChoice.getChoice() != null) {
- VoteToChoiceDTO bean = VOTE_TO_CHOICE_TO_BEAN.apply(vToChoice);
- result.getChoices().add(bean);
+ if (!input.isChoiceVoteToChoiceEmpty()) {
+ for (VoteToChoice vToChoice : input.getChoiceVoteToChoice()) {
+ if (vToChoice != null && vToChoice.getChoice() != null) {
+ VoteToChoiceDTO bean = VOTE_TO_CHOICE_TO_BEAN.apply(vToChoice);
+ result.getChoices().add(bean);
+ }
}
}
return result;
@@ -185,7 +187,7 @@
}
};
- public static final Function<Map.Entry<Poll,PollAccount>,Pair<Poll,PollAccount>> MAP_ENTRY_TO_PAIR_FUNCTION = new Function<Map.Entry<Poll, PollAccount>, Pair<Poll, PollAccount>>() {
+ public static final Function<Map.Entry<Poll, PollAccount>, Pair<Poll, PollAccount>> MAP_ENTRY_TO_PAIR_FUNCTION = new Function<Map.Entry<Poll, PollAccount>, Pair<Poll, PollAccount>>() {
@Override
public Pair<Poll, PollAccount> apply(Map.Entry<Poll, PollAccount> input) {
return Pair.of(input.getKey(), input.getValue());
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-06-18 16:19:22 UTC (rev 3516)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-06-18 16:59:38 UTC (rev 3517)
@@ -65,12 +65,6 @@
addFlashMessage(_("pollen.information.pollNotStarted"));
} else if (isPollFinished()) {
addFlashMessage(_("pollen.information.pollFinished"));
- } else if (isCreatorUser()) {
-// if (getUriId().isAccountIdNotBlank()) {
-//
-// // account Id setted in url, so should not be abel to vote
-// addFlashWarning(_("pollen.information.vote.creatorUser"));
-// }
}
if (isPollChoiceRunning()) {
addFlashMessage(_("pollen.information.pollChoiceRunning"));
@@ -124,8 +118,8 @@
totalValues += value;
} else {
- // otherwise does not take account of this choice
- voteToChoice.setVoteValue(null);
+ addFieldError("vote.choices",
+ _("pollen.error.vote.invalidCondorcetVoteValue"));
}
// for other vote type, value must be > 0
} else if (value != 0) {
@@ -147,6 +141,7 @@
}
}
+ // @InputConfig(methodName = PREPARE_VOTE_PAGE)
@Override
public String execute() throws Exception {
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-06-18 16:19:22 UTC (rev 3516)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-06-18 16:59:38 UTC (rev 3517)
@@ -216,6 +216,7 @@
pollen.error.user.not.found=User not found
pollen.error.user.restrictedListsForbidden=The poll is restricted and you are not allowed to vote. Check if you have correctly used the link sent to you by email.
pollen.error.userNotAllowed=You are not allowed to count the votes for this poll.
+pollen.error.vote.invalidCondorcetVoteValue=Invalid position\: in a condorcet vote, you can let empty values, or put values greater than zero.
pollen.error.vote.maxChoiceNb=The maximal number of choices is %d.
pollen.error.vote.percentage=The sum of the values must be equals to 100.
pollen.fieldset.choice.options=Choices
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-06-18 16:19:22 UTC (rev 3516)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-06-18 16:59:38 UTC (rev 3517)
@@ -216,6 +216,7 @@
pollen.error.user.not.found=Utilisateur non trouvé
pollen.error.user.restrictedListsForbidden=Le sondage est restreint et vous n'êtes pas autorisé à voter. Vérifiez que vous avez bien utiliser le lien qui vous a été envoyé.
pollen.error.userNotAllowed=Vous n'êtes pas autorisé à dépouiller ce sondage.
+pollen.error.vote.invalidCondorcetVoteValue=Position invalide \: dans un vote condorcet, vous pouvez soit laisser laisser vide un choix, soit mettre une valeur strictement positive.
pollen.error.vote.maxChoiceNb=Le nombre de choix maximal est de %d.
pollen.error.vote.percentage=La somme des valeurs doit être égale à 100.
pollen.fieldset.choice.options=Les choix
1
0