roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r395406 - in /incubator/roller/trunk: src/org/roller/business/ src/org/roller/business/hibernate/ src/org/roller/model/ src/org/roller/presentation/velocity/ src/org/roller/presentation/website/actions/ src/org/roller/presentation/website/f...
Date Wed, 19 Apr 2006 22:08:26 GMT
Author: snoopdave
Date: Wed Apr 19 15:08:25 2006
New Revision: 395406

URL: http://svn.apache.org/viewcvs?rev=395406&view=rev
Log:
ROL-1050: Apply comment defaults to all existing entries

Modified:
    incubator/roller/trunk/src/org/roller/business/ThemeManagerImpl.java
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
    incubator/roller/trunk/src/org/roller/model/UserManager.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/CommentServlet.java
    incubator/roller/trunk/src/org/roller/presentation/website/actions/ThemeEditorAction.java
    incubator/roller/trunk/src/org/roller/presentation/website/actions/UploadFileFormAction.java
    incubator/roller/trunk/src/org/roller/presentation/website/actions/WebsiteFormAction.java
    incubator/roller/trunk/src/org/roller/presentation/website/formbeans/WebsiteFormEx.java
    incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/trunk/web/website/edit-website.jsp

Modified: incubator/roller/trunk/src/org/roller/business/ThemeManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/ThemeManagerImpl.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/ThemeManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/ThemeManagerImpl.java Wed Apr 19 15:08:25
2006
@@ -363,7 +363,7 @@
             }
             
             // save our updated website
-            userMgr.saveWebsite(website);
+            userMgr.saveWebsite(website, false);
             
         } catch (Exception e) {
             mLogger.error("ERROR in action",e);

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Wed Apr 19 15:08:25 2006
@@ -9,6 +9,7 @@
 import java.util.List;
 import java.util.Map;
 import org.hibernate.Criteria;
+import org.hibernate.Query;
 import org.hibernate.HibernateException;
 import org.hibernate.Session;
 import org.hibernate.criterion.Expression;
@@ -65,15 +66,18 @@
         
         this.strategy = strat;
     }
-    
-    
+   
     /**
-     * @see org.roller.model.UserManager#storeWebsite(org.roller.pojos.WebsiteData)
-     */
-    public void saveWebsite(WebsiteData data) throws RollerException {
-        this.strategy.store(data);
-    }
-    
+     * Update existing website and optionally apply new comment defaults to all
+     * existing weblog entries in website.
+     * @param website              The website to be updated
+     * @param applyCommentDefaults True to apply website's comment defaults to 
+     *                             all existing comments
+     */
+    public void saveWebsite(WebsiteData website, boolean applyCommentDefaults) throws RollerException
{
+        strategy.store(website);
+        if (applyCommentDefaults) applyCommentDefaults(website);
+    }    
     
     public void removeWebsite(WebsiteData weblog) throws RollerException {
         
@@ -785,5 +789,34 @@
         }
     }
     
+    /**
+     * Apply comment defaults (defaultAllowComments and defaultCommentDays) to
+     * all existing entries in a website using a single HQL query.
+     * @param website Website where comment defaults are from/to be applied.
+     */
+    private void applyCommentDefaults(WebsiteData website) throws RollerException {
+        if (log.isDebugEnabled()) {
+            log.debug("applyCommentDefaults");
+        }       
+        try {
+            Session session = strategy.getSession();
+            String updateString = "update WeblogEntryData set "
+                +"allowComments=:allowed, commentDays=:days, "
+                +"pubTime=pubTime, updateTime=updateTime " // ensure timestamps are NOT reset
+                +"where website=:site";
+            Query update = session.createQuery(updateString);
+            update.setParameter("allowed", website.getDefaultAllowComments());
+            update.setParameter("days", new Integer(website.getDefaultCommentDays()));
+            update.setParameter("site", website);
+            update.executeUpdate();            
+        } catch (Exception e) {
+            log.error("EXCEPTION applying comment defaults",e);
+        }
+    }  
 }
