You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/11/29 23:52:47 UTC

svn commit: r349826 - in /incubator/roller/trunk: src/org/roller/presentation/servlets/ src/org/roller/presentation/weblog/actions/ src/org/roller/presentation/weblog/formbeans/ web/WEB-INF/classes/ web/theme/ web/weblog/

Author: snoopdave
Date: Tue Nov 29 14:52:36 2005
New Revision: 349826

URL: http://svn.apache.org/viewcvs?rev=349826&view=rev
Log:
Polishing up comment moderation/management

Modified:
    incubator/roller/trunk/src/org/roller/presentation/servlets/CommentServlet.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/CommentManagementForm.java
    incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/trunk/web/theme/roller.css
    incubator/roller/trunk/web/weblog/CommentManagement.jsp
    incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp
    incubator/roller/trunk/web/weblog/WeblogEditSidebar.jsp

Modified: incubator/roller/trunk/src/org/roller/presentation/servlets/CommentServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/servlets/CommentServlet.java?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/servlets/CommentServlet.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/servlets/CommentServlet.java Tue Nov 29 14:52:36 2005
@@ -146,6 +146,7 @@
             
             if (preview) {
                 message = "This is a comment preview only";
+                error = bundle.getString("commentServlet.previewMarkedAsSpam");
                 request.setAttribute("previewComments", "dummy");
                 mLogger.debug("Comment is a preview");
                 
@@ -158,7 +159,7 @@
                     // If comment contains blacklisted text, mark as spam
                     SpamChecker checker = new SpamChecker();
                     if (checker.checkComment(comment)) {
-                       error = bundle.getString("commentServlet.markedAsSpam");
+                       error = bundle.getString("commentServlet.commentMarkedAsSpam");
                        mLogger.debug("Comment marked as spam"); 
                     }
                      
@@ -166,6 +167,7 @@
                     if (website.getModerateComments().booleanValue()) {
                         comment.setPending(Boolean.TRUE);   
                         comment.setApproved(Boolean.FALSE);
+                        message = bundle.getString("commentServlet.submittedToModerator");
                     } else { 
                         comment.setPending(Boolean.FALSE);   
                         comment.setApproved(Boolean.TRUE);
@@ -195,9 +197,9 @@
         }
         
         // the work has been done, now send the user back to the entry page
-        if(error != null)
+        if (error != null)
             session.setAttribute(RollerSession.ERROR_MESSAGE, error);
-        else if(message != null)
+        if (message != null)
             session.setAttribute(RollerSession.STATUS_MESSAGE, message);
         
         if(error == null && message == null && !preview) {

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/CommentManagementAction.java Tue Nov 29 14:52:36 2005
@@ -4,6 +4,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -27,17 +28,16 @@
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.CommentManagementForm;
-import org.roller.presentation.weblog.formbeans.CommentQueryForm;
 import org.roller.util.Utilities;
 
 /**
  * Action for quering, approving, marking as spam and deleting comments.
  *
  * @struts.action path="/editor/commentManagement" name="commentManagementForm" 
- *     scope="session" parameter="method"
+ *     scope="request" parameter="method"
  *
  * @struts.action path="/editor/commentQuery" name="commentQueryForm" 
- *     scope="session" parameter="method"
+ *     scope="request" parameter="method"
  *
  * @struts.action-forward name="commentManagement.page" path=".CommentManagement"
  */
@@ -77,15 +77,25 @@
         
         CommentManagementForm queryForm = (CommentManagementForm)actionForm;
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
+        if (rreq.getWeblogEntry() != null) {
+            queryForm.setEntryid(rreq.getWeblogEntry().getId());
+            queryForm.setWeblog(rreq.getWeblogEntry().getWebsite().getHandle());
+        }        
+        else if (rreq.getWebsite() != null) {
+            queryForm.setWeblog(rreq.getWebsite().getHandle());
+        }    
         RollerSession rollerSession = RollerSession.getRollerSession(request);
         try {
             if (rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite())) { 
                 WeblogManager mgr= RollerFactory.getRoller().getWeblogManager();
+                
+                // delete all comments with delete box checked
                 String[] deleteIds = queryForm.getDeleteComments();
                 List deletedList = Arrays.asList(deleteIds); 
                 if (deleteIds != null && deleteIds.length > 0) {
                     mgr.removeComments(deleteIds);
-                }                
+                }    
+                // loop through all comments displayed on page
                 String[] ids = Utilities.stringToStringArray(queryForm.getIds(),",");
                 for (int i=0; i<ids.length; i++) { 
                     if (deletedList.contains(ids[i])) continue;
@@ -97,11 +107,8 @@
                     } else {
                         comment.setSpam(Boolean.FALSE);
                     }
-                    if (approvedIds.contains(ids[i])) {
-                        comment.setPending(Boolean.FALSE);
-                    } else {
-                        comment.setPending(Boolean.TRUE);
-                    }
+                    // all comments have been reviewed, so they're no longer pending
+                    comment.setPending(Boolean.FALSE);
                     comment.save();
                 }               
                 RollerFactory.getRoller().commit();
@@ -176,6 +183,15 @@
         public int getCommentCount() {
             int ret = comments.size();            
             return ret > queryForm.getCount() ? queryForm.getCount() : ret;
+        }
+        
+        public int getPendingCommentCount() {
+            int count = 0;
+            for (Iterator iter = comments.iterator(); iter.hasNext();) {
+                CommentData cd = (CommentData)iter.next();
+                if (cd.getPending().booleanValue()) count++;
+            }
+            return count;
         }
         
         public Date getEarliestDate() {

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/CommentManagementForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/CommentManagementForm.java?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/CommentManagementForm.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/formbeans/CommentManagementForm.java Tue Nov 29 14:52:36 2005
@@ -73,7 +73,32 @@
         cal.set(Calendar.DAY_OF_MONTH, 1);
         setStartDateString(df.format(cal.getTime()));
     }    
-    
+
+    public void loadCheckboxes(List comments) {
+        ArrayList all = new ArrayList();
+        ArrayList approvedList = new ArrayList();
+        ArrayList spamList = new ArrayList();
+        Iterator it = comments.iterator();
+        while (it.hasNext()) {
+            CommentData comment = (CommentData)it.next();
+            all.add(comment.getId());
+            if (comment.getApproved().booleanValue()) {
+                approvedList.add(comment.getId());
+            }            
+            if (comment.getSpam().booleanValue()) {
+                spamList.add(comment.getId());
+            }
+        }
+        String[] idArray = (String[])all.toArray(
+            new String[all.size()]);
+        ids = Utilities.stringArrayToString(idArray,",");
+        
+        approvedComments = (String[])approvedList.toArray(
+            new String[approvedList.size()]);
+        spamComments = (String[])spamList.toArray(
+            new String[spamList.size()]);
+    }
+        
     public Date getStartDate(Locale locale) {
         Date startDate = null;
         final DateFormat df =
@@ -231,30 +256,6 @@
     
     public void setApprovedComments(String[] approvedComments) {
         this.approvedComments = approvedComments;
-    }
-
-    public void loadCheckboxes(List comments) {
-        ArrayList all = new ArrayList();
-        ArrayList approvedList = new ArrayList();
-        ArrayList spamList = new ArrayList();
-        Iterator it = comments.iterator();
-        while (it.hasNext()) {
-            CommentData comment = (CommentData)it.next();
-            if (comment.getApproved().booleanValue()) {
-                approvedList.add(comment.getId());
-            }            
-            if (comment.getSpam().booleanValue()) {
-                spamList.add(comment.getId());
-            }
-        }
-        String[] idArray = (String[])approvedList.toArray(
-            new String[approvedList.size()]);
-        ids = Utilities.stringArrayToString(idArray,",");
-        
-        approvedComments = (String[])approvedList.toArray(
-            new String[approvedList.size()]);
-        spamComments = (String[])spamList.toArray(
-            new String[spamList.size()]);
     }
 
 }

Modified: incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties Tue Nov 29 14:52:36 2005
@@ -176,20 +176,30 @@
 commentManagement.subtitle=Manage comments accross all weblogs in system
 commentManagement.entry.subtitle=Manage comments for entry titled <span>{0}</span>
 commentManagement.website.subtitle=Manage comments in weblog <span>{0}</span>
-commentManagement.tip=You can change comment approval, change spam status and \
-delete comments by setting and unsetting the checkboxes below. Click the \
-<b>Save changes</b> button at the bottom of the page to save your changes.
 
-commentManagement.nowShowing=Displaying <b>{0}</b> comments from <b>{1}</b> to <b>{2}</b>
+commentManagement.tip=You have comments. \
+You can change approval, spam status and delete comments via the checkboxes below. \
+If you make any changes, be sure to save them by clicking the \
+<em>Save changes</em> at the bottom of the page.
+
+commentManagement.pendingTip=<em>You have comments pending approval</em>.<br /><br /> \
+Please review the approved and spam checkboxes to make sure they are correct. \
+Remember to click the <em>Save changes</em> button when you are done \
+(even if you make no changes).
+
+commentManagement.nowShowing=Displaying <b>{0}</b> comments
 commentManagement.noCommentsFound=No comments found
 
+commentManagement.pending=Pending
+commentManagement.approved=Approved
+commentManagement.spam=Spam
+
 commentManagement.next=Next page
 commentManagement.prev=Previous page
 commentManagement.query=Query
 commentManagement.endDate=End date
 commentManagement.startDate=Start date
 
-
 commentManagement.pendingStatus=Pending status
 commentManagement.onlyPending=Pending only
 commentManagement.onlyApproved=Approved only
@@ -210,7 +220,6 @@
 commentManagement.sidebarTitle=Filter comments
 commentManagement.sidebarDescription=Filter comments by search string, status, and/or date
 
-
 commentManagement.commentBy=Posted by 
 commentManagement.commentByBoth={0} (<a href="mailto:{1}">{1}</a>) from IP address {2}
 commentManagement.commentByName={0} from IP address {1}
@@ -218,6 +227,7 @@
 commentManagement.postTime=Posted at
 commentManagement.entryTitled=Regarding
 commentManagement.editEntry=Edit
+commentManagement.returnToEntry=Return to entry
 
 commentManagement.select=Select
 commentManagement.all=All
@@ -225,7 +235,9 @@
 
 # -------------------------------------------------------------- CommentServlet
 
-commentServlet.markedAsSpam=Your comment appears to be spam.
+commentServlet.commentMarkedAsSpam=Your comment was marked as spam and will not be displayed.
+commentServlet.previewMarkedAsSpam=If you submit this comment, it will be marked as spam ane not displayed.
+commentServlet.submittedToModerator=Your comment has been submitted to the moderator for approval.
 
 # --------------------------------------------------------------- Configuration
 
@@ -1016,9 +1028,9 @@
 
 tabbedmenu.weblog=Create &amp; Edit
 tabbedmenu.weblog.newEntry=New Entry
-tabbedmenu.weblog.archives=Edit Entries
+tabbedmenu.weblog.archives=Entries
 tabbedmenu.weblog.categories=Categories
-tabbedmenu.weblog.commentManagement=Manage Comments
+tabbedmenu.weblog.commentManagement=Comments
 tabbedmenu.bookmarks.allFolders=Bookmarks
 tabbedmenu.bookmarks.import=Import
 tabbedmenu.weblog.referers=Referrers
@@ -1040,7 +1052,7 @@
 tabbedmenu.admin=Global Admin
 tabbedmenu.admin.config=Configuration
 tabbedmenu.admin.userAdmin=User Admin
-tabbedmenu.admin.commentManagement=Manage Comments
+tabbedmenu.admin.commentManagement=Comments
 tabbedmenu.admin.createUser=New User
 tabbedmenu.admin.pingTargets=Ping Targets
 
@@ -1302,18 +1314,7 @@
 weblogEdit.trackbackResults=<b>Trackback response (error code 0 indicates \
 success):</b><br /><br />{0}
 
-weblogEdit.commentSettings=Comment Settings
-weblogEdit.commentDelete=Delete
-weblogEdit.commentSpam=Spam
-weblogEdit.comments=Manage Comments
-weblogEdit.commenterName=Name
-weblogEdit.commenterEmail=E-Mail
-weblogEdit.commenterUrl=URL
-weblogEdit.comment=Comment
-weblogEdit.comments=Comments
-weblogEdit.updateComments=Update Comments
-weblogEdit.noComments=This entry has no comments
-weblogEdit.commentCount=Number of comments: 
+weblogEdit.hasComments=Comments [{0}]
 
 weblogEdit.mediaCastFailedFetchingInfo=Unable to reach the MediaCast server. Check the hostname in the URL.
 weblogEdit.mediaCastUrlMalformed=The MediaCast URL was malformed.

Modified: incubator/roller/trunk/web/theme/roller.css
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/theme/roller.css?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/web/theme/roller.css (original)
+++ incubator/roller/trunk/web/theme/roller.css Tue Nov 29 14:52:36 2005
@@ -296,8 +296,23 @@
 tr.actionrow {
     background: #e5e5e5;
 }
-tr.pendingcomment {
+td.spamcomment {
     background: #ffcccc;
+}
+td.pendingcomment {
+    background: #ffffcc;
+}
+.approvedCommentBox {
+    background: #ffffff;
+    border: 1px grey solid;
+}
+.pendingCommentBox {
+    background: #ffffcc;
+    border: 1px grey solid;
+}
+.spamCommentBox {
+    background: #ffcccc;
+    border: 1px grey solid;
 }
 
 /* ----------------------------------------------------------------------

Modified: incubator/roller/trunk/web/weblog/CommentManagement.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/CommentManagement.jsp?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/web/weblog/CommentManagement.jsp (original)
+++ incubator/roller/trunk/web/weblog/CommentManagement.jsp Tue Nov 29 14:52:36 2005
@@ -19,43 +19,85 @@
 -->
 </script>
 
-<p class="subtitle">
-    <c:choose>
-        <%-- Managing comments for one specific weblog entry --%>
-        <c:when test="${!empty model.weblogEntry}">
+
+<%-- ===================================================================== --%>
+<%-- Subtitle --%>
+<%-- ===================================================================== --%>
+
+<c:choose>
+    <%-- Managing comments for one specific weblog entry --%>
+    <c:when test="${!empty model.weblogEntry}">
+        <p class="subtitle">
             <fmt:message key="commentManagement.entry.subtitle" >
                 <fmt:param value="${model.weblogEntry.title}" />
             </fmt:message>
-            <p>
-            <a href='<c:out value="${model.baseURL}" /><c:out value="${model.weblogEntry.permaLink}" />'
-                class="entrypermalink" title="entry permalink">Return to entry</a>
-            </p>
-        </c:when>        
-        <%-- Managing comments for one specific weblog --%>
-        <c:when test="${!empty model.website}">
+        </p>
+        <p>           
+            <c:url value="/editor/weblog.do" var="entryLink">
+               <c:param name="method" value="edit" />
+               <c:param name="weblog" value="${model.website.handle}" />
+               <c:param name="entryid" value="${model.weblogEntry.id}" />
+            </c:url>
+            <a href='<c:out value="${entryLink}" />'>
+                <fmt:message key="commentManagement.returnToEntry"/>
+            </a>
+        </p>
+    </c:when>        
+    <%-- Managing comments for one specific weblog --%>
+    <c:when test="${!empty model.website}">
+        <p class="subtitle">
             <fmt:message key="commentManagement.website.subtitle" >
                 <fmt:param value="${model.website.handle}" />
             </fmt:message>
-        </c:when>
-        <c:otherwise>
+        </p>
+    </c:when>
+    <c:otherwise>
+        <p class="subtitle">
             <fmt:message key="commentManagement.subtitle" />
-        </c:otherwise>
-    </c:choose>
-</p>
+        </p>
+    </c:otherwise>
+</c:choose>
 
-<p class="pagetip"><fmt:message key="commentManagement.tip" /></p>
+
+<%-- ===================================================================== --%>
+<%-- Tip --%>
+<%-- ===================================================================== --%>
 
 <c:choose>
-    <c:when test="${!empty model.comments}">
-    
-        <p class="pagetip"><center>
-        <fmt:message key="commentManagement.nowShowing">
-            <fmt:param value="${model.commentCount}" />
-            <fmt:param value="${model.earliestDate}" />
-            <fmt:param value="${model.latestDate}" />
-        </fmt:message>
-        </center></p>
+    <c:when test="${model.pendingCommentCount == 0}">
+        <p class="pagetip"><fmt:message key="commentManagement.tip" /></p>    
+    </c:when>
+    <c:otherwise>
+        <p class="pagetip"><fmt:message key="commentManagement.pendingTip" /></p>    
+    </c:otherwise>
+</c:choose>
 
+<c:choose>
+    <c:when test="${!empty model.comments}">
+   
+        <%-- ============================================================= --%>
+        <%-- Number of comments and date message --%>
+        <%-- ============================================================= --%>
+        
+        <div style="float:left;">
+            <fmt:message key="commentManagement.nowShowing">
+                <fmt:param value="${model.commentCount}" />
+            </fmt:message>
+        </div>
+        <div style="float:right;">
+            <fmt:formatDate value="${model.latestDate}" type="both" 
+                dateStyle="short" timeStyle="short" />
+            --- 
+            <fmt:formatDate value="${model.earliestDate}" type="both" 
+                dateStyle="short" timeStyle="short" />
+        </div>
+        <br />
+        
+        
+        <%-- ============================================================= --%>
+        <%-- Next / previous links --%>
+        <%-- ============================================================= --%>
+        
         <c:choose>
             <c:when test="${!empty model.prevLink && !empty model.nextLink}">
                 <br /><center>
@@ -88,6 +130,11 @@
             <c:otherwise><br /></c:otherwise>
         </c:choose>
 
+        
+        <%-- ============================================================= --%>
+        <%-- Comment table / form with checkboxes --%>
+        <%-- ============================================================= --%>
+        
         <html:form action="/editor/commentManagement" method="post">
             <input type="hidden" name="method" value="update"/>
             <html:hidden property="weblog" />
@@ -102,7 +149,10 @@
 
         <table class="rollertable" width="100%">
             
-            <tr>
+           <%-- ======================================================== --%>
+           <%-- Comment table header --%>
+           
+           <tr>
                 <th class="rollertable" width="5%" style="font-size:80%">
                     <fmt:message key="commentManagement.columnApproved" />
                 </th>
@@ -117,6 +167,9 @@
                 </th>
             </tr>
             
+           <%-- ======================================================== --%>
+           <%-- Select ALL and NONE buttons --%>
+           
             <c:if test="${model.commentCount > 1}">
                 <tr class="actionrow">
                     <td align="center">
@@ -140,12 +193,20 @@
                         <a href="#" onclick='setChecked(0,"deleteComments")'>
                             <fmt:message key="commentManagement.none" /></a>
                     </td>
-                    <td>
-                        &nbsp;
+                    <td align="right">
+                        <br />
+                        <span class="pendingCommentBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                        <fmt:message key="commentManagement.pending" />&nbsp;&nbsp;
+                        <span class="spamCommentBox">&nbsp;&nbsp;&nbsp;&nbsp;</span> 
+                        <fmt:message key="commentManagement.spam" />&nbsp;&nbsp;
                     </td>
                 </tr>
             </c:if>
             
+            <%-- ========================================================= --%>
+            <%-- Loop through comments --%>
+            <%-- ========================================================= --%>
+
             <c:forEach var="comment" items="${model.comments}">
             <tr>
                 <td>
@@ -164,19 +225,24 @@
                     </html:multibox>
                 </td>
                 
-                <%-- <td> with style if comment is pending --%>
+                <%-- ======================================================== --%>
+                <%-- Display comment details and text --%>
+           
+                <%-- <td> with style if comment is spam or pending --%>               
                 <c:choose>
+                    <c:when test="${comment.spam}">
+                        <td class="spamcomment"> 
+                    </c:when>
                     <c:when test="${comment.pending}">
-                        <td class="pendingcomment" style="background:#fffcc"> 
+                        <td class="pendingcomment"> 
                     </c:when>
                     <c:otherwise>
                         <td>
                     </c:otherwise>
                 </c:choose>
                                     
-                    <%-- start comment details table in table --%>
-                    <table style="border:none; padding:0px; margin:0px"> 
-                        
+                    <%-- comment details table in table --%>
+                    <table style="border:none; padding:0px; margin:0px">                         
                     <tr>
                         <td style="border: none; padding:0px;">
                             <fmt:message key="commentManagement.entryTitled" /></td>
@@ -221,33 +287,45 @@
                                 <c:out value="${comment.url}" /></a>
                             </c:if>
                         </td>
-                    </tr>            
-                    
+                    </tr>                                
                     <tr>
                         <td style="border: none; padding:0px;">
                             <fmt:message key="commentManagement.postTime" /></td>
                         <td class="details" style="border: none; padding:0px;">
                             <c:out value="${comment.postTime}" /></td>
-                    </tr>
-                                       
+                    </tr>                                       
                     </table> <%-- end comment details table in table --%>
                 
+                    <%-- comment content --%>
                     <br />
                     <span class="details">
                        <c:out value="${comment.content}" escapeXml="false" />
                     </span>
+                    
                 </td>
             </tr>
             </c:forEach>
         </table>
         <br />
 
+        <%-- ========================================================= --%>
+        <%-- Save changes and  cancel buttons --%>
+        <%-- ========================================================= --%>
+            
         <input type="submit" name="submit" 
             value='<fmt:message key="commentManagement.update" />' />
         &nbsp;
-        <input type="button" name="Cancel" 
-            value='Cancel' 
-            onclick="window.location.href='<c:out value="${model.link}" />'" />
+        
+        <c:choose>
+            <c:when test="${!empty model.weblogEntry}">
+                <input type="button" name="Cancel" value='Cancel' 
+                    onclick="window.location.href='<c:out value="${entryLink}" />'" />
+            </c:when>
+            <c:otherwise>
+                <input type="button" name="Cancel" value='Cancel' 
+                    onclick="window.location.href='<c:out value="${model.link}" />'" />
+            </c:otherwise>
+        </c:choose>  
 
         </html:form>
 

Modified: incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp (original)
+++ incubator/roller/trunk/web/weblog/CommentManagementSidebar.jsp Tue Nov 29 14:52:36 2005
@@ -17,11 +17,12 @@
 <p><fmt:message key="commentManagement.sidebarDescription" /></p>
     
 <html:form action="/editor/commentQuery" method="post">
-    <html:hidden property="weblog" />
-    <html:hidden property="entryid" />
-    <html:hidden property="ids" />
-    <html:hidden property="offset" />
-    <html:hidden property="count" />
+    <c:if test="${!empty model.website}">
+        <input name="weblog" type="hidden" value='<c:out value="${model.website.handle}" />' />
+    </c:if>
+    <c:if test="${!empty model.weblogEntry}">
+        <input name="entryid" type="hidden" value='<c:out value="${model.weblogEntry.id}" />' />
+    </c:if>
         
     <div class="sideformrow">
         <label for="searchString" class="sideformrow">

Modified: incubator/roller/trunk/web/weblog/WeblogEditSidebar.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/weblog/WeblogEditSidebar.jsp?rev=349826&r1=349825&r2=349826&view=diff
==============================================================================
--- incubator/roller/trunk/web/weblog/WeblogEditSidebar.jsp (original)
+++ incubator/roller/trunk/web/weblog/WeblogEditSidebar.jsp Tue Nov 29 14:52:36 2005
@@ -11,19 +11,31 @@
         
 <div class="sidebarInner">
 
-<c:if test="${model.commentCount > 0}">
-    <h3><fmt:message key="weblogEdit.comments" /></h3>
+<h3><fmt:message key="weblogEdit.comments" /></h3>
+
+<c:choose>
+<c:when test="${model.commentCount > 0}">
     <c:url value="/editor/commentManagement.do" var="commentManagement">
        <c:param name="method" value="query" />
        <c:param name="weblog" value="${model.website.handle}" />
        <c:param name="entryid" value="${model.weblogEntry.id}" />
     </c:url>
-    <img src='<c:url value="/images/Edit16.png"/>' />
-    <a href='<c:out value="${commentManagement}" />'>
-       <fmt:message key="weblogEdit.comments" /></a> 
-    <br />
-</c:if>
+    <span class="entryEditSidebarLink">
+        <a href='<c:out value="${commentManagement}" />'>
+           <img src='<c:url value="/images/Edit16.png"/>' 
+                align="absmiddle" border="0" alt="icon" title="Comments" />
+           <fmt:message key="weblogEdit.hasComments">
+                <fmt:param value="${model.commentCount}" />
+           </fmt:message>
+        </a> 
+    </span><br />
+</c:when>
+<c:otherwise>
+   <span><fmt:message key="application.none" /></span>
+</c:otherwise>
+</c:choose>
 
+<hr size="1" noshade="noshade" />  
 <h3><fmt:message key="weblogEdit.pendingEntries" /></h3>
 
 <c:if test="${empty model.recentPendingEntries}">
@@ -40,8 +52,8 @@
            <str:truncateNicely lower="50">
               <c:out value="${post.title}" />
            </str:truncateNicely>
-    </roller:link></span>
-    <br />
+        </roller:link>
+    </span><br />
 </c:forEach>