From a220c5cba65b230d77750a99b396ddde701cfb37 Mon Sep 17 00:00:00 2001 From: ryounes Date: Wed, 25 May 2011 19:47:18 +0000 Subject: [PATCH] Add tests for existence of property in addLinkWithLabel and addLink macros --- .../body/partials/individual/lib-properties.ftl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index 5f84cdf4c..4f68fc934 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -81,15 +81,17 @@ Assumes property is non-null. --> we need to also show the property label. If no label is specified, the property name will be used as the label. --> <#macro addLinkWithLabel property editable label="${property.name?capitalize}" extraParams=""> - <#local addLink><@addLink property editable label extraParams /> - <#local verboseDisplay><@verboseDisplay property /> - <#if addLink?has_content || verboseDisplay?has_content> -

${label} ${addLink!} ${verboseDisplay!}

+ <#if property?has_content> + <#local addLink><@addLink property editable label extraParams /> + <#local verboseDisplay><@verboseDisplay property /> + <#if addLink?has_content || verboseDisplay?has_content> +

${label} ${addLink!} ${verboseDisplay!}

+ <#macro addLink property editable label="${property.name}" extraParams=""> - <#if editable> + <#if property?has_content && editable> <#local url = property.addUrl> <#if url?has_content> <@showAddLink property.localName label addParamsToEditUrl(url, extraParams) /> @@ -208,7 +210,7 @@ name will be used as the label. --> Note that this macro has a side-effect in the call to propertyGroups.pullProperty(). --> <#macro image individual propertyGroups namespaces editable showPlaceholder="never" placeholder=""> - <#local mainImage = propertyGroups.pullProperty("${namespaces.vitroPublic}mainImage")!> + <#local mainImage = propertyGroups.pullProperty("${namespaces.vitroPublic}fake")!> <#local extraParams = ""> <#if placeholder?has_content> <#local extraParams = { "placeholder" : placeholder } >