+
+
+
+
+
 

Modified: incubator/roller/trunk/src/org/roller/model/UserManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/model/UserManager.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/model/UserManager.java (original)
+++ incubator/roller/trunk/src/org/roller/model/UserManager.java Wed Apr 19 15:08:25 2006
@@ -90,7 +90,7 @@
     /**
      * Store a single weblog.
      */
-    public void saveWebsite(WebsiteData data) throws RollerException;
+    public void saveWebsite(WebsiteData data, boolean applyCommentDefaults) throws RollerException;
     
     
     public void removeWebsite(WebsiteData website) throws RollerException;

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/CommentServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/CommentServlet.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/CommentServlet.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/CommentServlet.java Wed Apr
19 15:08:25 2006
@@ -49,6 +49,12 @@
         
         // calculate the location of the requested permalink
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
+        
+        // ROL-1102: prevent NPE for bad URLs
+        if (rreq == null) {
+            response.sendError(HttpServletResponse.SC_NOT_FOUND);
+            return;
+        } 
         WeblogEntryData entry = rreq.getWeblogEntry();
         if (entry != null) {
             forward += entry.getPermaLink();
@@ -61,8 +67,7 @@
                     forward += "&popup=true";
             }
                 
-        }
-        
+        }        
         mLogger.debug("forwarding to "+forward);
         
         // send an HTTP 301 response

Modified: incubator/roller/trunk/src/org/roller/presentation/website/actions/ThemeEditorAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/website/actions/ThemeEditorAction.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/actions/ThemeEditorAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/website/actions/ThemeEditorAction.java
Wed Apr 19 15:08:25 2006
@@ -280,7 +280,7 @@
                         website.setEditorTheme(newTheme);
                         
                         UserManager userMgr = RollerFactory.getRoller().getUserManager();
-                        userMgr.saveWebsite(website);
+                        userMgr.saveWebsite(website, false);
                         RollerFactory.getRoller().flush();
                         
                         mLogger.debug("Saved theme "+newTheme+" for "+username);

Modified: incubator/roller/trunk/src/org/roller/presentation/website/actions/UploadFileFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/website/actions/UploadFileFormAction.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/actions/UploadFileFormAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/website/actions/UploadFileFormAction.java
Wed Apr 19 15:08:25 2006
@@ -159,6 +159,10 @@
 		    String baseURL = rctx.getAbsoluteContextUrl(request);
             String resourcesBaseURL = baseURL + fmgr.getUploadUrl() + "/" + website.getHandle();
             Iterator uploads = lastUploads.iterator();
