Author: tchemit Date: 2012-05-24 11:14:53 +0200 (Thu, 24 May 2012) New Revision: 3379 Url: http://chorem.org/repositories/revision/pollen/3379 Log: improve dialog box usage refs #172: [Comment] Pagination des commentaires Added: 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 Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollChoice.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollComment.jsp trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollVote.jsp 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/confirmDeletePollChoice.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollChoice.jsp 2012-05-24 09:11:39 UTC (rev 3378) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollChoice.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -38,7 +38,9 @@ <hr/> - <div class="cleanBoth"> - <s:submit key="pollen.action.delete" align="right"/> + <div align="right"> + <s:submit onclick="return closeConfirmDialog();" theme="simple" + key="pollen.action.cancel"/> + <s:submit key="pollen.action.delete" theme="simple"/> </div> </s:form> \ No newline at end of file Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollComment.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollComment.jsp 2012-05-24 09:11:39 UTC (rev 3378) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollComment.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -27,7 +27,6 @@ <s:form method="POST" namespace="/poll" action="deleteComment"> <s:hidden name="uriId" value='%{uriId}'/> - <s:hidden name="commentId" value='%{comment.topiaId}'/> <s:textfield key='comment.postDate' readonly="true" size="50" @@ -41,7 +40,9 @@ <hr/> - <div class="cleanBoth"> - <s:submit key="pollen.action.delete" align="right"/> + <div align="right"> + <s:submit onclick="return closeConfirmDialog();" theme="simple" + key="pollen.action.cancel"/> + <s:submit key="pollen.action.delete" theme="simple"/> </div> </s:form> \ No newline at end of file Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollVote.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollVote.jsp 2012-05-24 09:11:39 UTC (rev 3378) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/confirmDeletePollVote.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -37,7 +37,9 @@ <hr/> - <div class="cleanBoth"> - <s:submit key="pollen.action.delete" align="right"/> + <div align="right"> + <s:submit onclick="return closeConfirmDialog();" theme="simple" + key="pollen.action.cancel"/> + <s:submit key="pollen.action.delete" theme="simple"/> </div> </s:form> \ No newline at end of file Added: 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 (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -0,0 +1,47 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<div> + <s:if test="isDeleteCommentAllowed(#comment)"> + <span class="cmd"> + <s:a href="#" + onclick="return openDeleteCommentDialog('%{#comment.topiaId}');"> + <img src="<s:url value='/img/delete.png'/>" + title="<s:text name="pollen.action.pollCommentDelete"/>" + alt="<s:text name="pollen.action.pollCommentDelete"/>"/> + </s:a> + </span> + </s:if> + <span class="name"><s:property value='%{#comment.author}'/></span> : + <span class="date"> + <s:property value='#comment.postDate'/> + <%--<s:property value='%{formatDateTime(#postDate)}'/>--%> + </span> + + <p> + <s:property value='#comment.text'/> + </p> +</div> \ No newline at end of file Property changes on: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComment.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: 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 (rev 0) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/displayPollComments.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -0,0 +1,173 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id: vote.jsp 3369 2012-05-18 00:53:19Z tchemit $ + $HeadURL: http://svn.chorem.org/svn/pollen/trunk/pollen-ui-struts2/src/main/webapp/WEB... $ + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<link rel="stylesheet" href="<s:url value='/css/pagination.css'/>"/> +<script type="text/javascript" + src="<s:url value='/js/jquery.pagination.js' />"></script> + +<%-- +<input type="text" value="5" name="items_per_page" id="items_per_page" class="numeric"/> +<input type="text" value="10" name="num_display_entries" id="num_display_entries" class="numeric"/> +<input type="text" value="2" name="num_edge_entries" id="num_edge_entries" class="numeric"/> +<input type="text" value="Prev" name="prev_text" id="prev_text"/> +<input type="text" value="Next" name="next_text" id="next_text"/> +--%> +<script type="text/javascript"> + + $(document).ready(function () { + + $('#commentsDiv div:even').addClass('even'); + $('#commentsDiv div:odd').addClass('odd'); + + var optInit = getOptionsFromForm(); + + $("#Pagination").pagination(members.length, optInit); + }); + +</script> +<div id="Pagination" class="pagination"></div> +<div id="commentsDiv"> + <s:iterator value="comments" var="comment" status="status"> + <s:set name="comment" value="%{#comment}"/> + <%@include file="displayPollComment.jsp" %> + </s:iterator> + + +</div> + +<div id="polls_pager" style="height:36px;" + class="ui-state-default ui-jqgrid-pager ui-corner-bottom" dir="ltr"> + <div id="pg_polls_pager" class="ui-pager-control" role="group" align="center"> + + <table cellspacing="0" cellpadding="0" border="0" + style="table-layout:auto;" class="ui-pg-table"> + <tbody> + <tr> + <td id="first_polls_pager" + class="ui-pg-button ui-corner-all" + style="cursor: default; "><span + class="ui-icon ui-icon-seek-first"></span></td> + <td id="prev_polls_pager" + class="ui-pg-button ui-corner-all ui-state-disabled" + style="cursor: default; "><span + class="ui-icon ui-icon-seek-prev"></span></td> + <td class="ui-pg-button ui-state-disabled" + style="width: 4px; cursor: default; "><span + class="ui-separator"></span></td> + <td dir="ltr">Page <input class="ui-pg-input" type="text" + maxlength="7" value="0" role="textbox"> + sur <span id="sp_1_polls_pager">1</span></td> + <td class="ui-pg-button ui-state-disabled" + style="width: 4px; cursor: default; "><span + class="ui-separator"></span></td> + <td id="next_polls_pager" + class="ui-pg-button ui-corner-all ui-state-disabled" + style="cursor: default; "><span + class="ui-icon ui-icon-seek-next"></span></td> + <td id="last_polls_pager" + class="ui-pg-button ui-corner-all ui-state-disabled" + style="cursor: default; "><span + class="ui-icon ui-icon-seek-end"></span></td> + <td dir="ltr"><select class="ui-pg-selbox" role="listbox"> + <option role="option" value="10" selected="selected">10</option> + <option role="option" value="15">15</option> + <option role="option" value="20">20</option> + <option role="option" value="50">50</option> + <option role="option" value="100">100</option> + </select></td> + </tr> + </tbody> + </table> + + <%--<table cellspacing="0" cellpadding="0" border="0" class="ui-pg-table"--%> + <%--style="width:100%;table-layout:fixed;" role="row">--%> + <%--<tbody>--%> + <%--<tr>--%> + <%--<td id="polls_pager_left" align="left">--%> + <%--<table cellspacing="0" cellpadding="0" border="0"--%> + <%--class="ui-pg-table navtable"--%> + <%--style="float:left;table-layout:auto;">--%> + <%--<tbody>--%> + <%--<tr></tr>--%> + <%--</tbody>--%> + <%--</table>--%> + <%--</td>--%> + <%--<td id="polls_pager_center" align="center"--%> + <%--style="white-space: pre;">--%> + <%--<table cellspacing="0" cellpadding="0" border="0"--%> + <%--style="table-layout:auto;" class="ui-pg-table">--%> + <%--<tbody>--%> + <%--<tr>--%> + <%--<td id="first_polls_pager"--%> + <%--class="ui-pg-button ui-corner-all"--%> + <%--style="cursor: default; "><span--%> + <%--class="ui-icon ui-icon-seek-first"></span></td>--%> + <%--<td id="prev_polls_pager"--%> + <%--class="ui-pg-button ui-corner-all ui-state-disabled"--%> + <%--style="cursor: default; "><span--%> + <%--class="ui-icon ui-icon-seek-prev"></span></td>--%> + <%--<td class="ui-pg-button ui-state-disabled"--%> + <%--style="width: 4px; cursor: default; "><span--%> + <%--class="ui-separator"></span></td>--%> + <%--<td dir="ltr">Page <input class="ui-pg-input" type="text"--%> + <%--maxlength="7" value="0" role="textbox">--%> + <%--sur <span id="sp_1_polls_pager">1</span></td>--%> + <%--<td class="ui-pg-button ui-state-disabled"--%> + <%--style="width: 4px; cursor: default; "><span--%> + <%--class="ui-separator"></span></td>--%> + <%--<td id="next_polls_pager"--%> + <%--class="ui-pg-button ui-corner-all ui-state-disabled"--%> + <%--style="cursor: default; "><span--%> + <%--class="ui-icon ui-icon-seek-next"></span></td>--%> + <%--<td id="last_polls_pager"--%> + <%--class="ui-pg-button ui-corner-all ui-state-disabled"--%> + <%--style="cursor: default; "><span--%> + <%--class="ui-icon ui-icon-seek-end"></span></td>--%> + <%--<!--td dir="ltr"><select class="ui-pg-selbox" role="listbox">--%> + <%--<option role="option" value="10" selected="selected">10</option>--%> + <%--<option role="option" value="15">15</option>--%> + <%--<option role="option" value="20">20</option>--%> + <%--<option role="option" value="50">50</option>--%> + <%--<option role="option" value="100">100</option>--%> + <%--</select></td-->--%> + <%--</tr>--%> + <%--</tbody>--%> + <%--</table>--%> + <%--</td>--%> + <%--<td id="polls_pager_right" align="right">--%> + <%--<select class="ui-pg-selbox" role="listbox">--%> + <%--<option role="option" value="10" selected="selected">10</option>--%> + <%--<option role="option" value="15">15</option>--%> + <%--<option role="option" value="20">20</option>--%> + <%--<option role="option" value="50">50</option>--%> + <%--<option role="option" value="100">100</option>--%> + <%--</select>--%> + <%--</td>--%> + <%--</tr>--%> + <%--</tbody>--%> + <%--</table>--%> + </div> +</div> \ No newline at end of file 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-05-24 09:11:39 UTC (rev 3378) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-05-24 09:14:53 UTC (rev 3379) @@ -24,7 +24,6 @@ <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <title><s:property value="%{poll.title}"/></title> @@ -34,57 +33,56 @@ <script type="text/javascript" src="<s:url value='/js/gridHelper.js' />"></script> -<s:url id='deleteImg' value='/img/delete.png'/> -<s:set id='deleteTitle'><s:text name="pollen.action.pollCommentDelete"/></s:set> +<s:set id='deleteCommentTitle'> + <s:text name="pollen.title.delete.pollComment"/> +</s:set> +<s:set id='deleteCommentVote'> + <s:text name="pollen.title.delete.pollVote"/> +</s:set> +<s:set id='deleteCommentChoice'> + <s:text name="pollen.title.delete.pollChoice"/> +</s:set> <script type="text/javascript"> - function commentFunctions(cellvalue, options, rowObject) { - - var id = rowObject.id; - - var result = ""; - - if (cellvalue.indexOf('delete') > -1) { - var url = "return openDeleteCommentDialog(\"" + id + "\");"; - result += formatLink(id, url, "${deleteImg}", "Delete", "${deleteTitle}") - } - return result; + function openConfirmDialog(title, url) { + $('.ui-dialog-title').html(title); + var dialog = $("#confirmDialog"); + dialog.html(''); + dialog.load(url); + dialog.dialog('open'); + return false; } - function formatLink(id, baseUrl, image, imageAlt, imageTitle) { - //var url = $.prepareUrl(baseUrl, {commentId:id}); - return "<a href='#' onclick='" + baseUrl + "'><image alt='" + imageAlt + "' title='" + imageTitle + "' src='" + image + "'> </a>"; -// return "<a href='" + url + "'><image alt='" + imageAlt + "' title='" + imageTitle + "' src='" + image + "'> </a>"; + function closeConfirmDialog() { + $('#confirmDialog').dialog('close'); + return false; } function openDeleteCommentDialog(commentId) { - var dialog = $("#deleteCommentDialog"); - var uriId = "<s:property value='%{uriId}'/>"; - var url = $.prepareUrl("<s:url action='confirmDeleteComment' namespace='/poll'/>", - {uriId:uriId, commentId:commentId}); - dialog.load(url); - dialog.dialog('open'); - return false; + return openConfirmDialog( + "<s:property value='%{deleteCommentTitle}'/>", + $.prepareUrl("<s:url action='confirmDeleteComment' namespace='/poll'/>", + { uriId:"<s:property value='%{uriId}'/>", + commentId:commentId}) + ); } function openDeleteVoteDialog(voteId) { - var dialog = $("#deleteVoteDialog"); - var uriId = "<s:property value='%{uriId}'/>"; - var url = $.prepareUrl("<s:url action='confirmDeleteVote' namespace='/poll'/>", - {uriId:uriId, voteId:voteId}); - dialog.load(url); - dialog.dialog('open'); - return false; + return openConfirmDialog( + "<s:property value='%{deleteCommentVote}'/>", + $.prepareUrl("<s:url action='confirmDeleteVote' namespace='/poll'/>", + {uriId:"<s:property value='%{uriId}'/>", + voteId:voteId}) + ); } function openDeleteChoiceDialog(choiceId) { - var dialog = $("#deleteChoiceDialog"); - var uriId = "<s:property value='%{uriId}'/>"; - var url = $.prepareUrl("<s:url action='confirmDeleteChoice' namespace='/poll'/>", - {uriId:uriId, choiceId:choiceId}); - dialog.load(url); - dialog.dialog('open'); - return false; + return openConfirmDialog( + "<s:property value='%{deleteCommentChoice}'/>", + $.prepareUrl("<s:url action='confirmDeleteChoice' namespace='/poll'/>", + {uriId:"<s:property value='%{uriId}'/>", + choiceId:choiceId}) + ); } jQuery(document).ready(function () { @@ -123,7 +121,6 @@ alt="<s:text name="pollen.common.vote.results"/>"/> </s:a> </s:if> - <%--<t:FeedContextLink t:id="feedContext"/>--%> <s:if test="feedFileExisting"> <s:a namespace="/poll" action="getFeed"> <s:param name="pollId" value="poll.pollId"/> @@ -163,14 +160,6 @@ <%--t:currentPage="page" t:noPagerText="prop:noPagerText"/>--%> </s:else> -<sj:dialog id="deleteVoteDialog" height="120" resizable="false" - title="%{getText('pollen.title.delete.pollVote')}" - autoOpen="false" modal="true" width="800"/> - -<sj:dialog id="deleteChoiceDialog" height="100" resizable="false" - title="%{getText('pollen.title.delete.pollChoice')}" - autoOpen="false" modal="true" width="800"/> - <s:form id="voteForm" validate="true"> <s:hidden key="uriId" label=''/> <table id="poll"> @@ -190,7 +179,8 @@ <th> <s:if test="!isDescNull(#choice)"> - <span title='<s:property value="escapeLineBreak(#choice.description)"/>'> + <span + title='<s:property value="escapeLineBreak(#choice.description)"/>'> <s:property value="name"/> </span> </s:if> @@ -199,7 +189,8 @@ </s:else> <s:if test="pollChoiceRunning"> <s:if test="creatorUser"> - <s:a action="deleteChoice" namespace="/poll" onclick="return openDeleteChoiceDialog('%{#choice.topiaId}');"> + <s:a action="deleteChoice" namespace="/poll" + onclick="return openDeleteChoiceDialog('%{#choice.topiaId}');"> <s:param name="choiceId"><s:property value="id"/></s:param> <img src="<s:url value="/img/delete.png"/>" title="<s:text name="pollen.action.deleteChoice"/>" @@ -281,25 +272,28 @@ <s:if test="!isChoiceHidden(#choice)"> <th> <s:if test="normalVoteCounting"> - <s:checkbox name="vote.choiceVoteToChoice[%{#status.index}].voteValue" - value="%{vote.choiceVoteToChoice[#status.index].voteValue}" theme="simple"/> + <s:checkbox + name="vote.choiceVoteToChoice[%{#status.index}].voteValue" + value="%{vote.choiceVoteToChoice[#status.index].voteValue}" + theme="simple"/> </s:if> <s:if test="percentageVoteCounting"> - <s:textfield name="vote.choiceVoteToChoice[%{#status.index}].voteValue" - value="%{vote.choiceVoteToChoice[#status.index].voteValue}" - required="true" size="3" theme="simple"/> - <%--t:validate="required, min=0, max=100"/>%--%> + <s:textfield + name="vote.choiceVoteToChoice[%{#status.index}].voteValue" + value="%{vote.choiceVoteToChoice[#status.index].voteValue}" + required="true" size="3" theme="simple"/> </s:if> <s:if test="condorcetVoteCounting"> - <s:textfield name="vote.choiceVoteToChoice[%{#status.index}].voteValue" - value="%{vote.choiceVoteToChoice[#status.index].voteValue}" - id="condorcetInput" size="3" theme="simple"/> - <%--t:nulls="zero" t:validate="min=0, max=99"/>--%> + <s:textfield + name="vote.choiceVoteToChoice[%{#status.index}].voteValue" + value="%{vote.choiceVoteToChoice[#status.index].voteValue}" + id="condorcetInput" size="3" theme="simple"/> </s:if> <s:if test="numberVoteCounting"> - <s:textfield name="vote.choiceVoteToChoice[%{#status.index}].voteValue" - value="%{vote.choiceVoteToChoice[#status.index].voteValue}" - size="3" theme="simple"/> + <s:textfield + name="vote.choiceVoteToChoice[%{#status.index}].voteValue" + value="%{vote.choiceVoteToChoice[#status.index].voteValue}" + size="3" theme="simple"/> </s:if> </th> </s:if> @@ -414,18 +408,16 @@ <div id="voteError"> <s:fielderror fieldName="pollAccount.votingId"/> <s:fielderror fieldName="vote.choices"/> - <%--<t:errors/>--%> </div> <s:if test="voteAllowed"> <div id="buttons"> <s:if test="poll.anonymousVoteAllowed"> <s:checkbox key="vote.anonymous"/> - <%--<t:label for="anonymousVote"/>--%> <br/> </s:if> - <s:submit action="vote/%{uriId}" key="pollen.action.pollVote" align="center"/> - <%--<input id="submitVote" t:type="Submit" t:value="${message:submitVote}"/>--%> + <s:submit action="vote/%{uriId}" key="pollen.action.pollVote" + align="center"/> </div> </s:if> </s:form> @@ -434,32 +426,34 @@ <!-- Ajout de choix --> <s:if test="pollChoiceRunning"> <div id="choiceFormDiv"> - <s:form id="choiceForm" method="POST" namespace="/poll" enctype="multipart/form-data"> + <s:form id="choiceForm" method="POST" namespace="/poll" + enctype="multipart/form-data"> <h4><s:text name="pollen.action.addChoice"/></h4> - <s:if test="textType"> - <s:textfield key="choice.name" + <s:if test="textType"> + <s:textfield key="choice.name" + label="%{getText('pollen.common.choice')}" + required="true"/> + </s:if> + <s:elseif test="dateType"> + <sj:datepicker key="choice.date" label="%{getText('pollen.common.choice')}" + changeMonth="true" changeYear="true" + timepicker="true" + displayFormat="%{getText('pollen.common.datePickerPattern')}" required="true"/> - </s:if> - <s:elseif test="dateType"> - <sj:datepicker key="choice.date" - label="%{getText('pollen.common.choice')}" - changeMonth="true" changeYear="true" - timepicker="true" - displayFormat="%{getText('pollen.common.datePickerPattern')}" - required="true"/> - </s:elseif> - <s:elseif test="imageType"> - <s:file key="choice.location" - label="%{getText('pollen.common.choice')}" - cssClass="nameField" - required="true"/> - </s:elseif> - <br/> - <s:textarea cols="36" key="choice.description" - label="%{getText('pollen.common.description')}"/> - <br/> - <s:submit action="addChoice/%{uriId}" key="pollen.action.addChoice" align="center"/> + </s:elseif> + <s:elseif test="imageType"> + <s:file key="choice.location" + label="%{getText('pollen.common.choice')}" + cssClass="nameField" + required="true"/> + </s:elseif> + <br/> + <s:textarea cols="36" key="choice.description" + label="%{getText('pollen.common.description')}"/> + <br/> + <s:submit action="addChoice/%{uriId}" key="pollen.action.addChoice" + align="center"/> </s:form> </div> </s:if> @@ -468,67 +462,10 @@ <h3><s:text name="pollen.common.comments"/></h3> <div id="commentZone"> - <div id="commentsDiv"> - <s:iterator value="comments" var="comment" status="status"> - <div - <s:if test="#status.even">class="even"</s:if> - <s:else>class="odd"</s:else> - > - <s:if test="isDeleteCommentAllowed(#comment)"> - <span class="cmd"> - <s:a href="#" - onclick="return openDeleteCommentDialog('%{#comment.topiaId}');"> - <img src="<s:url value='/img/delete.png'/>" - title="<s:text name="pollen.action.pollCommentDelete"/>" - alt="<s:text name="pollen.action.pollCommentDelete"/>"/> - </s:a> - </span> - </s:if> - <span class="name"><s:property value='#comment.author'/></span> : - <span class="date"> - <s:property value='%{formatDateTime(postDate)}'/> - </span> - <p> - <s:property value='text'/> - </p> - </div> - </s:iterator> - </div> - <%--div id="commentsDiv"> + <%--Show paginated comments--%> + <%@include file="displayPollComments.jsp" %> - <s:url id="loadPollComments" action="getPollComments" namespace="/json" - escapeAmp="false"> - <s:param name="pollId" value="%{poll.pollId}"/> - </s:url> - - <sjg:grid id="comments" dataType="json" href="%{loadPollComments}" - gridModel="comments" sortable="true" pager="true" - pagerButtons="true" pagerInput="true" navigator="true" - rownumbers="false" autowidth="true" editinline="false" - navigatorEdit="false" navigatorDelete="false" - navigatorSearch="false" navigatorRefresh="false" - navigatorAdd="false" viewrecords="true" sortorder="desc" - sortname="postDate" rowList="10,15,20,50,100" rowNum="10"> - - <sjg:gridColumn name="id" title="id" hidden="true"/> - <sjg:gridColumn name="postDate" - title='%{getText("pollen.common.postDate")}' - sortable="true" formatter="date" width="50" - formatoptions="{newformat : 'd.m.Y H:i', srcformat : 'Y-m-d H:i:s'}"/> - <sjg:gridColumn name="pollAccount.votingId" - title='%{getText("pollen.common.commentName")}' - sortable="true"/> - <sjg:gridColumn name="text" - title='%{getText("pollen.common.commentText")}' - sortable="true"/> - <sjg:gridColumn name="functions" sortable="false" title='' width="10" - formatter="commentFunctions"/> - </sjg:grid> - </div--%> - - <%--<br/>--%> - <div id="commentFormDiv"> <s:form id='addCommentForm' method="POST" namespace="/poll" validate="true"> @@ -545,9 +482,7 @@ </div> - <sj:dialog id="deleteCommentDialog" resizable="false" - title="%{getText('pollen.title.delete.pollComment')}" - autoOpen="false" modal="true" width="800"/> - + <sj:dialog id="confirmDialog" resizable="false" autoOpen="false" modal="true" + width="800"/> </div> </s:if> \ No newline at end of file
participants (1)
-
tchemit@users.chorem.org