roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject roller git commit: Almost done with Bootstrap conversion of Theme Edit, Templates and Template Edit pages.
Date Sun, 09 Sep 2018 14:26:31 GMT
Repository: roller
Updated Branches:
  refs/heads/bootstrap-ui 2ade07dd0 -> de9086c75


Almost done with Bootstrap conversion of Theme Edit, Templates and Template Edit pages.


Project: http://git-wip-us.apache.org/repos/asf/roller/repo
Commit: http://git-wip-us.apache.org/repos/asf/roller/commit/de9086c7
Tree: http://git-wip-us.apache.org/repos/asf/roller/tree/de9086c7
Diff: http://git-wip-us.apache.org/repos/asf/roller/diff/de9086c7

Branch: refs/heads/bootstrap-ui
Commit: de9086c75a01a3ea870f24e8d26e079f82191040
Parents: 2ade07d
Author: Dave Johnson <snoopdave@gmail.com>
Authored: Sun Sep 9 10:26:27 2018 -0400
Committer: Dave Johnson <snoopdave@gmail.com>
Committed: Sun Sep 9 10:26:27 2018 -0400

----------------------------------------------------------------------
 .../roller/weblogger/pojos/ThemeTemplate.java   |   2 +-
 .../ui/struts2/editor/StylesheetEdit.java       |   3 +-
 .../ui/struts2/editor/TemplateEdit.java         |   5 +-
 .../ui/struts2/editor/TemplateRemove.java       | 117 +++----
 .../weblogger/ui/struts2/editor/Templates.java  | 342 +++++++++----------
 .../ui/struts2/editor/TemplatesRemove.java      | 254 --------------
 .../resources/ApplicationResources.properties   |  21 +-
 .../webapp/WEB-INF/jsps/editor/EntryEdit.jsp    |   3 +-
 .../webapp/WEB-INF/jsps/editor/EntryRemove.jsp  |  61 ----
 .../WEB-INF/jsps/editor/StylesheetEdit.jsp      |   1 +
 .../webapp/WEB-INF/jsps/editor/TemplateEdit.jsp | 192 ++++++-----
 .../webapp/WEB-INF/jsps/editor/Templates.jsp    |  23 +-
 .../WEB-INF/jsps/editor/TemplatesRemove.jsp     |  54 ---
 .../WEB-INF/jsps/editor/TemplatesSidebar.jsp    |   2 +-
 .../webapp/WEB-INF/jsps/editor/ThemeEdit.jsp    |   4 +-
 app/src/main/webapp/WEB-INF/tiles.xml           |  17 +-
 app/src/main/webapp/roller-ui/styles/roller.css |  10 +-
 17 files changed, 366 insertions(+), 745 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java b/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java