+            if (uploads.hasNext()) {
+                messages.add(ActionMessages.GLOBAL_MESSAGE, 
+                    new ActionMessage("uploadFiles.uploadedFiles"));
+            }
             while (uploads.hasNext()) {                
                 messages.add(ActionMessages.GLOBAL_MESSAGE, 
                     new ActionMessage("uploadFiles.uploadedFile", 

Modified: incubator/roller/trunk/src/org/roller/presentation/website/actions/WebsiteFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/website/actions/WebsiteFormAction.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/actions/WebsiteFormAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/website/actions/WebsiteFormAction.java
Wed Apr 19 15:08:25 2006
@@ -12,6 +12,7 @@
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang.BooleanUtils;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
@@ -149,7 +150,15 @@
                     form.setEnabled(wd.getEnabled());
                     form.copyTo(wd, request.getLocale());
                     
-                    umgr.saveWebsite(wd);
+                    // ROL-485: comments not be allowed on inactive weblogs
+                    wd.setAllowComments(wd.getActive());
+                    
+                    // ROL-1050: apply comment defaults to existing entries
+                    boolean applyCommentDefaults = form.isApplyCommentDefaults();
+                        //BooleanUtils.toBoolean(form.isApplyCommentDefaults());
+                    
+                    umgr.saveWebsite(wd, applyCommentDefaults);  
+                    
                     RollerFactory.getRoller().getRefererManager().applyRefererFilters(wd);
                     
                     RollerFactory.getRoller().flush();
@@ -158,7 +167,7 @@
                         new ActionMessage("websiteSettings.savedChanges"));
                     
                     request.getSession().setAttribute(
-                            RollerRequest.WEBSITEID_KEY, form.getId());
+                        RollerRequest.WEBSITEID_KEY, form.getId());
                     
                     // Clear cache entries associated with website
                     CacheManager.invalidate(wd);

Modified: incubator/roller/trunk/src/org/roller/presentation/website/formbeans/WebsiteFormEx.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/website/formbeans/WebsiteFormEx.java?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/website/formbeans/WebsiteFormEx.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/website/formbeans/WebsiteFormEx.java
Wed Apr 19 15:08:25 2006
@@ -16,183 +16,163 @@
 
 /**
  * @struts.form name="websiteFormEx"
- */ 
-public class WebsiteFormEx extends WebsiteForm
-{
+ */
+public class WebsiteFormEx extends WebsiteForm {
     private String bloggerCategoryId;
     private String defaultCategoryId;
     private String[] defaultPluginsArray;
+    private boolean applyCommentDefaults = false;
     
     /**
      * @return Returns the bloggerCategoryId.
      */
-    public String getBloggerCategoryId()
-    {
+    public String getBloggerCategoryId() {
         return bloggerCategoryId;
     }
-
+    
     /**
      * @param bloggerCategoryId The bloggerCategoryId to set.
      */
-    public void setBloggerCategoryId(String bloggerCategoryId)
-    {
+    public void setBloggerCategoryId(String bloggerCategoryId) {
         this.bloggerCategoryId = bloggerCategoryId;
     }
-
+    
     /**
      * @return Returns the defeaultCategoryId.
      */
-    public String getDefaultCategoryId()
-    {
+    public String getDefaultCategoryId() {
         return defaultCategoryId;
     }
-
+    
     /**
      * @param defeaultCategoryId The defeaultCategoryId to set.
      */
-    public void setDefaultCategoryId(String defeaultCategoryId)
-    {
+    public void setDefaultCategoryId(String defeaultCategoryId) {
         this.defaultCategoryId = defeaultCategoryId;
     }
-
+    
     /**
      * @return
      */
-    public String[] getDefaultPluginsArray()
-    {
+    public String[] getDefaultPluginsArray() {
         return defaultPluginsArray;
     }
-
+    
     /**
      * @param strings
      */
-    public void setDefaultPluginsArray(String[] strings)
-    {
+    public void setDefaultPluginsArray(String[] strings) {
         defaultPluginsArray = strings;
     }
-
-
-    /** 
+    
+    public boolean isApplyCommentDefaults() {
+        return applyCommentDefaults;
+    }
+    
+    public void setApplyCommentDefaults(boolean applyCommentDefaults) {
+        this.applyCommentDefaults = applyCommentDefaults;
+    }
+    
+    /**
      * @see org.roller.presentation.forms.WebsiteForm#copyFrom(org.roller.pojos.WebsiteData)
      */
-    public void copyFrom(WebsiteData dataHolder, java.util.Locale locale) throws RollerException
-    {
+    public void copyFrom(WebsiteData dataHolder, java.util.Locale locale) throws RollerException
{
         super.copyFrom(dataHolder, locale);
-        if (dataHolder.getDefaultCategory() != null)
-        {
+        if (dataHolder.getDefaultCategory() != null) {
             defaultCategoryId = dataHolder.getDefaultCategory().getId();
         }
-        if (dataHolder.getBloggerCategory() != null)
-        {
+        if (dataHolder.getBloggerCategory() != null) {
             bloggerCategoryId = dataHolder.getBloggerCategory().getId();
         }
-        if (dataHolder.getDefaultPlugins() != null)
-        {
+        if (dataHolder.getDefaultPlugins() != null) {
             defaultPluginsArray = StringUtils.split(dataHolder.getDefaultPlugins(), ",");
         }
     }
-
+    
     /**
      * Utility to convert from String to Date.
      */
-    public void setDateCreatedAsString(String value)
-    {
-        if ( value == null || value.trim().length() == 0 )
-        {
-            this.setDateCreated(null);   
-        }
-        else
-        {
-            try
-            {
+    public void setDateCreatedAsString(String value) {
+        if ( value == null || value.trim().length() == 0 ) {
+            this.setDateCreated(null);
+        } else {
+            try {
                 Date pubDate = DateUtil.parse(
                         value, DateUtil.friendlyTimestampFormat());
                 this.setDateCreated(new Timestamp(pubDate.getTime()));
-            }
-            catch (java.text.ParseException pe)
-            {
+            } catch (java.text.ParseException pe) {
                 // wasn't proper format, try others
                 Date pubDate = DateUtil.parseFromFormats(value);
                 this.setDateCreated( new Timestamp(pubDate.getTime()) );
             }
         }
     }
-
+    
     /**
      * Returns a formatted pubTime string.
      */
-    public String getDateCreatedAsString()
-    {
+    public String getDateCreatedAsString() {
         return DateUtil.friendlyTimestamp(this.getDateCreated());
     }
-
-    /** 
+    
+    /**
      * @see org.roller.presentation.forms.WebsiteForm#copyTo(org.roller.pojos.WebsiteData)
      */
-    public void copyTo(WebsiteData dataHolder, java.util.Locale locale) throws RollerException
-    {
+    public void copyTo(WebsiteData dataHolder, java.util.Locale locale) throws RollerException
{
         Date dateCreated = dataHolder.getDateCreated();
         
         super.copyTo(dataHolder, locale);
         
-        dataHolder.setDateCreated(dateCreated);        
+        dataHolder.setDateCreated(dateCreated);
         dataHolder.setDefaultPlugins( StringUtils.join(this.defaultPluginsArray,",") );
-                
+        
         // checkboxes return no value when not checked
-        if (getAllowComments() == null)
-        {
+        if (getAllowComments() == null) {
             dataHolder.setAllowComments(Boolean.FALSE);
         }
-        if (getEmailComments() == null)
-        {
+        if (getEmailComments() == null) {
             dataHolder.setEmailComments(Boolean.FALSE);
         }
-        if (getEnableBloggerApi() == null)
-        {
+        if (getEnableBloggerApi() == null) {
             dataHolder.setEnableBloggerApi(Boolean.FALSE);
         }
-        if (getDefaultAllowComments() == null)
-        {
+        if (getDefaultAllowComments() == null) {
             dataHolder.setDefaultAllowComments(Boolean.FALSE);
         }
-        if (getModerateComments() == null)
-        {
+        if (getModerateComments() == null) {
             dataHolder.setModerateComments(Boolean.FALSE);
         }
-        if (this.getActive() == null)
-        {
+        if (this.getActive() == null) {
             dataHolder.setActive(Boolean.FALSE);
         }
         
         WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
-        if (getDefaultCategoryId() != null) 
-        {
-            WeblogCategoryData defaultCat = 
+        
+        if (getDefaultCategoryId() != null) {
+            WeblogCategoryData defaultCat =
                 wmgr.getWeblogCategory(getDefaultCategoryId());
             dataHolder.setDefaultCategory(defaultCat);
         }
-
-        if (getBloggerCategoryId() != null) 
-        {
-            WeblogCategoryData bloggerCat = 
+        
+        if (getBloggerCategoryId() != null) {
+            WeblogCategoryData bloggerCat =
                 wmgr.getWeblogCategory(getBloggerCategoryId());
             dataHolder.setBloggerCategory(bloggerCat);
         }
     }
     
     public void reset(
-        org.apache.struts.action.ActionMapping mapping, 
-        javax.servlet.ServletRequest request)
-    {
+            org.apache.struts.action.ActionMapping mapping,
+            javax.servlet.ServletRequest request) {
         doReset(mapping, request);
         defaultPluginsArray = new String[0];
     }
     
     public void reset(
-        org.apache.struts.action.ActionMapping mapping, 
-        javax.servlet.http.HttpServletRequest request)
-    {
+            org.apache.struts.action.ActionMapping mapping,
+            javax.servlet.http.HttpServletRequest request) {
         doReset(mapping, request);
         defaultPluginsArray = new String[0];
     }
+    
 }

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=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties Wed Apr 19
15:08:25 2006
@@ -1138,7 +1138,8 @@
 uploadFiles.noFiles=No files found.
 
 uploadFiles.button.delete=Delete Selected
-uploadFiles.uploadedFile=Uploaded file: {0}
+uploadFiles.uploadedFile=Uploaded file(s):
+uploadFiles.uploadedFile={0}
 uploadFiles.deletedFiles=Deleted {0} file(s)
 uploadFiles.noFilesSpecified=You have chosen no files to upload
 
@@ -1418,6 +1419,7 @@
 
 weblogEntryQuery.weblogEntries=Weblog Entries
 weblogEntryQuery.edit=Edit
+weblogEntryQuery.view=View
 weblogEntryQuery.link=Link
 weblogEntryQuery.posttitle=Title
 weblogEntryQuery.category=Category
@@ -1471,41 +1473,68 @@
 websiteSettings.subtitle=Manage settings for weblog <span>{0}</span>
 websiteSettings.tip=Change weblog title, description, comment and referrer \
 spam prevention settings.
+
+# --- General settings
+
 websiteSettings.websiteTitle=Title
 websiteSettings.websiteDescription=Description
+websiteSettings.emailAddress=Email address of weblog owner
+websiteSettings.editor=Weblog editor page to be used
+websiteSettings.entryDisplayCount=Number of entries to display on weblog
+websiteSettings.active=Weblog is active (and should be included in community listings)
+websiteSettings.editorSettings=Editor
+
+# These are hidden now
 websiteSettings.templateSettings=Template Settings
 websiteSettings.homePage=Page to be used as the homepage
-websiteSettings.editor=Weblog editor page to be used
 websiteSettings.categories=Categories
 websiteSettings.defaultCategory=Default root category of weblog
-websiteSettings.active=Weblog is active (and should be included in community listings)
 
-websiteSettings.formatting=Formatting
+# --- Comments
+
+websiteSettings.commentSettings=Comments
 websiteSettings.allowComments=Allow Comments for your weblog?
+websiteSettings.moderateComments=Moderate comments
 websiteSettings.emailComments=Email Comments?
-websiteSettings.emailAddress=Email address of weblog owner
 websiteSettings.emailFromAddress=Default <em>from</em> e-mail address for notifications
-websiteSettings.autoformat=Autoformat new entries?
+
+# --- Default comments settings
+
+websiteSettings.defaultCommentSettings=Default comment settings
+websiteSettings.defaultAllowComments=By default, allow comments for new entries
+websiteSettings.defaultCommentDays=Default time to allow comments for new entries
+websiteSettings.applyCommentDefaults=Apply comment defaults to existing entries?
+
+# --- Weblog API
+
 websiteSettings.bloggerApi=Weblog Client API
 websiteSettings.enableBloggerApi=Enable Blogger and MetaWeblog APIs for your weblog?
 websiteSettings.bloggerApiCategory=Category for posts received via Blogger API 
+
+# --- Formatting
+
+websiteSettings.formatting=Formatting
+websiteSettings.autoformat=Autoformat new entries?
+
+# --- Spam prevention
+
 websiteSettings.spamPrevention=Spam Prevention
 websiteSettings.ignoreUrls=List of words and regex expressions listed one per \
 line to be added to the blacklist used to check comments, trackbacks and referrers.
-websiteSettings.editorSettings=Editor
-websiteSettings.commentSettings=Comments
-websiteSettings.entryDisplayCount=Number of entries to display on weblog
-
-websiteSettings.button.update=Update Weblog Settings
-websiteSettings.button.rebuildIndex=Rebuild Search Index
-websiteSettings.button.remove=Remove Weblog
-
-websiteSettings.savedChanges=Saved changes to weblog settings
 websiteSettings.acceptedBlacklist=Accepted {0} string and {1} regex blacklist rules
 websiteSettings.error.processingBlacklist=Error processing blacklist: {0}
 websiteSettings.error.sameTemplate=CHANGES REJECTED: cannot set default page \
 template and day template to same template
 
+# --- Buttons
+
+websiteSettings.savedChanges=Saved changes to weblog settings
+websiteSettings.button.update=Update Weblog Settings
+websiteSettings.button.rebuildIndex=Rebuild Search Index
+
+# --- Remove weblog
+
+websiteSettings.button.remove=Remove Weblog
 websiteSettings.removeWebsiteHeading=Remove Weblog?
 websiteSettings.removeWebsite=You are the last contributor to this weblog, \
 would you like to remove it?
@@ -1519,9 +1548,6 @@
 websiteRemove.websiteId=Weblog ID
 websiteRemove.websiteName=Weblog Name
 
-websiteSettings.moderateComments=Moderate comments
-websiteSettings.defaultAllowComments=By default, allow comments for new entries
-websiteSettings.defaultCommentDays=Default time to allow comments for new entries
 
 # ------------------------------------------------------------- Welcome new user
 

Modified: incubator/roller/trunk/web/website/edit-website.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/edit-website.jsp?rev=395406&r1=395405&r2=395406&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/edit-website.jsp (original)
+++ incubator/roller/trunk/web/website/edit-website.jsp Wed Apr 19 15:08:25 2006
@@ -101,27 +101,35 @@
         <td class="field"><html:checkbox property="moderateComments" /></input></td>
         <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
     </tr>
-<%
-boolean emailComments = RollerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
-if (emailComments) { %>
-    <tr>
-        <td class="label"><fmt:message key="websiteSettings.emailComments" /></td>
-        <td class="field"><html:checkbox property="emailComments" onclick="toggleNextRow(this)"
/></input></td>
-        <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
-    </tr>
+    
+    <%
+    boolean emailComments = RollerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
+    if (emailComments) { %>
+        <tr>
+            <td class="label"><fmt:message key="websiteSettings.emailComments" /></td>
+            <td class="field"><html:checkbox property="emailComments" onclick="toggleNextRow(this)"
/></input></td>
+            <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
+        </tr>
 
-    <tr <c:if test="${!websiteFormEx.emailComments}">style="display: none"</c:if>>
-        <td class="label"><fmt:message key="websiteSettings.emailFromAddress" /></td>
-        <td class="field"><html:text size="50" property="emailFromAddress" /></input></td>
-        <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
-    </tr>
-<% } %>
+        <tr <c:if test="${!websiteFormEx.emailComments}">style="display: none"</c:if>>
+            <td class="label"><fmt:message key="websiteSettings.emailFromAddress"
/></td>
+            <td class="field"><html:text size="50" property="emailFromAddress" /></input></td>
+            <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
+        </tr>
+    <% } %>
+
+    <%-- ***** Default entry comment settings ***** --%>
 
     <tr>
+        <td colspan="3"><h2><fmt:message key="websiteSettings.defaultCommentSettings"
/></h2></td>
+    </tr>
+    
+    <tr>
         <td class="label"><fmt:message key="websiteSettings.defaultAllowComments"
/></td>
         <td class="field"><html:checkbox property="defaultAllowComments" /></input></td>
         <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
     </tr>
+    
      <tr>
         <td class="label"><fmt:message key="websiteSettings.defaultCommentDays"
/></td>
         <td class="field">
@@ -140,6 +148,12 @@
              <html:option key="weblogEdit.days90" value="90"  />
          </html:select>
         </td>
+        <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
+    </tr>
+    
+    <tr>
+        <td class="label"><fmt:message key="websiteSettings.applyCommentDefaults"
/></td>
+        <td class="field"><html:checkbox property="applyCommentDefaults" /></input></td>
         <td class="description"><%-- <fmt:message key="websiteSettings.tip."
/> --%></td>
     </tr>
 



Mime
View raw message