Changes for NIHVIVO-2231 and NIHVIVO-2664: setting up menu page editing and retrieval of individuals for class intersections

This commit is contained in:
hjkhjk54 2011-06-08 21:14:52 +00:00
parent 91db1ad147
commit 9214b285a5
23 changed files with 501 additions and 66 deletions

View file

@ -1,7 +1,7 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Default individual profile page template -->
<#--@dumpAll /-->
<section id="individual-intro" class="vcard" role="region">
<#-- Image -->
<#assign individualImage>

View file

@ -0,0 +1,61 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- List individuals in the requested class. -->
<#import "lib-list.ftl" as l>
<section id="menupage-intro" role="region">
<h2>${page.title}</h2>
</section>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/browseIndex.css" />')}
<#assign pageurl = page.urlMapping>
<section class="individualList">
<#if message??>
<p>${message}</p>
<#else>
<#assign pagination>
<#if (pages?size > 1) >
pages:
<ul class="pagination">
<#list pages as page>
<#if page.selected>
<li class="selectedNavPage">${page.text}</li>
<#else>
<#-- RY Ideally the urls would be generated by the controller; see search-pagedResults.ftl -->
<li><a href="${urls.base}${pageurl}?${page.param}">${page.text}</a></li>
</#if>
</#list>
</ul>
</#if>
</#assign>
${pagination}
<ul>
<#list individuals as individual>
<li>
<#assign moniker = individual.moniker!>
<a href="${individual.profileUrl}">${individual.name}</a><#if moniker?has_content> <span class="moniker">${moniker}</span></#if>
<#assign links = individual.links>
<#if links?has_content>
<ul class="individualData">
<@l.firstLastList>
<#list links as link>
<li><a class="externalLink" href="${link.url}">${link.anchor}</a></li>
</#list>
</@l.firstLastList>
</ul>
</#if>
</li>
</#list>
</ul>
${pagination}
</#if>
</section> <!-- .individualList -->

View file

@ -29,10 +29,11 @@
<#macro dataPropertyList property editable>
<#list property.statements as statement>
<@propertyListItem property statement editable>${statement.value}</@propertyListItem>
<@propertyListItem property statement editable >${statement.value}</@propertyListItem>
</#list>
</#macro>
<#macro objectProperty property editable template=property.template>
<#if property.collatedBySubclass> <#-- collated -->
<@collatedObjectPropertyList property editable template />
@ -44,14 +45,15 @@
</#if>
</#macro>
<#macro collatedObjectPropertyList property editable template=property.template>
<#macro collatedObjectPropertyList property editable template=property.template >
<#assign subclasses = property.subclasses>
<#list subclasses?keys as subclass>
<#if subclass?has_content>
<li class="subclass" role="listitem">
<h3>${subclass?lower_case}</h3>
<ul class="subclass-property-list">
<@objectPropertyList property editable subclasses[subclass] template/>
<@objectPropertyList property editable subclasses[subclass] template />
</ul>
</li>
<#else>
@ -73,7 +75,7 @@ Assumes property is non-null. -->
<#macro objectPropertyList property editable statements=property.statements template=property.template>
<#list statements as statement>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
</#list>
</#macro>
@ -90,6 +92,7 @@ name will be used as the label. -->
<#macro addLink property editable label="${property.name}" extraParams="">
<#if editable>
<#--@dump var="property"/-->
<#local url = property.addUrl>
<#if url?has_content>
<@showAddLink property.localName label addParamsToEditUrl(url, extraParams) />
@ -114,10 +117,11 @@ name will be used as the label. -->
<h2 id="${property.localName}">${label} <@verboseDisplay property /></h2>
</#macro>
<#macro propertyListItem property statement editable>
<#macro propertyListItem property statement editable >
<li role="listitem">
<#nested>
<@editingLinks "${property.localName}" statement editable />
<@editingLinks "${property.localName}" statement editable/>
</li>
</#macro>
@ -217,7 +221,7 @@ name will be used as the label. -->
<#-- 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-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
<a href="${individual.imageUrl}"><img class="individual-photo" src="${tlhumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
<@editingLinks "${mainImage.localName}" mainImage.first editable extraParams />
<#else>
<#local imageLabel><@addLinkWithLabel mainImage editable "Photo" extraParams /></#local>
@ -235,4 +239,6 @@ name will be used as the label. -->
<#local label = individual.nameStatement>
${label.value}
<@editingLinks "label" label editable />
</#macro>
</#macro>