NIHVIVO-1332 Editing links for individual image

This commit is contained in:
rjy7 2011-01-14 17:17:36 +00:00
parent 69e8180ae8
commit 91abe8e801
9 changed files with 75 additions and 43 deletions

View file

@ -10,12 +10,8 @@
<section id="individual-intro" class="vcard" role="region">
<section id="share-contact" role="region">
<#-- Thumbnail -->
<#if individual.thumbUrl??>
<a href="${individual.imageUrl}"><img class="individual-photo2" src="${individual.thumbUrl}" title="click to view larger image" alt="${individual.name}" width="115" /></a>
<#--<#elseif individual.person>
<img class="individual-photo2" src="${urls.images}/placeholders/person.thumbnail.jpg" title = "no image" alt="placeholder image" width="115" />-->
</#if>
<#-- Image -->
<@p.imageLinks individual propertyGroups editing />
</section>
<section id="individual-info" role="region">

View file

@ -0,0 +1,14 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Setup needed by all individual templates -->
<#import "lib-list.ftl" as l>
<#import "lib-properties.ftl" as p>
<#assign editing = individual.showEditingLinks>
<#assign editingClass>
<#if editing>editing</#if>
</#assign>
<#assign propertyGroups = individual.propertyList>

View file

@ -110,3 +110,21 @@ name will be used as the label. -->
</nav>
</#if>
</#macro>
<#-- Main image links -->
<#macro imageLinks individual propertyGroups showEditLinks placeholderImage="">
<#assign mainImage = propertyGroups.getPropertyAndRemoveFromList("${namespaces.vitroPublic}mainImage")!>
<#assign thumbUrl = individual.thumbUrl!>
<#-- Don't assume that if the mainImage property is populated, there is a thumbnail image (though that is the general case).
If there's a mainImage statement but no thumbnail image, treat it as if there is no image. -->
<#if (mainImage.statements)?has_content && thumbUrl?has_content>
<a href="${individual.imageUrl}"><img class="individual-photo2" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="115" /></a>
<@p.editingLinks mainImage.statements[0] showEditLinks />
<#else>
<@p.addLinkWithLabel mainImage showEditLinks "Photo" />
<#if placeholderImage?has_content>
<img class="individual-photo2" src="${dummyImage}" title = "no image" alt="placeholder image" width="115" />
</#if>
</#if>
</#macro>