From 47165d45946342b148313d020bd23c9db64de264 Mon Sep 17 00:00:00 2001 From: Simon Pither Date: Tue, 15 Jan 2013 20:22:28 +0000 Subject: [PATCH 1/7] Fix filename PlatformUiFIlters --- .../conf/{PlatformUiFIlters.groovy => PlatformUiFilters.groovy} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename grails-app/conf/{PlatformUiFIlters.groovy => PlatformUiFilters.groovy} (100%) diff --git a/grails-app/conf/PlatformUiFIlters.groovy b/grails-app/conf/PlatformUiFilters.groovy similarity index 100% rename from grails-app/conf/PlatformUiFIlters.groovy rename to grails-app/conf/PlatformUiFilters.groovy From 1153e1e48d39098fba61a11ef9a2e0e4f9eeeb84 Mon Sep 17 00:00:00 2001 From: Simon Pither Date: Thu, 21 Feb 2013 16:09:46 +0000 Subject: [PATCH 2/7] Fix use of bodyAttrs in theme:body tag --- .../taglib/org/grails/plugin/platform/ThemeTagLib.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy index 51bafa9..52a5a2d 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 @@ -364,4 +364,4 @@ class ThemeTagLib { } -} \ No newline at end of file +} From c5adea8ebb741669643229f067313c970951313a Mon Sep 17 00:00:00 2001 From: Simon Pither Date: Sat, 23 Feb 2013 11:15:56 +0000 Subject: [PATCH 3/7] Fix application overrides of UI tag templates --- .../org/grails/plugin/platform/ui/UISetDefinition.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +} From 8d5533d1c5ffc4c5bd6086d09ddf1dddea6752f0 Mon Sep 17 00:00:00 2001 From: Simon Pither Date: Sun, 2 Jun 2013 21:30:58 +0100 Subject: [PATCH 4/7] Add basic attempt to use i18n messages to resolve field names when no label provided. Uses the same convention as the Fields plugin (without fall-back to parent types). --- grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy index fef9aea..15cdf8c 100644 --- a/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy +++ b/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy @@ -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" From 3c49773028b6539956a2dba32b406736d20a411c Mon Sep 17 00:00:00 2001 From: Alessandro Berbenni Date: Tue, 2 Jul 2013 18:52:36 +0200 Subject: [PATCH 5/7] Fix attrs for field tag As reported in field.gdoc: beanObject | The original root bean supplying the value, if any. So fixed field closure in UITagLib: 660 def field = { attrs, body -> ... 676 def beanObject = attrs.bean --- grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/UITagLib.groovy index fef9aea..07458f6 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) { From 56ba5548580aa2f6e0fbf8fd2f6349f83f61a4ed Mon Sep 17 00:00:00 2001 From: Alessandro Berbenni Date: Fri, 12 Jul 2013 19:33:01 +0200 Subject: [PATCH 6/7] Override layoutTemplate Changed code in theme:layoutTemplate tag to enable overriding in app as for UI blocks, themes and zones. --- .../grails/plugin/platform/ThemeTagLib.groovy | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy index 51bafa9..cf3249f 100644 --- a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy +++ b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy @@ -334,10 +334,19 @@ 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)) { + 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 +373,4 @@ class ThemeTagLib { } -} \ No newline at end of file +} From 2a6310f42931b1504895eb7a3fe94fd49f15392e Mon Sep 17 00:00:00 2001 From: Alessandro Berbenni Date: Fri, 12 Jul 2013 19:34:22 +0200 Subject: [PATCH 7/7] Update ThemeTagLib.groovy --- .../taglib/org/grails/plugin/platform/ThemeTagLib.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy index cf3249f..6d67cd6 100644 --- a/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy +++ b/grails-app/taglib/org/grails/plugin/platform/ThemeTagLib.groovy @@ -340,6 +340,9 @@ class ThemeTagLib { // 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) {