NIHVIVO-1895 Show placeholder image for non-person individual when displaying an add link for an image
This commit is contained in:
parent
9ceb990c9d
commit
f243f48b3b
2 changed files with 14 additions and 5 deletions
|
@ -5,7 +5,12 @@
|
||||||
<section id="individual-intro" class="vcard" role="region">
|
<section id="individual-intro" class="vcard" role="region">
|
||||||
|
|
||||||
<#-- Image -->
|
<#-- 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" />
|
||||||
|
|
||||||
<section id="individual-info" role="region">
|
<section id="individual-info" role="region">
|
||||||
<#if individual.showAdminPanel>
|
<#if individual.showAdminPanel>
|
||||||
|
|
|
@ -118,7 +118,8 @@ name will be used as the label. -->
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#-- Main image links -->
|
<#-- 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 mainImage = propertyGroups.getPropertyAndRemoveFromList("${namespaces.vitroPublic}mainImage")!>
|
||||||
<#local thumbUrl = individual.thumbUrl!>
|
<#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).
|
<#-- 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. -->
|
||||||
<a href="${individual.imageUrl}"><img class="individual-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
|
<a href="${individual.imageUrl}"><img class="individual-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
|
||||||
<@p.editingLinks "${mainImage.localName}" mainImage.statements[0] editable />
|
<@p.editingLinks "${mainImage.localName}" mainImage.statements[0] editable />
|
||||||
<#else>
|
<#else>
|
||||||
<@p.addLinkWithLabel mainImage editable "Photo" />
|
<#local imageLabel><@p.addLinkWithLabel mainImage editable "Photo" /></#local>
|
||||||
<#if placeholderImage?has_content>
|
${imageLabel}
|
||||||
<img class="individual-photo" src="${placeholderImage}" title = "no image" alt="placeholder image" width="160" />
|
<#if placeholder?has_content>
|
||||||
|
<#if showPlaceholder == "always" || (showPlaceholder="with_add_link" && imageLabel?has_content)>
|
||||||
|
<img class="individual-photo" src="${placeholder}" title = "no image" alt="placeholder image" width="160" />
|
||||||
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue