diff --git a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy index 51bafa9..7f5f5c2 100644 --- a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy +++ b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy @@ -315,13 +315,13 @@ class ThemeTagLib { def bodyAttrs = attrs.bodyAttrs def bodyAttrsStr = '' if (bodyAttrs instanceof Map) { - bodyAttrsStr = HTMLTagLib.attrsToString(bodyAttrs) + bodyAttrsStr = TagLibUtils.attrsToString(bodyAttrs) } else if (bodyAttrs instanceof List) { def bodyAttrsMap = [:] bodyAttrs.each { p -> bodyAttrsMap[p] = g.pageProperty(name:'body.'+p) } - bodyAttrsStr = HTMLTagLib.attrsToString(bodyAttrsMap) + bodyAttrsStr = TagLibUtils.attrsToString(bodyAttrsMap) } - out << "" + out << "" if (debugMode) { // We need the body of the debug GSP as it has the panel in it // @todo we can probably ditch this layoutBody if theme previewer concats to "body" zone @@ -334,10 +334,22 @@ class ThemeTagLib { def layoutTemplate = { attrs -> def templateView = grailsThemes.getRequestThemeTemplateView(request, attrs.name) - if (log.debugEnabled) { - log.debug "Resolved current request's theme template for [${attrs.name}] to [${templateView}]" + // Location of app's standard content for theme layout templates + // /grails-app/views/_themes// + def layoutTemplatePath = "/_themes/${templateView.owner}/${attrs.name}" + + // First see if the application provides default content for this template + if (grailsViewFinder.templateExists(layoutTemplatePath)) { + if (log.debugEnabled) { + log.debug "Resolved current request's theme template for [${attrs.name}] to [${layoutTemplatePath}]" + } + out << g.render(template:layoutTemplatePath) + } else { + if (log.debugEnabled) { + log.debug "Resolved current request's theme template for [${attrs.name}] to [${templateView}]" + } + out << g.render(template:templateView.path, plugin:templateView.plugin) } - out << g.render(template:templateView.path, plugin:templateView.plugin) } def defaultContent = { attrs -> @@ -364,4 +376,4 @@ class ThemeTagLib { } -} \ No newline at end of file +} diff --git a/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy index fef9aea..25a2d4b 100644 --- a/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy +++ b/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy @@ -673,7 +673,7 @@ class UITagLib implements InitializingBean { def name = attrs.name def type = attrs.type def value = attrs.value - def beanObject = attrs.bean + def beanObject = attrs.beanObject?: attrs.bean //leave bean for backward compatibility def classes = attrs.remove('classes') def i18name = name if (!attrs.id) { @@ -696,7 +696,9 @@ class UITagLib implements InitializingBean { def labelCode = attrs.remove('label') if (!labelCode && name) { def propName = resolvePropertyName(name) - label = GrailsNameUtils.getNaturalName(propName) + label = p.text(code: "${GrailsNameUtils.getPropertyName(beanObject.getClass().simpleName)}.${propName}.label", default: '') + if(!label) + label = GrailsNameUtils.getNaturalName(propName) } if ((labelCode == null) && !label) { throwTagError "A value must be provided for [label] or [name] if no custom label is provided" diff --git a/src/groovy/org/grails/plugin/platform/ui/UISetDefinition.groovy b/src/groovy/org/grails/plugin/platform/ui/UISetDefinition.groovy index a9d9e74..78d43a0 100644 --- a/src/groovy/org/grails/plugin/platform/ui/UISetDefinition.groovy +++ b/src/groovy/org/grails/plugin/platform/ui/UISetDefinition.groovy @@ -62,7 +62,7 @@ class UISetDefinition { } for (p in pluginViewInfos) { - if (!mergedViews.find { v -> v == p}) { + if (!mergedViews.find { v -> v.name == p.name}) { mergedViews << p } } @@ -96,4 +96,4 @@ class UISetDefinition { } return v } -} \ No newline at end of file +}