From f243f48b3b8a35e2118476c95ec8f158275f988a Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 25 Jan 2011 17:32:45 +0000 Subject: [PATCH] NIHVIVO-1895 Show placeholder image for non-person individual when displaying an add link for an image --- .../freemarker/body/individual/individual-vitro.ftl | 7 ++++++- .../body/partials/individual/lib-properties.ftl | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl index fa9bc9d99..e35f99593 100644 --- a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl @@ -5,7 +5,12 @@
<#-- Image --> - <@p.imageLinks individual propertyGroups namespaces editable /> + <@p.imageLinks individual=individual + propertyGroups=propertyGroups + namespaces=namespaces + editable=editable + showPlaceholder="with_add_link" + placeholder="${urls.images}/placeholders/person.thumbnail.jpg" />
<#if individual.showAdminPanel> 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 46f7df73a..59d503966 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -118,7 +118,8 @@ name will be used as the label. --> <#-- Main image links --> -<#macro imageLinks individual propertyGroups namespaces editable placeholderImage=""> +<#-- Values for showPlaceholderImage: "always", "never", "with_add_link" --> +<#macro imageLinks individual propertyGroups namespaces editable showPlaceholder="never" placeholder=""> <#local mainImage = propertyGroups.getPropertyAndRemoveFromList("${namespaces.vitroPublic}mainImage")!> <#local thumbUrl = individual.thumbUrl!> <#-- Don't assume that if the mainImage property is populated, there is a thumbnail image (though that is the general case). @@ -127,9 +128,12 @@ name will be used as the label. --> ${individual.name} <@p.editingLinks "${mainImage.localName}" mainImage.statements[0] editable /> <#else> - <@p.addLinkWithLabel mainImage editable "Photo" /> - <#if placeholderImage?has_content> - placeholder image + <#local imageLabel><@p.addLinkWithLabel mainImage editable "Photo" /> + ${imageLabel} + <#if placeholder?has_content> + <#if showPlaceholder == "always" || (showPlaceholder="with_add_link" && imageLabel?has_content)> + placeholder image +