r3124 - in branches/pollen-1.2.6-struts2/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
Author: tchemit Date: 2012-01-31 00:53:24 +0100 (Tue, 31 Jan 2012) New Revision: 3124 Url: http://chorem.org/repositories/revision/pollen/3124 Log: - add poll admin lists - add user poll lists (services are not ok) - fix home page language Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createdList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/participatedList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/struts.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -97,8 +97,8 @@ return result; } - protected Boolean isSortAscendant() { - Boolean result = null; + protected boolean isSortAscendant() { + boolean result = false; if (useSort()) { result = "asc".equals(sord); } Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,123 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * 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% + */ +package org.chorem.pollen.ui.actions.json; + +import com.google.common.collect.Sets; +import org.chorem.pollen.business.persistence.Poll; +import org.chorem.pollen.entities.PollenBinderHelper; +import org.chorem.pollen.services.impl.PollService; +import org.nuiton.util.beans.Binder; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Obtain created polls to put in grid for the connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetCreatedPolls extends AbstractJSONPaginedAction { + + private static final long serialVersionUID = 1L; + + protected transient Map<String, Object>[] polls; + + public Map<String, Object>[] getPolls() { + return polls; + } + + @Override + public Integer getRows() { + return pager.getPageSize(); + } + + @Override + public Integer getPage() { + return pager.getPageIndex(); + } + + @Override + public Integer getTotal() { + return pager.getPagesNumber(); + } + + @Override + public Integer getRecords() { + return pager.getRecords(); + } + + @Override + public String execute() throws Exception { + + PollService pollService = newService(PollService.class); + + boolean ascendantOrder = isSortAscendant(); + String sortColumn = getSortColumn(); + + List<Poll> pollList = pollService.getCreatedPolls(pager, + sortColumn, + ascendantOrder, + getPollenSession().getUserAccount()); + + polls = new Map[pollList.size()]; + Binder<Poll, Poll> binder = + PollenBinderHelper.getSimpleTopiaBinder(Poll.class); + int index = 0; + for (Poll poll : pollList) { + + Map<String, Object> map = binder.obtainProperties( + poll, + Poll.PROPERTY_TITLE, + Poll.PROPERTY_POLL_ID, + Poll.PROPERTY_DESCRIPTION, + Poll.PROPERTY_BEGIN_DATE, + Poll.PROPERTY_END_DATE + ); + map.put("id", poll.getTopiaId()); + Set<String> functions = getPollFunctions(poll); + map.put("functions", functions); + polls[index++] = map; + } + return SUCCESS; + } + + protected Set<String> getPollFunctions(Poll poll) { + Set<String> result = Sets.newHashSet(); + result.add("vote"); + result.add("result"); + Boolean closed = poll.getClosed(); + if (closed == null || !closed) { + + // poll is not closed + result.add("edit"); + result.add("close"); + } + result.add("export"); + result.add("clone"); + result.add("delete"); + return result; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,133 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * 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% + */ +package org.chorem.pollen.ui.actions.json; + +import com.google.common.collect.Sets; +import org.chorem.pollen.business.persistence.PersonToList; +import org.chorem.pollen.business.persistence.Poll; +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.business.persistence.VotingList; +import org.chorem.pollen.entities.PollenBinderHelper; +import org.chorem.pollen.services.impl.PollService; +import org.nuiton.util.beans.Binder; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Obtain invited polls to put in grid for the connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetInvitedPolls extends AbstractJSONPaginedAction { + + private static final long serialVersionUID = 1L; + + protected transient Map<String, Object>[] polls; + + public Map<String, Object>[] getPolls() { + return polls; + } + + @Override + public Integer getRows() { + return pager.getPageSize(); + } + + @Override + public Integer getPage() { + return pager.getPageIndex(); + } + + @Override + public Integer getTotal() { + return pager.getPagesNumber(); + } + + @Override + public Integer getRecords() { + return pager.getRecords(); + } + + @Override + public String execute() throws Exception { + + PollService pollService = newService(PollService.class); + + boolean ascendantOrder = isSortAscendant(); + String sortColumn = getSortColumn(); + + List<Poll> pollList = pollService.getInvitedPolls(pager, + sortColumn, + ascendantOrder, + getPollenSession().getUserAccount()); + + polls = new Map[pollList.size()]; + Binder<Poll, Poll> binder = + PollenBinderHelper.getSimpleTopiaBinder(Poll.class); + int index = 0; + for (Poll poll : pollList) { + + Map<String, Object> map = binder.obtainProperties( + poll, + Poll.PROPERTY_TITLE, + Poll.PROPERTY_POLL_ID, + Poll.PROPERTY_DESCRIPTION, + Poll.PROPERTY_BEGIN_DATE, + Poll.PROPERTY_END_DATE + ); + String userEmail = getPollenSession().getUserAccount().getEmail(); + map.put("voteId", getVoteId(poll, userEmail)); + map.put("id", poll.getTopiaId()); + Set<String> functions = getPollFunctions(poll); + map.put("functions", functions); + polls[index++] = map; + } + return SUCCESS; + } + + protected Set<String> getPollFunctions(Poll poll) { + Set<String> result = Sets.newHashSet(); + result.add("vote"); + result.add("result"); + return result; + } + + protected String getVoteId(Poll poll, String userEmail) { + String result = poll.getPollId(); + for (VotingList list : poll.getVotingList()) { + for (PersonToList account : list.getPollAccountPersonToList()) { + PollAccount pollAccount = account.getPollAccount(); + if (userEmail.equals(pollAccount.getEmail())) { + result += ":" + pollAccount.getAccountId(); + break; + } + } + } + + return result; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,113 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * 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% + */ +package org.chorem.pollen.ui.actions.json; + +import com.google.common.collect.Sets; +import org.chorem.pollen.business.persistence.Poll; +import org.chorem.pollen.entities.PollenBinderHelper; +import org.chorem.pollen.services.impl.PollService; +import org.nuiton.util.beans.Binder; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Obtain participated polls to put in grid for the connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetParticipatedPolls extends AbstractJSONPaginedAction { + + private static final long serialVersionUID = 1L; + + protected transient Map<String, Object>[] polls; + + public Map<String, Object>[] getPolls() { + return polls; + } + + @Override + public Integer getRows() { + return pager.getPageSize(); + } + + @Override + public Integer getPage() { + return pager.getPageIndex(); + } + + @Override + public Integer getTotal() { + return pager.getPagesNumber(); + } + + @Override + public Integer getRecords() { + return pager.getRecords(); + } + + @Override + public String execute() throws Exception { + + PollService pollService = newService(PollService.class); + + boolean ascendantOrder = isSortAscendant(); + String sortColumn = getSortColumn(); + + List<Poll> pollList = pollService.getParticipatedPolls(pager, + sortColumn, + ascendantOrder, + getPollenSession().getUserAccount()); + + polls = new Map[pollList.size()]; + Binder<Poll, Poll> binder = + PollenBinderHelper.getSimpleTopiaBinder(Poll.class); + int index = 0; + for (Poll poll : pollList) { + + Map<String, Object> map = binder.obtainProperties( + poll, + Poll.PROPERTY_TITLE, + Poll.PROPERTY_POLL_ID, + Poll.PROPERTY_DESCRIPTION, + Poll.PROPERTY_BEGIN_DATE, + Poll.PROPERTY_END_DATE + ); + map.put("id", poll.getTopiaId()); + Set<String> functions = getPollFunctions(poll); + map.put("functions", functions); + polls[index++] = map; + } + return SUCCESS; + } + + private Set<String> getPollFunctions(Poll poll) { + Set<String> result = Sets.newHashSet(); + result.add("vote"); + result.add("result"); + return result; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -23,13 +23,15 @@ */ package org.chorem.pollen.ui.actions.json; -import org.chorem.pollen.business.persistence.UserAccount; +import com.google.common.collect.Sets; +import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.entities.PollenBinderHelper; -import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.services.impl.PollService; import org.nuiton.util.beans.Binder; import java.util.List; import java.util.Map; +import java.util.Set; /** * Obtain paginated users. @@ -70,20 +72,53 @@ @Override public String execute() throws Exception { - UserService userService = newService(UserService.class); + PollService pollService = newService(PollService.class); - List<UserAccount> allUsers = userService.getUsers(pager); + boolean ascendantOrder = isSortAscendant(); + String sortColumn = getSortColumn(); - polls = new Map[allUsers.size()]; - Binder<UserAccount, UserAccount> binder = - PollenBinderHelper.newBinder(UserAccount.class); + List<Poll> pollList = pollService.getPolls(pager, + sortColumn, + ascendantOrder); + + polls = new Map[pollList.size()]; + Binder<Poll, Poll> binder = + PollenBinderHelper.getSimpleTopiaBinder(Poll.class); int index = 0; - for (UserAccount user : allUsers) { - Map<String, Object> map = binder.obtainProperties(user); - map.put("id", user.getTopiaId()); + for (Poll poll : pollList) { + + + Map<String, Object> map = binder.obtainProperties( + poll, + Poll.PROPERTY_TITLE, + Poll.PROPERTY_POLL_ID, + Poll.PROPERTY_DESCRIPTION, + Poll.PROPERTY_BEGIN_DATE, + Poll.PROPERTY_END_DATE + ); + map.put("id", poll.getTopiaId()); + Set<String> functions = getPollFunctions(poll); + map.put("functions", functions); polls[index++] = map; } return SUCCESS; } + + protected Set<String> getPollFunctions(Poll poll) { + Set<String> result = Sets.newHashSet(); + result.add("vote"); + result.add("result"); + Boolean closed = poll.getClosed(); + if (closed == null || !closed) { + + // poll is not closed + result.add("edit"); + result.add("close"); + } + result.add("export"); + result.add("clone"); + result.add("delete"); + return result; + } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -64,7 +64,7 @@ UserAccount userAccount = userService.getEntityById(UserAccount.class, userId); Binder<UserAccount, UserAccount> binder = - PollenBinderHelper.newBinder(UserAccount.class); + PollenBinderHelper.getSimpleTopiaBinder(UserAccount.class); user = binder.obtainProperties( userAccount ); Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -72,11 +72,16 @@ UserService userService = newService(UserService.class); - List<UserAccount> allUsers = userService.getUsers(pager); + boolean ascendantOrder = isSortAscendant(); + String sortColumn = getSortColumn(); + List<UserAccount> allUsers = userService.getUsers(pager, + sortColumn, + ascendantOrder); + users = new Map[allUsers.size()]; Binder<UserAccount, UserAccount> binder = - PollenBinderHelper.newBinder(UserAccount.class); + PollenBinderHelper.getSimpleTopiaBinder(UserAccount.class); int index = 0; for (UserAccount user : allUsers) { Map<String, Object> map = binder.obtainProperties( Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -34,4 +34,9 @@ public class DisplayCreatedPolls extends PollenActionSupport { private static final long serialVersionUID = 1L; + + @Override + public String getPageLogo() { + return "Creation"; + } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) @@ -34,4 +34,9 @@ public class DisplayParticipatedPolls extends PollenActionSupport { private static final long serialVersionUID = 1L; + + @Override + public String getPageLogo() { + return "Vote"; + } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml 2012-01-30 23:53:24 UTC (rev 3124) @@ -52,6 +52,27 @@ <result type="json"/> </action> + <!-- get pagined created polls --> + <action name="getCreatedPolls" + class="org.chorem.pollen.ui.actions.json.GetCreatedPolls"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + + <!-- get pagined invited polls --> + <action name="getInvitedPolls" + class="org.chorem.pollen.ui.actions.json.GetInvitedPolls"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + + <!-- get pagined created polls --> + <action name="getParticipatedPolls" + class="org.chorem.pollen.ui.actions.json.GetParticipatedPolls"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + </package> </struts> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-30 23:53:24 UTC (rev 3124) @@ -32,7 +32,6 @@ <package name="poll" extends="default" namespace="/poll"> - <!-- create poll --> <action name="createPoll" class="org.chorem.pollen.ui.actions.poll.CreatePoll"> @@ -57,14 +56,16 @@ <!-- display createds polls --> <action name="displayCreatedPolls" class="org.chorem.pollen.ui.actions.poll.DisplayCreatedPolls"> - <result name="input">/WEB-INF/jsp/createdPolls.jsp</result> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result name="input">/WEB-INF/jsp/poll/createdList.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display participated polls --> <action name="displayParticipatedPolls" class="org.chorem.pollen.ui.actions.poll.DisplayParticipatedPolls"> - <result name="input">/WEB-INF/jsp/participatedPolls.jsp</result> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result name="input">/WEB-INF/jsp/poll/participatedList.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-30 23:53:24 UTC (rev 3124) @@ -7,8 +7,16 @@ pollen.action.editUser=Edit selected user pollen.action.login=Log me In pollen.action.modify=Modify +pollen.action.pollClone=Copy the poll to create a new one +pollen.action.pollClose=Close the poll +pollen.action.pollDelete=Delete the poll +pollen.action.pollEdit=Edit poll +pollen.action.pollExport=Export poll +pollen.action.pollResult=Display poll results +pollen.action.pollVote=Vote pollen.action.register=Register pollen.action.validate=Submit +pollen.common.addingChoices=Adding choices pollen.common.administrator=Admin pollen.common.beginChoiceDate=Begin choice date pollen.common.beginDate=Begin date @@ -18,6 +26,7 @@ pollen.common.endChoiceDate=end choice date pollen.common.endDate=End date pollen.common.firstName=First name +pollen.common.functions=Functions pollen.common.lastName=Last name pollen.common.license=Licence pollen.common.login=Login @@ -56,7 +65,7 @@ pollen.fieldset.poll.general=Your poll pollen.fieldset.poll.options=Options pollen.fieldset.poll.you=You -pollen.fieldset.userInformation=Informations de l'utilisateur +pollen.fieldset.userInformation=User information pollen.fieldset.userInformation.toCreate=User informations to create pollen.fieldset.userInformation.toDelete=User informations to delete pollen.fieldset.userInformation.toUpdate=User informations to update @@ -80,8 +89,13 @@ pollen.menu.polls=Polls pollen.menu.preferences=My account pollen.menu.register=Register -pollen.title.createPoll=Nouveau sondage +pollen.title.createPoll=New poll pollen.title.myAccount=My account +pollen.title.pollsCreatedList=Polls created +pollen.title.pollsCreatedList.legend=Polls you have proposed +pollen.title.pollsInvitedList.legend=Polls for which you are invited to vote pollen.title.pollsList=Polls administration +pollen.title.pollsParticipatedList=Polls participated +pollen.title.pollsParticipatedList.legend=Polls in which you are involved pollen.title.register=Register -pollen.title.usersList=Gestion des utilisateurs +pollen.title.usersList=Users administration Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-30 23:53:24 UTC (rev 3124) @@ -7,8 +7,16 @@ pollen.action.editUser=Editer un utilisateur sélectionné pollen.action.login=M'identifier pollen.action.modify=Modifier +pollen.action.pollClone=Créer un nouveau sondage à partir de celui-ci +pollen.action.pollClose=Fermer le sondage +pollen.action.pollDelete=Supprimer le sondage +pollen.action.pollEdit=Editer le sondage +pollen.action.pollExport=Exporter le sondage +pollen.action.pollResult=Afficher les résultats du sondage +pollen.action.pollVote=Voter pollen.action.register=S'enregistrer pollen.action.validate=Valider +pollen.common.addingChoices=Ajout des choix pollen.common.administrator=Admin pollen.common.beginChoiceDate=Date de début des choix pollen.common.beginDate=Date de début @@ -18,6 +26,7 @@ pollen.common.endChoiceDate=Date de fin des choix pollen.common.endDate=Date de fin pollen.common.firstName=Prénom +pollen.common.functions=Fonctions pollen.common.lastName=Nom pollen.common.license=Licence pollen.common.login=Identifiant @@ -38,9 +47,9 @@ pollen.common.pollOption.reminder=Envoyer des emails de rappel pollen.common.pollOption.reminderHourCountdown=heures avant la fin du sondage pollen.common.pollType=Type de sondage -pollen.common.voteCountingType=Type de dépouillement pollen.common.title=Titre pollen.common.userSupport=Support utilisateur +pollen.common.voteCountingType=Type de dépouillement pollen.common.x=Dépouillement pollen.error.email.required=Courriel obligatoire pollen.error.login.required=Login obligatoire @@ -83,6 +92,11 @@ pollen.menu.register=Inscrivez-vous pollen.title.createPoll=Nouveau sondage pollen.title.myAccount=Mon compte +pollen.title.pollsCreatedList=Sondages créés +pollen.title.pollsCreatedList.legend=Liste des sondages que vous avez proposés +pollen.title.pollsInvitedList.legend=Liste des sondages pour lesquels vous êtes invité à voter pollen.title.pollsList=Liste des sondages +pollen.title.pollsParticipatedList=Sondages participés +pollen.title.pollsParticipatedList.legend=Liste des sondages pour lesquels vous avez voté pollen.title.register=S'enregistrer pollen.title.usersList=Gestion des utilisateurs Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/struts.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/struts.xml 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/struts.xml 2012-01-30 23:53:24 UTC (rev 3124) @@ -137,6 +137,8 @@ <action name="home" class="org.chorem.pollen.ui.actions.PollenActionSupport"> <result>/WEB-INF/jsp/home.jsp</result> + <interceptor-ref name="i18n"/> + <interceptor-ref name="basicStack"/> <interceptor-ref name="store"> <param name="operationMode">RETRIEVE</param> </interceptor-ref> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -115,15 +115,15 @@ <label for="connection_login"> <s:text name="pollen.common.login"/> : </label> - <s:textfield key="login" size="10" required="true" theme="simple"/> + <s:textfield key="login" size="10" required="true" theme="simple" + label=''/> </li> <li> <label for="connection_password"> <s:text name="pollen.common.password"/> : </label> - <s:password key="password" - label="%{getText('pollen.common.password')}" size="10" - required="true" theme="simple"/> + <s:password key="password" size="10" required="true" + label="" theme="simple"/> </li> <li> <s:submit id="submitform" action="login" key="pollen.action.login" Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -23,39 +23,31 @@ <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> -<script type="text/javascript" - src="<s:url value='/js/gridHelper.js' />"></script> +<%@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> <s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/> -<%--script type="text/javascript"> - - jQuery(document).ready(function () { - $.addRowSelectTopic('users'); - $.addClearSelectTopic('users'); - $.addAddRowTopic('users', '${addUrl}'); - $.addSingleRowTopic('users', 'Update', '${editUrl}', 'user.id'); - $.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.id'); - }); -</script--%> - -<sjg:grid id="users" dataType="json" href="%{loadUrl}" gridModel="users" - pager="true" pagerButtons="true" pagerInput="true" +<sjg:grid id="polls" dataType="json" href="%{loadUrl}" gridModel="polls" + sortable="true" pager="true" pagerButtons="true" pagerInput="true" navigator="true" rownumbers="false" autowidth="true" - onSelectRowTopics='users-rowSelect' editinline="true" editurl="%{loadUrl}" + onSelectRowTopics='users-rowSelect' editurl="%{loadUrl}" onCompleteTopics='users-cleanSelect' navigatorEdit="false" navigatorDelete="false" navigatorSearch="false" navigatorRefresh="false" navigatorAdd="false" viewrecords="true" rowList="10,15,20,50,100" rowNum="10"> <sjg:gridColumn name="id" title="id" hidden="true"/> - <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' sortable="false" editable="true"/> - <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' sortable="false" editable="true"/> - <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' sortable="false" editable="true"/> - <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' sortable="false" editable="true"/> - <sjg:gridColumn name="admin" title='%{getText("pollen.common.admin")}' sortable="false" width="100" formatter="checkbox" editable="true" edittype="checkbox"/> + + <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="180" sortable="false"/> </sjg:grid> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -129,7 +129,7 @@ </script> <sjg:grid id="users" dataType="json" href="%{loadUSers}" gridModel="users" - pager="true" pagerButtons="true" pagerInput="true" + sortable="true" pager="true" pagerButtons="true" pagerInput="true" navigator="true" rownumbers="false" autowidth="true" onSelectRowTopics='users-rowSelect' editinline="false" onCompleteTopics='users-clearSelect' @@ -143,17 +143,11 @@ delete:{ title: '%{getText(\"pollen.action.deleteUser\")}', icon: 'ui-icon-trash', topic: 'users-deleteRow' }}"> <sjg:gridColumn name="id" title="id" hidden="true"/> - <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' - sortable="false"/> - <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' - sortable="false"/> - <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' - sortable="false"/> - <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' - sortable="false"/> - <sjg:gridColumn name="administrator" title='%{getText("pollen.common.administrator")}' - sortable="false" width="100" formatter="checkbox" - editable="true" /> + <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}'/> + <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}'/> + <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}'/> + <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}'/> + <sjg:gridColumn name="administrator" title='%{getText("pollen.common.administrator")}'width="100" formatter="checkbox" /> </sjg:grid> <br/> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp 2012-01-30 23:51:17 UTC (rev 3123) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/home.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -26,6 +26,7 @@ <%@ taglib prefix="s" uri="/struts-tags" %> <br/> + <div class="center" style="margin-bottom:20px;"> <img src="<s:url value='/img/pollen_%{safeLanguage}.png' />" alt="Pollen logo"/> </div> Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createdList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createdList.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createdList.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,55 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> + +<%@include file="/WEB-INF/jsp/pollListHelper.jsp"%> + +<title><s:text name="pollen.title.pollsCreatedList"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsCreatedList"/></h1> + +<h4><s:text name="pollen.title.pollsCreatedList.legend"/></h4> + +<s:url id="loadUrl" action="getCreatedPolls" namespace="/json" escapeAmp="false"/> + +<sjg:grid id="polls" dataType="json" href="%{loadUrl}" gridModel="polls" + sortable="true" pager="true" pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='users-rowSelect' editurl="%{loadUrl}" + onCompleteTopics='users-cleanSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" viewrecords="true" + 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="endDate" title='%{getText("pollen.common.endDate")}'/> + <sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}' + formatter="pollFunctions" width="180" sortable="false"/> +</sjg:grid> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createdList.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/participatedList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/participatedList.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/participatedList.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,82 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> + +<%@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> + +<h4><s:text name="pollen.title.pollsInvitedList.legend"/></h4> + +<s:url id="loadInvitedUrl" action="getInvitedPolls" + namespace="/json" escapeAmp="false"/> + +<sjg:grid dataType="json" href="%{loadInvitedUrl}" gridModel="polls" + sortable="true" pager="true" pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='users-rowSelect' editurl="%{loadUrl}" + onCompleteTopics='users-cleanSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" viewrecords="true" + 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="endDate" title='%{getText("pollen.common.endDate")}'/> + <sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}' + formatter="pollFunctions" width="180" sortable="false"/> +</sjg:grid> + + +<h4><s:text name="pollen.title.pollsParticipatedList.legend"/></h4> + +<s:url id="loadParticipatedUrl" action="getParticipatedPolls" + namespace="/json" escapeAmp="false"/> + +<sjg:grid dataType="json" href="%{loadParticipatedUrl}" gridModel="polls" + sortable="true" pager="true" pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='users-rowSelect' editurl="%{loadUrl}" + onCompleteTopics='users-cleanSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" viewrecords="true" + 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="endDate" title='%{getText("pollen.common.endDate")}'/> + <sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}' + formatter="pollFunctions" width="180" sortable="false"/> +</sjg:grid> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/participatedList.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-01-30 23:53:24 UTC (rev 3124) @@ -0,0 +1,97 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/> + +<s:url id="voteUrl" action="vote" namespace="/poll" escapeAmp="false"/> +<s:url id='voteImg' value='/img/vote.png'/> +<s:set id='voteTitle'><s:text name="pollen.action.pollVote"/></s:set> + +<s:url id="resultUrl" action="result" namespace="/poll" escapeAmp="false"/> +<s:url id='resultImg' value='/img/count.png'/> +<s:set id='resultTitle'><s:text name="pollen.action.pollResult"/></s:set> + +<s:url id="editUrl" action="edit" namespace="/poll" escapeAmp="false"/> +<s:url id='editImg' value='/img/edit.png'/> +<s:set id='editTitle'><s:text name="pollen.action.pollEdit"/></s:set> + +<s:url id="closeUrl" action="close" namespace="/poll" escapeAmp="false"/> +<s:url id='closeImg' value='/img/close.png'/> +<s:set id='closeTitle'><s:text name="pollen.action.pollClose"/></s:set> + +<s:url id="exportUrl" action="export" namespace="/poll" escapeAmp="false"/> +<s:url id='exportImg' value='/img/export.png'/> +<s:set id='exportTitle'><s:text name="pollen.action.pollExport"/></s:set> + +<s:url id="cloneUrl" action="clone" namespace="/poll" escapeAmp="false"/> +<s:url id='cloneImg' value='/img/copy.png'/> +<s:set id='cloneTitle'><s:text name="pollen.action.pollClone"/></s:set> + +<s:url id="deleteUrl" action="delete" namespace="/poll" escapeAmp="false"/> +<s:url id='deleteImg' value='/img/delete.png'/> +<s:set id='deleteTitle'><s:text name="pollen.action.pollDelete"/></s:set> + +<script type="text/javascript"> + + function pollFunctions(cellvalue, options, rowObject) { + + var id = rowObject.pollId; + + var result = ""; + + if (cellvalue.indexOf('vote') > -1) { + if (rowObject['voteId']) { + id = rowObject['voteId']; + } + result += formatLink(id, "${voteUrl}", "${voteImg}", "Vote", "${voteTitle}") + } + if (cellvalue.indexOf('result') > -1) { + result += formatLink(id, "${resultUrl}", "${resultImg}", "Result", "${resultTitle}") + } + if (cellvalue.indexOf('edit') > -1) { + result += formatLink(id, "${editUrl}", "${editImg}", "Edit", "${editTitle}") + } + if (cellvalue.indexOf('close') > -1) { + result += formatLink(id, "${closeUrl}", "${closeImg}", "Close", "${closeTitle}") + } + if (cellvalue.indexOf('export') > -1) { + result += formatLink(id, "${exportUrl}", "${exportImg}", "Export", "${exportTitle}") + } + if (cellvalue.indexOf('clone') > -1) { + result += formatLink(id, "${cloneUrl}", "${cloneImg}", "Clone", "${cloneTitle}") + } + if (cellvalue.indexOf('delete') > -1) { + result += formatLink(id, "${deleteUrl}", "${deleteImg}", "Delete", "${deleteTitle}") + } + return result; + } + function formatLink(id, baseUrl, image, imageAlt, imageTitle) { + var url = $.prepareUrl(baseUrl, {pollId:id}); + return "<a href='" + url + "'><image alt='" + imageAlt + "' title='" + imageTitle + "' src='" + image + "'> </a>"; + } +</script> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native
participants (1)
-
tchemit@users.chorem.org