index 82121f3..c4b8842 100644
--- a/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java
+++ b/app/src/main/java/org/apache/roller/weblogger/pojos/ThemeTemplate.java
@@ -26,7 +26,7 @@ package org.apache.roller.weblogger.pojos;
  */
 public interface ThemeTemplate extends Template {
 
-    public enum ComponentType {
+    enum ComponentType {
         WEBLOG("Weblog"),
         PERMALINK("Permalink"),
         SEARCH("Search"),

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java
index 861a152..ce7956a 100644
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java
+++ b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java
@@ -103,8 +103,7 @@ public class StylesheetEdit extends UIAction {
                     setContentsMobile(getTemplate().getTemplateRendition( RenditionType.MOBILE).getTemplate());
                 }
                 if (log.isDebugEnabled()) {
-                    log.debug("Standard: " + getContentsStandard() + " Mobile: "
-                            + getContentsMobile());
+                    log.debug("Standard: " + getContentsStandard() + " Mobile: " + getContentsMobile());
                 }
             } catch (WebloggerException e) {
                 log.error("Error loading Weblog template codes for stylesheet", e);

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
index 19d34ff..4642808 100644
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
+++ b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
@@ -114,8 +114,7 @@ public class TemplateEdit extends UIAction {
                 getBean().copyTo(templateToSave);
                 templateToSave.setLastModified(new Date());
 
-                if (getBean().getAutoContentType() == null ||
-                        !getBean().getAutoContentType()) {
+                if (getBean().getAutoContentType() == null || !getBean().getAutoContentType()) {
                     templateToSave.setOutputContentType(getBean().getManualContentType());
                 } else {
                     // empty content-type indicates that template uses auto content-type detection
@@ -151,7 +150,7 @@ public class TemplateEdit extends UIAction {
         if (!getTemplate().getName().equals(getBean().getName())) {
             try {
                 if (WebloggerFactory.getWeblogger().getWeblogManager()
-                    .getTemplateByName(getActionWeblog(), getBean().getName()) != null) {
+                        .getTemplateByName(getActionWeblog(), getBean().getName()) != null) {
                     addError("pagesForm.error.alreadyExists", getBean().getName());
                 }
             } catch (WebloggerException ex) {

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.java b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.java
index 4f9a82b..7446826 100644
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.java
+++ b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.java
@@ -18,6 +18,7 @@
 
 package org.apache.roller.weblogger.ui.struts2.editor;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
@@ -28,6 +29,7 @@ import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.WeblogTemplate;
 import org.apache.roller.weblogger.pojos.WeblogTheme;
 import org.apache.roller.weblogger.ui.struts2.util.UIAction;
+import org.apache.roller.weblogger.util.Utilities;
 import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.struts2.convention.annotation.AllowedMethods;
 
@@ -37,72 +39,67 @@ import org.apache.struts2.convention.annotation.AllowedMethods;
 // TODO: make this work @AllowedMethods({"execute","remove","cancel"})
 public class TemplateRemove extends UIAction {
 
-	private static Log log = LogFactory.getLog(TemplateRemove.class);
+    private static Log log = LogFactory.getLog(TemplateRemove.class);
 
-	// id of template to remove
-	private String removeId = null;
+    // id of template to remove
+    private String removeId = null;
 
-	// template object that we will remove
-	private WeblogTemplate template = null;
+    // template object that we will remove
+    private WeblogTemplate template = null;
 
-	public TemplateRemove() {
-		this.actionName = "templateRemove";
-		this.desiredMenu = "editor";
-		this.pageTitle = "editPages.title.removeOK";
-	}
+    public TemplateRemove() {
+        this.actionName = "templateRemove";
+        this.desiredMenu = "editor";
+        this.pageTitle = "editPages.title.removeOK";
+    }
 
-	public void myPrepare() {
-		if (getRemoveId() != null) {
+    public void myPrepare() {
+        if (StringUtils.isNotEmpty(getRemoveId())) {
             try {
-                setTemplate(WebloggerFactory.getWeblogger().getWeblogManager()
-                        .getTemplate(getRemoveId()));
+                setTemplate(
+                    WebloggerFactory.getWeblogger().getWeblogManager().getTemplate(getRemoveId()));
             } catch (WebloggerException ex) {
-                log.error("Error looking up template by id - " + getRemoveId(),
-                        ex);
+                log.error("Error looking up template by id - " + getRemoveId(), ex);
                 addError("editPages.remove.notFound", getRemoveId());
             }
         }
-	}
+    }
 
-	/**
-	 * Display the remove template confirmation.
-	 */
-	public String execute() {
-		return "confirm";
-	}
+    /**
+     * Display the remove template confirmation.
+     */
+    public String execute() {
+        return "confirm";
+    }
 
-	/**
-	 * Remove a new template.
-	 */
-	public String remove() {
+    /**
+     * Remove a new template.
+     */
+    public String remove() {
 
-		if (getTemplate() != null) {
+        if (getTemplate() != null) {
             try {
                 if (!getTemplate().isRequired()
-                        || !WeblogTheme.CUSTOM.equals(getActionWeblog()
-                        .getEditorTheme())) {
+                    || !WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
 
-                    WeblogManager mgr = WebloggerFactory.getWeblogger()
-                            .getWeblogManager();
+                    WeblogManager mgr = WebloggerFactory.getWeblogger().getWeblogManager();
 
                     // if weblog template remove custom style sheet also
-                    if (getTemplate().getName().equals(
-                            WeblogTemplate.DEFAULT_PAGE)) {
+                    if (getTemplate().getName().equals(WeblogTemplate.DEFAULT_PAGE)) {
 
                         Weblog weblog = getActionWeblog();
 
-                        ThemeTemplate stylesheet = getActionWeblog().getTheme()
-                                .getStylesheet();
+                        ThemeTemplate stylesheet = getActionWeblog().getTheme().getStylesheet();
 
                         // Delete style sheet if the same name
                         if (stylesheet != null
-                                && getActionWeblog().getTheme().getStylesheet() != null
-                                && stylesheet.getLink().equals(
-                                getActionWeblog().getTheme()
-                                        .getStylesheet().getLink())) {
+                            && getActionWeblog().getTheme().getStylesheet() != null
+                            && stylesheet.getLink().equals(
+                            getActionWeblog().getTheme().getStylesheet().getLink())) {
+
                             // Same so OK to delete
-                            WeblogTemplate css = mgr.getTemplateByLink(
-                                    getActionWeblog(), stylesheet.getLink());
+                            WeblogTemplate css =
+                                mgr.getTemplateByLink(getActionWeblog(), stylesheet.getLink());
 
                             if (css != null) {
                                 mgr.removeTemplate(css);
@@ -126,32 +123,28 @@ public class TemplateRemove extends UIAction {
             }
         }
 
-		return "confirm";
-	}
-	
-    /**
-     * Cancel.
-     * 
-     * @return the string
-     */
+        return "confirm";
+    }
+
+
     public String cancel() {
         return CANCEL;
     }
 
-	public String getRemoveId() {
-		return removeId;
-	}
+    public String getRemoveId() {
+        return removeId;
+    }
 
-	public void setRemoveId(String removeId) {
-		this.removeId = removeId;
-	}
+    public void setRemoveId(String removeId) {
+        this.removeId = removeId;
+    }
 
-	public WeblogTemplate getTemplate() {
-		return template;
-	}
+    public WeblogTemplate getTemplate() {
+        return template;
+    }
 
-	public void setTemplate(WeblogTemplate template) {
-		this.template = template;
-	}
+    public void setTemplate(WeblogTemplate template) {
+        this.template = template;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
index 4793e11..2621d2f 100644
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
+++ b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
@@ -46,103 +46,99 @@ import java.util.Map;
 // TODO: make this work @AllowedMethods({"execute","add"})
 public class Templates extends UIAction {
 
-	private static Log log = LogFactory.getLog(Templates.class);
-
-	// list of templates to display
-	private List<WeblogTemplate> templates = Collections.emptyList();
-
-	// list of template action types user is allowed to create
-	private Map<ComponentType, String> availableActions = Collections.emptyMap();
-
-	// name and action of new template if we are adding a template
-	private String newTmplName = null;
-	private ComponentType newTmplAction = null;
-
-	public Templates() {
-		this.actionName = "templates";
-		this.desiredMenu = "editor";
-		this.pageTitle = "pagesForm.title";
-	}
-
-	public String execute() {
-
-		// query for templates list
-		try {
-
-			// get current list of templates, minus custom stylesheet
-			List<WeblogTemplate> raw = WebloggerFactory.getWeblogger()
-					.getWeblogManager().getTemplates(getActionWeblog());
-			List<WeblogTemplate> pages = new ArrayList<WeblogTemplate>();
-			pages.addAll(raw);
-			// Remove style sheet from list so not to show when theme is
-			// selected in shared theme mode
-			if (getActionWeblog().getTheme().getStylesheet() != null) {
-				pages.remove(WebloggerFactory
-						.getWeblogger()
-						.getWeblogManager()
-						.getTemplateByLink(
-								getActionWeblog(),
-								getActionWeblog().getTheme().getStylesheet()
-										.getLink()));
-			}
-			setTemplates(pages);
-
-			// build list of action types that may be added
-			Map<ComponentType, String> actionsMap = new EnumMap<ComponentType, String>(ComponentType.class);
-			addComponentTypeToMap(actionsMap, ComponentType.CUSTOM);
-
-			if (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
-				// if the weblog is using a custom theme then determine which
-				// action templates are still available to be created
-				addComponentTypeToMap(actionsMap, ComponentType.PERMALINK);
-				addComponentTypeToMap(actionsMap, ComponentType.SEARCH);
-				addComponentTypeToMap(actionsMap, ComponentType.WEBLOG);
-				addComponentTypeToMap(actionsMap, ComponentType.TAGSINDEX);
-
-				for (WeblogTemplate tmpPage : getTemplates()) {
-					if (!ComponentType.CUSTOM.equals(tmpPage
-							.getAction())) {
-						actionsMap.remove(tmpPage.getAction());
-					}
-				}
-			} else {
-				// Make sure we have an option for the default web page
-				addComponentTypeToMap(actionsMap, ComponentType.WEBLOG);
-				if (getNewTmplAction() == null) {
-					setNewTmplAction(ComponentType.WEBLOG);
-				}
-				for (WeblogTemplate tmpPage : getTemplates()) {
-					if (ComponentType.WEBLOG.equals(tmpPage.getAction())) {
-						actionsMap.remove(ComponentType.WEBLOG);
-						setNewTmplAction(null);
-						break;
-					}
-				}
-			}
-			setAvailableActions(actionsMap);
-
-		} catch (WebloggerException ex) {
-			log.error("Error getting templates for weblog - "
-					+ getActionWeblog().getHandle(), ex);
-			addError("Error getting template list - check Roller logs");
-		}
-
-		return LIST;
-	}
+    private static Log log = LogFactory.getLog(Templates.class);
+
+    // list of templates to display
+    private List<WeblogTemplate> templates = Collections.emptyList();
+
+    // list of template action types user is allowed to create
+    private Map<ComponentType, String> availableActions = Collections.emptyMap();
+
+    // name and action of new template if we are adding a template
+    private String newTmplName = null;
+    private ComponentType newTmplAction = null;
+
+    public Templates() {
+        this.actionName = "templates";
+        this.desiredMenu = "editor";
+        this.pageTitle = "pagesForm.title";
+    }
+
+    public String execute() {
+
+        // query for templates list
+        try {
+
+            // get current list of templates, minus custom stylesheet
+            List<WeblogTemplate> raw = WebloggerFactory.getWeblogger()
+                .getWeblogManager().getTemplates(getActionWeblog());
+            List<WeblogTemplate> pages = new ArrayList<WeblogTemplate>();
+            pages.addAll(raw);
+
+            // Remove style sheet from list so not to show when theme is
+            // selected in shared theme mode
+            if (getActionWeblog().getTheme().getStylesheet() != null) {
+                pages.remove(WebloggerFactory.getWeblogger().getWeblogManager()
+                    .getTemplateByLink(getActionWeblog(), getActionWeblog().getTheme().getStylesheet().getLink()));
+            }
+            setTemplates(pages);
+
+            // build list of action types that may be added
+            Map<ComponentType, String> actionsMap = new EnumMap<ComponentType, String>(ComponentType.class);
+            addComponentTypeToMap(actionsMap, ComponentType.CUSTOM);
+
+            if (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
+
+                // if the weblog is using a custom theme then determine which
+                // action templates are still available to be created
+                addComponentTypeToMap(actionsMap, ComponentType.PERMALINK);
+                addComponentTypeToMap(actionsMap, ComponentType.SEARCH);
+                addComponentTypeToMap(actionsMap, ComponentType.WEBLOG);
+                addComponentTypeToMap(actionsMap, ComponentType.TAGSINDEX);
+
+                for (WeblogTemplate tmpPage : getTemplates()) {
+                    if (!ComponentType.CUSTOM.equals(tmpPage.getAction())) {
+                        actionsMap.remove(tmpPage.getAction());
+                    }
+                }
+            } else {
+                // Make sure we have an option for the default web page
+                addComponentTypeToMap(actionsMap, ComponentType.WEBLOG);
+                if (getNewTmplAction() == null) {
+                    setNewTmplAction(ComponentType.WEBLOG);
+                }
+                for (WeblogTemplate tmpPage : getTemplates()) {
+                    if (ComponentType.WEBLOG.equals(tmpPage.getAction())) {
+                        actionsMap.remove(ComponentType.WEBLOG);
+                        setNewTmplAction(null);
+                        break;
+                    }
+                }
+            }
+            setAvailableActions(actionsMap);
+
+        } catch (WebloggerException ex) {
+            log.error("Error getting templates for weblog - "
+                + getActionWeblog().getHandle(), ex);
+            addError("Error getting template list - check Roller logs");
+        }
+
+        return LIST;
+    }
 
     private void addComponentTypeToMap(Map<ComponentType, String> map, ComponentType component) {
         map.put(component, component.getReadableName());
     }
 
-	/**
-	 * Save a new template.
-	 */
-	public String add() {
+    /**
+     * Save a new template.
+     */
+    public String add() {
 
-		// validation
-		myValidate();
+        // validation
+        myValidate();
 
-		if (!hasActionErrors()) {
+        if (!hasActionErrors()) {
             try {
 
                 WeblogTemplate newTemplate = new WeblogTemplate();
@@ -164,18 +160,16 @@ public class Templates extends UIAction {
                 }
 
                 // save the new Template
-                WebloggerFactory.getWeblogger().getWeblogManager()
-                        .saveTemplate(newTemplate);
+                WebloggerFactory.getWeblogger().getWeblogManager().saveTemplate(newTemplate);
 
-                // Create weblog template codes for available types.
-                CustomTemplateRendition standardRendition = new CustomTemplateRendition(
-                        newTemplate, RenditionType.STANDARD);
+                // Create weblog template renditions for available types.
+                CustomTemplateRendition standardRendition =
+                    new CustomTemplateRendition( newTemplate, RenditionType.STANDARD);
                 standardRendition.setTemplate(getText("pageForm.newTemplateContent"));
                 standardRendition.setTemplateLanguage(TemplateLanguage.VELOCITY);
-                WebloggerFactory.getWeblogger().getWeblogManager()
-                        .saveTemplateRendition(standardRendition);
+                WebloggerFactory.getWeblogger().getWeblogManager().saveTemplateRendition(standardRendition);
 
-                /* TBI -- need a way for user to specify dual or single template
+                /* TODO: need a way for user to specify dual or single template via UI
                 CustomTemplateRendition mobileRendition = new CustomTemplateRendition(
                         newTemplate.getId(), RenditionType.MOBILE);
                 mobileRendition.setTemplate(newTemplate.getContents());
@@ -185,11 +179,9 @@ public class Templates extends UIAction {
                 */
 
                 // if this person happened to create a Weblog template from
-                // scratch then make sure and set the defaultPageId. What does
-                // this do????
+                // scratch then make sure and set the defaultPageId.
                 if (WeblogTemplate.DEFAULT_PAGE.equals(newTemplate.getName())) {
-                    WebloggerFactory.getWeblogger().getWeblogManager()
-                            .saveWeblog(getActionWeblog());
+                    WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(getActionWeblog());
                 }
 
                 // flush results to db
@@ -200,83 +192,81 @@ public class Templates extends UIAction {
                 setNewTmplAction(null);
 
             } catch (WebloggerException ex) {
-                log.error("Error adding new template for weblog - "
-                        + getActionWeblog().getHandle(), ex);
+                log.error("Error adding new template for weblog - " + getActionWeblog().getHandle(), ex);
                 addError("Error adding new template - check Roller logs");
             }
         }
 
-		return execute();
-	}
-
-	// validation when adding a new template
-	private void myValidate() {
-
-		// make sure name is non-null and within proper size
-		if (StringUtils.isEmpty(getNewTmplName())) {
-			addError("Template.error.nameNull");
-		} else if (getNewTmplName().length() > RollerConstants.TEXTWIDTH_255) {
-			addError("Template.error.nameSize");
-		}
-
-		// make sure action is a valid
-		if (getNewTmplAction() == null) {
-			addError("Template.error.actionNull");
-		}
-
-		// check if template by that name already exists
-		try {
-			WeblogTemplate existingPage = WebloggerFactory.getWeblogger()
-					.getWeblogManager()
-					.getTemplateByName(getActionWeblog(), getNewTmplName());
-			if (existingPage != null) {
-				addError("pagesForm.error.alreadyExists", getNewTmplName());
-			}
-		} catch (WebloggerException ex) {
-			log.error("Error checking for existing template", ex);
-		}
-
-	}
-
-	/**
-	 * Checks if is custom theme.
-	 * 
-	 * @return true, if is custom theme
-	 */
-	public boolean isCustomTheme() {
-		return (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme()));
-	}
-
-	public List<WeblogTemplate> getTemplates() {
-		return templates;
-	}
-
-	public void setTemplates(List<WeblogTemplate> templates) {
-		this.templates = templates;
-	}
-
-	public Map<ComponentType, String> getAvailableActions() {
-		return availableActions;
-	}
-
-	public void setAvailableActions(Map<ComponentType, String> availableActions) {
-		this.availableActions = availableActions;
-	}
-
-	public String getNewTmplName() {
-		return newTmplName;
-	}
-
-	public void setNewTmplName(String newTmplName) {
-		this.newTmplName = newTmplName;
-	}
-
-	public ComponentType getNewTmplAction() {
-		return newTmplAction;
-	}
-
-	public void setNewTmplAction(ComponentType newTmplAction) {
-		this.newTmplAction = newTmplAction;
-	}
+        return execute();
+    }
+
+    // validation when adding a new template
+    private void myValidate() {
+
+        // make sure name is non-null and within proper size
+        if (StringUtils.isEmpty(getNewTmplName())) {
+            addError("Template.error.nameNull");
+        } else if (getNewTmplName().length() > RollerConstants.TEXTWIDTH_255) {
+            addError("Template.error.nameSize");
+        }
+
+        // make sure action is a valid
+        if (getNewTmplAction() == null) {
+            addError("Template.error.actionNull");
+        }
+
+        // check if template by that name already exists
+        try {
+            WeblogTemplate existingPage = WebloggerFactory.getWeblogger().getWeblogManager()
+                .getTemplateByName(getActionWeblog(), getNewTmplName());
+            if (existingPage != null) {
+                addError("pagesForm.error.alreadyExists", getNewTmplName());
+            }
+        } catch (WebloggerException ex) {
+            log.error("Error checking for existing template", ex);
+        }
+
+    }
+
+    /**
+     * Checks if is custom theme.
+     *
+     * @return true, if is custom theme
+     */
+    public boolean isCustomTheme() {
+        return (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme()));
+    }
+
+    public List<WeblogTemplate> getTemplates() {
+        return templates;
+    }
+
+    public void setTemplates(List<WeblogTemplate> templates) {
+        this.templates = templates;
+    }
+
+    public Map<ComponentType, String> getAvailableActions() {
+        return availableActions;
+    }
+
+    public void setAvailableActions(Map<ComponentType, String> availableActions) {
+        this.availableActions = availableActions;
+    }
+
+    public String getNewTmplName() {
+        return newTmplName;
+    }
+
+    public void setNewTmplName(String newTmplName) {
+        this.newTmplName = newTmplName;
+    }
+
+    public ComponentType getNewTmplAction() {
+        return newTmplAction;
+    }
+
+    public void setNewTmplAction(ComponentType newTmplAction) {
+        this.newTmplAction = newTmplAction;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplatesRemove.java
----------------------------------------------------------------------
diff --git a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplatesRemove.java b/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplatesRemove.java
deleted file mode 100644
index 7fd3e26..0000000
--- a/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplatesRemove.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.  For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-
-package org.apache.roller.weblogger.ui.struts2.editor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.business.WeblogManager;
-import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.pojos.ThemeTemplate;
-import org.apache.roller.weblogger.pojos.Weblog;
-import org.apache.roller.weblogger.pojos.WeblogTemplate;
-import org.apache.roller.weblogger.ui.struts2.util.UIAction;
-import org.apache.roller.weblogger.util.Utilities;
-import org.apache.roller.weblogger.util.cache.CacheManager;
-import org.apache.struts2.convention.annotation.AllowedMethods;
-
-/**
- * Remove templates.
- */
-// TODO: make this work @AllowedMethods({"execute","remove","cancel"})
-public class TemplatesRemove extends UIAction {
-
-    private static final long serialVersionUID = 895186156151331087L;
-    private static Log log = LogFactory.getLog(TemplatesRemove.class);
-
-    // Templates to remove
-    private String[] idSelections = null;
-
-    // Limit updates to just this set of comma-separated IDs
-    private String ids = null;
-
-    // list of templates to display
-    private List<WeblogTemplate> templates = Collections.emptyList();
-
-    public TemplatesRemove() {
-        this.actionName = "templatesRemove";
-        this.desiredMenu = "editor";
-        this.pageTitle = "editPages.title.removeOK";
-    }
-
-    public void myPrepare() {
-
-        if (getIdSelections() != null) {
-
-            // query for templates list
-            try {
-
-                WeblogManager mgr = WebloggerFactory.getWeblogger()
-                        .getWeblogManager();
-
-                List<WeblogTemplate> pages = new ArrayList<WeblogTemplate>();
-                WeblogTemplate template = null;
-
-                String[] idsToDelete = getIdSelections();
-                if (idsToDelete != null && idsToDelete.length > 0) {
-
-                    for (String id : idsToDelete) {
-                        if (!id.equals("")) {
-                            template = mgr.getTemplate(id);
-                            if (template != null) {
-                                pages.add(template);
-                            }
-                        }
-                    }
-
-                }
-
-                // Set page data
-                setTemplates(pages);
-                setIds(Utilities.stringArrayToString(idsToDelete, ","));
-
-                // Flush for operation
-                WebloggerFactory.getWeblogger().flush();
-
-            } catch (Exception ex) {
-                log.error("Error getting templates for weblog - "
-                        + getActionWeblog().getHandle(), ex);
-                addError("error.unexpected");
-            }
-
-        }
-    }
-
-    /**
-     * Display the remove template confirmation.
-     */
-    public String execute() {
-
-        if (getIds() != null && getTemplates() != null
-                && getTemplates().size() > 0) {
-            return "confirm";
-        } else {
-            return SUCCESS;
-        }
-
-    }
-
-    /**
-     * Remove Selected templates
-     */
-    public String remove() {
-
-        if (getIds() != null) {
-            try {
-
-                String[] idsToDelete = Utilities.stringToStringArray(getIds(),
-                        ",");
-                if (idsToDelete != null && idsToDelete.length > 0) {
-
-                    WeblogManager mgr = WebloggerFactory.getWeblogger()
-                            .getWeblogManager();
-
-                    Weblog weblog = getActionWeblog();
-                    WeblogTemplate template;
-
-                    for (String id : idsToDelete) {
-                        if (!id.equals("")) {
-                            template = mgr.getTemplate(id);
-                            if (!template.isRequired()
-                                    || !"custom".equals(getActionWeblog().getEditorTheme())) {
-
-                                // if weblog template remove custom style sheet
-                                // also
-                                if (template.getName().equals(
-                                        WeblogTemplate.DEFAULT_PAGE)) {
-
-                                    ThemeTemplate stylesheet = getActionWeblog()
-                                            .getTheme().getStylesheet();
-
-                                    // Delete style sheet if the same name
-                                    if (stylesheet != null
-                                            && getActionWeblog().getTheme()
-                                                    .getStylesheet() != null
-                                            && stylesheet.getLink().equals(
-                                                    getActionWeblog()
-                                                            .getTheme()
-                                                            .getStylesheet()
-                                                            .getLink())) {
-                                        // Same so OK to delete
-                                        WeblogTemplate css = mgr.getTemplateByLink(
-                                                getActionWeblog(),
-                                                stylesheet.getLink());
-
-                                        if (css != null) {
-                                            mgr.removeTemplate(css);
-                                        }
-                                    }
-                                }
-                                mgr.removeTemplate(template);
-                            }
-                        }
-                    }
-
-                    // Save for changes
-                    mgr.saveWeblog(weblog);
-
-                    WebloggerFactory.getWeblogger().flush();
-
-                    // notify caches
-                    CacheManager.invalidate(getActionWeblog());
-
-                }
-
-                return SUCCESS;
-
-            } catch (Exception e) {
-                log.error("Error deleting templates for weblog - "
-                        + getActionWeblog().getHandle(), e);
-
-                addError("error.unexpected");
-
-            }
-        }
-
-        return "confirm";
-    }
-
-    /**
-     * Cancel.
-     * 
-     * @return the string
-     */
-    public String cancel() {
-        return CANCEL;
-    }
-
-    /**
-     * Gets the templates.
-     * 
-     * @return the templates
-     */
-    public List<WeblogTemplate> getTemplates() {
-        return templates;
-    }
-
-    /**
-     * Sets the templates.
-     * 
-     * @param templates
-     *            the new templates
-     */
-    public void setTemplates(List<WeblogTemplate> templates) {
-        this.templates = templates;
-    }
-
-    /**
-     * Select check boxes for deleting records
-     */
-    public String[] getIdSelections() {
-        return idSelections;
-    }
-
-    /**
-     * Select check boxes for deleting records
-     */
-    public void setIdSelections(String[] idSelections) {
-        this.idSelections = idSelections;
-    }
-
-    /**
-     * Comma separated list if ids to remove
-     */
-    public String getIds() {
-        return ids;
-    }
-
-    /**
-     * Comma separated list if ids to remove
-     */
-    public void setIds(String ids) {
-        this.ids = ids;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/resources/ApplicationResources.properties
----------------------------------------------------------------------
diff --git a/app/src/main/resources/ApplicationResources.properties b/app/src/main/resources/ApplicationResources.properties
index da0e07b..7e6d134 100644
--- a/app/src/main/resources/ApplicationResources.properties
+++ b/app/src/main/resources/ApplicationResources.properties
@@ -983,7 +983,7 @@ the button below to allow access or simply close this window to deny it.
 # -------------------------------------------------------------- Page management
 
 pagesForm.title=Templates
-pagesForm.subtitle=Manage templates that define weblog <span>{0}</span>
+pagesForm.subtitle=Manage templates that define weblog <b>{0}</b>
 pagesForm.tip=You can edit the templates that define the layout, colors and \
 fonts of your weblog. You can also create new templates to define entirely \
 new pages. This is for advanced users only, if you''re not comfortable \
@@ -1020,11 +1020,13 @@ and code you are allowed to use in a template. This is for advanced \
 users only, if you''re not comfortable with HTML, you might want to leave \
 your templates alone. NOTE: this is a required weblog template, you cannot \
 change the name, link or description.
-pageForm.link=Link
+pageForm.link=Link (path)
+pageForm.resultingUrlWillBe=Resulting URL will be: 
+pageForm.noUrl=No link! Will be unable to access this new page via the web
 pageForm.hidden=Hidden
-pageForm.hidden.tip=Hidden pages cannot be accessed via a weblog URL
-pageForm.navbar=Include in page menu
-pageForm.navbar.tip=Include in menu produced by showPageMenu() macro
+pageForm.hidden.tip=Hidden pages cannot be accessed via URL
+pageForm.navbar=Include in page menu 
+pageForm.navbar.tip=Include in menu produced by <pre>showPageMenu()</pre> macro 
 pageForm.template=Template
 pageForm.newTemplateContent=<html><body></body></html>
 pageForm.save.success=Template updated successfully.
@@ -1036,14 +1038,7 @@ scratch or a predefined theme from the Theme tab.
 pageForm.templateLanguage=Template Language
 pageForm.outputContentType=Content-Type
 
-pageRemove.subtitle=Confirm removal of page
-pageRemoves.subtitle=Confirm removal of pages
-pageRemove.youSure=Are you sure you want to remove this page?
-pageRemoves.youSure=Are you sure you want to remove these pages?
-pageRemoves.youSureWarning=<b>WARNING</b>: This may remove custom html/css design and is <b>NOT REVERSIBLE</b>. \
-You might want to <b>backup your stylesheet</b> if you are not sure.
-pageRemove.pageId=Page ID
-pageRemove.pageName=Page Name
+pageRemove.confirm=Are you sure you want to remove this template: 
 
 # errors from validation
 Template.error.nameNull=Name is a required field

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
index 7f821c0..a2e850d 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
@@ -164,8 +164,7 @@
                 <div class="panel-heading">
 
                     <h4 class="panel-title">
-                        <a class="collapsed" data-toggle="collapse" data-target="#collapsePlugins" 
-                            href="#">
+                        <a class="collapsed" data-toggle="collapse" data-target="#collapsePlugins" href="#">
                             <s:text name="weblogEdit.pluginsToApply"/> </a>
                     </h4>
 

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp
deleted file mode 100644
index 8f5dc3c..0000000
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp
+++ /dev/null
@@ -1,61 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  The ASF licenses this file to You
-  under the Apache License, Version 2.0 (the "License"); you may not
-  use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.  For additional information regarding
-  copyright in this work, please see the NOTICE file in the top level
-  directory of this distribution.
---%>
-<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
-
-<h2>
-    <s:text name="weblogEntryRemove.removeWeblogEntry" /> [<s:property value="removeEntry.title"/>]
-</h2>
-
-<p><s:text name="weblogEntryRemove.areYouSure" /></p>
-<p>
-    <s:text name="weblogEntryRemove.entryTitle" /> = [<s:property value="removeEntry.title"/>]<br />
-    <s:text name="weblogEntryRemove.entryId" /> = [<s:property value="removeEntry.id"/>]
-</p>
-
-<%-- Differences between deletions from EntryEdit and Entries views --%>
-<s:if test="actionName == 'entryRemove'">
-    <s:set var="deleteAction">entryRemove!remove</s:set>
-    <s:set var="cancelAction">entryEdit</s:set>
-</s:if>
-<s:else>
-    <s:set var="deleteAction">entryRemoveViaList!remove</s:set>
-    <s:set var="cancelAction">entries</s:set>
-</s:else>
-
-<table>
-<tr>
-    <td>
-        <s:form action="%{#deleteAction}">
-            <s:hidden name="salt" />
-            <s:hidden name="weblog" />
-            <s:hidden name="removeId" />
-            <s:submit value="%{getText('generic.yes')}" />
-        </s:form>
-    </td>
-    <td>
-        <s:form action="%{#cancelAction}">
-            <s:hidden name="salt" />
-            <s:hidden name="weblog" />
-            <s:if test="actionName == 'entryRemove'" >
-                <s:hidden name="bean.id" value="%{removeEntry.id}"/>
-            </s:if>
-            <s:submit value="%{getText('generic.no')}"/>
-        </s:form>
-    </td>
-</tr>
-</table>

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/StylesheetEdit.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/StylesheetEdit.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/StylesheetEdit.jsp
index aa1b4b8..c3b90cf 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/StylesheetEdit.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/StylesheetEdit.jsp
@@ -104,6 +104,7 @@
     <s:text name="stylesheetEdit.customThemeNoStylesheet" />
 </s:else>
 
+
 <script type="text/javascript">
 
     function revertStylesheet() {

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp
index b3f1139..f4bc097 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/TemplateEdit.jsp
@@ -41,11 +41,13 @@
     <%-- Name, link and description: disabled when page is a required page --%>
 
     <s:if test="template.required || bean.mobile">
-        <s:textfield name="bean.name" label="%{getText('generic.name')}" size="50"
-            readonly="true" cssStyle="background: #e5e5e5"/>
+        <%-- Cannot edit name of a reqired template --%>
+        <s:textfield name="bean.name"
+            label="%{getText('generic.name')}" size="50" readonly="true" cssStyle="background: #e5e5e5"/>
     </s:if>
     <s:else>
-        <s:textfield name="bean.name" label="%{getText('generic.name')}" size="50"/>
+        <s:textfield name="bean.name"
+            label="%{getText('generic.name')}" size="50"/>
     </s:else>
 
     <s:textfield name="bean.action" label="%{getText('pageForm.action')}" size="50"
@@ -53,19 +55,29 @@
 
     <s:if test="!template.required && template.custom">
 
-        <s:text name="pageForm.link"/>
-        <s:textfield name="bean.link" label="%{getText('pageForm.link')}"
-            size="50" onkeyup="updatePageURLDisplay()"/>
+        <%-- allow setting the path for a custom template --%>
+        <s:textfield name="bean.link"
+            label="%{getText('pageForm.link')}" size="50" onkeyup="updatePageURLDisplay()"/>
 
-        <s:property value="actionWeblog.absoluteURL"/>page/
-        <span id="linkPreview" style="color:red"><s:property value="bean.link"/></span>
-        <s:if test="template.link != null">
-            [<a id="launchLink" onClick="launchPage()"><s:text name="pageForm.launch"/></a>]
-        </s:if>
+        <%-- show preview of the full URL that will result from that path --%>
+
+        <div id="no_link" class="alert-danger" style="display: none; margin-top:3em; margin-bottom:2em; padding: 1em">
+            <s:text name="pageForm.noUrl" />
+        </div>
+
+        <div id="good_link" class="alert-success" style="display: none; margin-top:3em; margin-bottom:2em; padding: 1em">
+            <s:text name="pageForm.resultingUrlWillBe" />
+            <s:property value="actionWeblog.absoluteURL"/>page/
+            <span id="linkPreview" style="color:red"><s:property value="bean.link"/></span>
+            <s:if test="template.link != null">
+                [<a id="launchLink" onClick="launchPage()"><s:text name="pageForm.launch"/></a>]
+            </s:if>
+        </div>
 
     </s:if>
 
     <s:if test="template.required">
+        <%-- Required templates have a description--%>
         <s:textarea name="bean.description" label="%{getText('generic.description')}"
             cols="50" rows="2" readonly="true" cssStyle="background: #e5e5e5"/>
     </s:if>
@@ -74,8 +86,27 @@
     </s:else>
 
     <%-- ================================================================== --%>
+
     <%-- Tabs for each of the two content areas: Standard and Mobile --%>
+    <ul id="template-code-tabs" class="nav nav-tabs" role="tablist" style="margin-bottom: 1em">
 
+        <li role="presentation" class="active">
+            <a href="#tabStandard" aria-controls="home" role="tab" data-toggle="tab">
+                <em><s:text name="stylesheetEdit.standard"/></em>
+            </a>
+        </li>
+
+        <s:if test="bean.contentsMobile != null">
+            <li role="presentation">
+                <a href="#tabMobile" aria-controls="home" role="tab" data-toggle="tab">
+                    <em><s:text name="stylesheetEdit.mobile"/></em>
+                </a>
+            </li>
+        </s:if>
+
+    </ul>
+
+    <%-- Tab content for each of the two content areas: Standard and Mobile --%>
     <div class="tab-content">
 
         <div role="tabpanel" class="tab-pane active" id="tabStandard">
@@ -93,91 +124,90 @@
     <%-- ================================================================== --%>
     <%-- Save, Close and Resize text area buttons--%>
 
-    <s:submit value="%{getText('generic.save')}"/>
-    <input type="button" value='<s:text name="generic.done"/>'
-        onclick="window.location='<s:url action="templates"><s:param name="weblog" value="%{weblog}"/></s:url>'"/>
+    <s:submit value="%{getText('generic.save')}" cssClass="btn btn-default"/>
+    <input type="button" value='<s:text name="generic.done"/>' class="button btn"
+           onclick="window.location='
+               <s:url action="templates">
+                   <s:param name="weblog" value="%{weblog}"/>
+               </s:url>'"/>
 
     <%-- ================================================================== --%>
     <%-- Advanced settings inside a control toggle --%>
 
     <s:if test="template.custom">
-        <br/>
-        <div id="advancedControlToggle" class="controlToggle">
-            <span id="iadvancedControl">+</span>
-            <a class="controlToggle" onclick="javascript:toggleControl('advancedControlToggle','advancedControl')">
-                <s:text name="pageForm.advancedSettings"/></a>
-        </div>
 
-        <div id="advancedControl" class="advancedControl" style="display:none">
+        <div class="panel-group" id="accordion" style="margin-top:2em">
 
-            <s:text name="pageForm.outputContentType"/>
+        <div class="panel panel-default" id="panel-plugins">
 
-            <s:if test="bean.autoContentType">
-                <input type="radio" name="bean.autoContentType"
-                       value="true" checked="true"
-                       onchange="showContentTypeField()"
-                       id="template_bean_autoContentType1"/>
-                <s:text name="pageForm.useAutoContentType"/><br/>
+            <div class="panel-heading">
 
-                <input type="radio" name="bean.autoContentType"
-                       value="false"
-                       onchange="showContentTypeField()"
-                       id="template_bean_autoContentType2"/>
-                <s:text name="pageForm.useManualContentType"/>
-                <s:textfield name="bean.manualContentType"/>
-            </s:if>
-            <s:else>
-                <input type="radio" name="bean.autoContentType"
-                       value="true"
-                       onchange="showContentTypeField()"
-                       id="template_bean_autoContentType1"/>
-                <s:text name="pageForm.useAutoContentType"/><br/>
-
-                <input type="radio" name="bean.autoContentType"
-                       value="false"
-                       checked="true"
-                       onchange="showContentTypeField()"
-                       id="template_bean_autoContentType2"/>
-                <s:text name="pageForm.useManualContentType"/>
-                <s:textfield name="bean.manualContentType"/>
-            </s:else>
-
-            <script><!--
-            showContentTypeField();
-            // --></script>
+                <h4 class="panel-title">
+                    <a class="collapsed" data-toggle="collapse" data-target="#collapseAdvanced" href="#">
+                        <s:text name="pageForm.advancedSettings"/>
+                    </a>
+                </h4>
+
+            </div>
 
-            <s:text name="pageForm.navbar"/>
-            <s:checkbox name="bean.navbar"/>
-            <s:text name="pageForm.navbar.tip"/>
+            <div id="collapseAdvanced" class="panel-collapse collapse">
+                <div class="panel-body">
 
-            <s:text name="pageForm.hidden"/>
-            <s:checkbox name="bean.hidden"/>
-            <s:text name="pageForm.hidden.tip"/>
+                    <s:select name="bean.templateLanguage" list="templateLanguages" size="1"
+                              label="%{getText('pageForm.templateLanguage')}" />
 
-            <s:text name="pageForm.templateLanguage"/>
-            <s:select name="bean.templateLanguage" list="templateLanguages" size="1"/>
+                    <s:checkbox name="bean.hidden"
+                                label="%{getText('pageForm.hidden')}" tooltip="%{getText('pageForm.hidden.tip')}" />
 
+                    <s:checkbox name="bean.navbar"
+                                label="%{getText('pageForm.navbar')}" tooltip="%{getText('pageForm.navbar.tip')}" />
+
+                    <s:checkbox name="bean.autoContentType"
+                                label="%{getText('pageForm.useAutoContentType')}" />
+
+                    <div id="manual-content-type-control-group" style="display:none">
+                        <s:textfield name="bean.manualContentType"
+                                    label="%{getText('pageForm.useManualContentType')}" />
+                    </div>
+
+                </div>
+            </div>
         </div>
+
     </s:if>
 
 </s:form>
 
 
-<script>
+<script type="text/javascript">
 
     var weblogURL = '<s:property value="actionWeblog.absoluteURL" />';
     var originalLink = '<s:property value="bean.link" />';
     var type = '<s:property value="bean.type" /> ';
 
-    // Update page URL when user changes link
-    function updatePageURLDisplay() {
-        var previewSpan = document.getElementById('linkPreview');
-        var n1 = previewSpan.firstChild;
-        var n2 = document.createTextNode(document.getElementById('template_bean_link').value);
-        if (n1 == null) {
-            previewSpan.appendChild(n2);
+    $(document).ready(function () {
+
+        $("#template-code-tabs").tabs();
+
+        showContentTypeField();
+        $("#template_bean_autoContentType").change(function(e){
+            showContentTypeField();
+        });
+
+        $("#__checkbox_template_bean_autoContentType").change(function(e){
+            showContentTypeField();
+        });
+
+        // Update page URL when user changes link
+        function updatePageURLDisplay() {
+            var link = $("#template_bean_link").val();
+            if ( link !== "" ) {
+                $("#no_link").hide();
+                $("#good_link").show();
+                $("#linkPreview").html( link );
         } else {
-            previewSpan.replaceChild(n2, n1);
+            $("#good_link").hide();
+            $("#no_link").show();
         }
     }
 
@@ -190,25 +220,11 @@
         }
     }
 
-    //Get cookie to determine state of control
-    if (getCookie('control_advancedControl') != null) {
-        if (getCookie('control_advancedControl') == 'true') {
-            toggle('advancedControl');
-            togglePlusMinus('iadvancedControl');
-        }
-    }
-
-    $(function () {
-        $("#template-code-tabs").tabs();
-    });
-
     function showContentTypeField() {
-        if (document.getElementById('template_bean_autoContentType1').checked) {
-            document.getElementById('template_bean_manualContentType').readOnly = true;
-            document.getElementById('template_bean_manualContentType').style.background = '#e5e5e5';
+        if ( $("#template_bean_autoContentType").val() == "true" ) {
+            $("#manual-content-type-control-group").hide();
         } else {
-            document.getElementById('template_bean_manualContentType').readOnly = false;
-            document.getElementById('template_bean_manualContentType').style.background = '#ffffff';
+            $("#manual-content-type-control-group").show();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/Templates.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/Templates.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/Templates.jsp
index 3fa7673..fefbab6 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/Templates.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/Templates.jsp
@@ -30,12 +30,12 @@
     <p><s:text name="pagesForm.themesReminder"><s:param value="actionWeblog.editorTheme"/></s:text></p>
 </s:if>
 
-<s:form action="templatesRemove" theme="bootstrap" cssClass="form-horizontal">
+<s:form action="templateRemove!remove" theme="bootstrap" cssClass="form-horizontal">
     <s:hidden name="salt"/>
     <s:hidden name="weblog" value="%{actionWeblog.handle}"/>
+    <s:hidden name="removeId" id="removeId"/>
 
-    <%-- table of pages --%>
-    <table class="rollertable table table-striped">
+    <table class="table table-striped"> <%-- of weblog templates --%>
 
         <s:if test="!templates.isEmpty">
 
@@ -73,7 +73,11 @@
                                 <s:param name="weblog" value="actionWeblog.handle"/>
                                 <s:param name="removeId" value="#p.id"/>
                             </s:url>
-                            <s:a href="%{removeUrl}"> <span class="glyphicon glyphicon-remove"></span> </s:a>
+                            <a href="#" onclick=
+                                    "confirmTemplateDelete('<s:property value="#p.id"/>', '<s:property value="#p.name"/>' )">
+                                <span class="glyphicon glyphicon-trash"></span>
+                            </a>
+
                         </s:if>
                         <s:else>
                             <span class="glyphicon glyphicon-lock"></span>
@@ -94,3 +98,14 @@
     </table>
 
 </s:form>
+
+
+<script>
+    function confirmTemplateDelete(templateId, templateName) {
+        $('#removeId').val(templateId);
+        if (window.confirm('<s:text name="pageRemove.confirm"/>: \'' + templateName + '\'?')) {
+            document.templateRemove.action = "<s:url action='templateRemove!remove' />";
+            document.templateRemove.submit();
+        }
+    }
+</script>

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesRemove.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesRemove.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesRemove.jsp
deleted file mode 100644
index febeb95..0000000
--- a/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesRemove.jsp
+++ /dev/null
@@ -1,54 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  The ASF licenses this file to You
-  under the Apache License, Version 2.0 (the "License"); you may not
-  use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.  For additional information regarding
-  copyright in this work, please see the NOTICE file in the top level
-  directory of this distribution.
---%>
-<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
-
-<p class="subtitle">
-	<s:text name="pageRemoves.subtitle" />
-</p>
-
-<p>
-	<s:text name="pageRemoves.youSure" />
-	<br/>
-	<br/>
-	<span class="warning">
-		<s:text name="pageRemoves.youSureWarning" />
-	</span>
-</p>
-
-<s:form action="templatesRemove">
-	<s:hidden name="salt" />
-	<s:hidden name="ids" />
-	<s:hidden name="weblog" value="%{actionWeblog.handle}" />
-	
-	<s:iterator var="p" value="templates" status="rowstatus">
-		<p>
-			<s:text name="pageRemove.pageId" /> = [<s:property value="#p.id" />]
-			<s:text name="pageRemove.pageName" /> = [<s:property value="#p.name" />]
-		</p>
-	</s:iterator>
-
-	<table>
-		<tr>
-			<td>
-				<s:submit value="%{getText('generic.yes')}" action="templatesRemove!remove" />&nbsp;
-				<s:submit value="%{getText('generic.no')}" action="templatesRemove!cancel" />
-			</td>
-		</tr>
-	</table>
-
-</s:form>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesSidebar.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesSidebar.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesSidebar.jsp
index 3fab32a..38e3df0 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesSidebar.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/TemplatesSidebar.jsp
@@ -29,7 +29,7 @@
 
     <s:if test="!availableActions.isEmpty">
         <s:text name="pagesForm.action"/>
-        <s:select name="newTmplAction" size="1" list="availableActions"/>
+        <s:select name="newTmplAction" list="availableActions"/>
     </s:if>
 
     <s:submit class="btn" value="%{getText('pagesForm.add')}"/>

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp
index 53d27b1..8623cc7 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/ThemeEdit.jsp
@@ -36,7 +36,7 @@
                 <div class="panel-body" id="sharedChooser">
                     <h3>
                         <input id="sharedRadio" type="radio" name="themeType" value="shared"
-                               <s:if test="!customTheme">checked</s:if> onclick="proposeThemeTypeChange($(this))"/>&nbsp;
+                            <s:if test="!customTheme">checked</s:if> onclick="proposeThemeTypeChange($(this))"/>&nbsp;
                         <s:text name="themeEditor.sharedTheme"/>
                     </h3>
                     <s:text name="themeEditor.sharedThemeDescription"/>
@@ -49,7 +49,7 @@
                 <div class="panel-body" id="customChooser">
                     <h3>
                         <input id="customRadio" type="radio" name="themeType" value="custom"
-                               <s:if test="customTheme">checked</s:if> onclick="proposeThemeTypeChange($(this))"/>&nbsp;
+                            <s:if test="customTheme">checked</s:if> onclick="proposeThemeTypeChange($(this))"/>&nbsp;
                         <s:text name="themeEditor.customTheme"/>
                     </h3>
                     <s:text name="themeEditor.customThemeDescription"/>

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/WEB-INF/tiles.xml
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/tiles.xml b/app/src/main/webapp/WEB-INF/tiles.xml
index 429954f..3b618b8 100644
--- a/app/src/main/webapp/WEB-INF/tiles.xml
+++ b/app/src/main/webapp/WEB-INF/tiles.xml
@@ -297,11 +297,6 @@
         <put-attribute name="styles" value="/WEB-INF/jsps/tiles/empty.jsp" />
     </definition>
 
-    <definition name=".EntryRemove" extends=".tiles-tabbedpage" >
-        <put-attribute name="content" value="/WEB-INF/jsps/editor/EntryRemove.jsp" />
-        <put-attribute name="styles" value="/WEB-INF/jsps/tiles/empty.jsp" />
-    </definition>
-
     <definition name=".Entries" extends=".tiles-tabbedpage" >
         <put-attribute name="head" value="/WEB-INF/jsps/tiles/head.jsp" />
         <put-attribute name="content" value="/WEB-INF/jsps/editor/Entries.jsp" />
@@ -367,17 +362,7 @@
         <put-attribute name="content" value="/WEB-INF/jsps/editor/TemplateEdit.jsp" />
         <put-attribute name="styles" value="/WEB-INF/jsps/tiles/empty.jsp" />
     </definition>
-    
-    <definition name=".TemplateRemove" extends=".tiles-tabbedpage"  >
-        <put-attribute name="content" value="/WEB-INF/jsps/editor/TemplateRemove.jsp" />
-        <put-attribute name="styles" value="/WEB-INF/jsps/tiles/empty.jsp" />
-    </definition>
-    
-    <definition name=".TemplatesRemove" extends=".tiles-tabbedpage"  >
-        <put-attribute name="content" value="/WEB-INF/jsps/editor/TemplatesRemove.jsp" />
-        <put-attribute name="styles" value="/WEB-INF/jsps/tiles/empty.jsp" />
-    </definition>
-    
+
     <definition name=".Members" extends=".tiles-tabbedpage" >
         <put-attribute name="content" value="/WEB-INF/jsps/editor/Members.jsp" />
         <put-attribute name="sidebar" value="/WEB-INF/jsps/editor/MembersSidebar.jsp" />

http://git-wip-us.apache.org/repos/asf/roller/blob/de9086c7/app/src/main/webapp/roller-ui/styles/roller.css
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/roller-ui/styles/roller.css b/app/src/main/webapp/roller-ui/styles/roller.css
index 0fced51..5aedcd1 100644
--- a/app/src/main/webapp/roller-ui/styles/roller.css
+++ b/app/src/main/webapp/roller-ui/styles/roller.css
@@ -50,6 +50,10 @@ table {
     transition: opacity 1.25s linear;
 }
 
+.glyphicon-info-sign {
+    margin-right: 0.5em;
+}
+
 /* main menu */
 
 .mm_subtable_label {
@@ -139,9 +143,6 @@ td.pendingcomment {
     background: #ffcccc;
     border: 1px gray solid;
 }
-.rollertable label.checkboxLabel {
-    display: none;
-}
 table.innertable {
     border-collapse: collapse;
     width: 100%;
@@ -150,9 +151,6 @@ table.innertable {
 table.innertable tbody td {
     padding: 0;
 }
-table.rollertable .innertable td {
-    border: none;
-}
 table.innertable td.viewbody {
     padding: 5px;
 }


Mime
View raw message