NIHVIVO-1315: Refactoring individual.ftl. This was duplicated in VIVO and VITRO.

This commit is contained in:
mb863 2011-01-21 03:20:01 +00:00
parent 94141e048c
commit 781f3d042f
4 changed files with 88 additions and 77 deletions

View file

@ -0,0 +1,77 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Default individual profile page template -->
<section id="individual-intro" class="vcard" role="region">
<#-- Image -->
<@p.imageLinks individual propertyGroups editable />
<section id="individual-info" role="region">
<#if individual.showAdminPanel>
<#include "individual-adminPanel.ftl">
</#if>
<header>
<#if relatedSubject??>
<h2>${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}</h2>
<p><a href="${relatedSubject.url}">&larr; return to ${relatedSubject.name}</a></p>
<#else>
<h1 class="fn">
<#-- Label -->
<#assign label = individual.nameStatement>
${label.value}
<#-- <@p.editingLinks label label editable /> -->
<#-- Moniker -->
<#if individual.moniker?has_content>
<span class="preferred-title">${individual.moniker}</span>
</#if>
</h1>
</#if>
</header>
<nav role="navigation">
<ul id ="individual-tools" role="list">
<#assign uriUrl = individual.uri>
<#if uriUrl??>
<li role="listitem"><a title="Individual uri" href="${uriUrl}"><img class="middle" src="${urls.images}/individual/uriIcon.gif" alt="uri icon" /></a></li>
</#if>
<#assign rdfUrl = individual.rdfUrl>
<#if rdfUrl??>
<li role="listitem"><a title="View this individual in RDF format" class="icon-rdf" href="${rdfUrl}">RDF</a></li>
</#if>
</ul>
</nav>
<#-- Links -->
<@p.vitroLinks propertyGroups editable />
<#if individualProductExtension??>
${individualProductExtension}
<#else>
</section> <!-- individual-info -->
</section> <!-- individual-intro -->
</#if>
<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl -->
<#-- Property group menu -->
<#include "individual-propertyGroupMenu.ftl">
<#-- Ontology properties -->
<#include "individual-properties.ftl">
${stylesheets.add("/css/individual/individual.css")}
<#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) -->
${headScripts.add("/js/jquery_plugins/getURLParam.js",
"/js/jquery_plugins/colorAnimations.js",
"/js/jquery_plugins/jquery.form.js",
"/js/tiny_mce/tiny_mce.js",
"/js/controls.js",
"/js/toggle.js")}
${scripts.add("/js/imageUpload/imageUploadUtils.js")}

View file

@ -1,72 +1,6 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Default individual profile page template -->
<#include "individual-setup.ftl">
<#if individual.showAdminPanel>
<#include "individual-adminPanel.ftl">
</#if>
<section id="individual-intro" class="vcard" role="region">
<section id="share-contact" role="region">
<#-- Image -->
<@p.imageLinks individual propertyGroups editable />
</section>
<section id="individual-info" role="region">
<header>
<#if relatedSubject??>
<h2>${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}</h2>
<p><a href="${relatedSubject.url}">&larr; return to ${relatedSubject.name}</a></p>
<#else>
<h1 class="fn">
<#-- Label -->
<#assign label = individual.nameStatement>
${label.value}
<@p.editingLinks label label editable />
<#-- Moniker -->
<#if individual.moniker?has_content>
<span class="preferred-title">${individual.moniker}</span>
</#if>
</h1>
</#if>
</header>
<nav role="navigation">
<ul id ="individual-tools" role="list">
<#--<li role="listitem"><a class="picto-font picto-uri" href="#">j</a></li>
<li role="listitem"><a class="picto-font picto-pdf" href="#">F</a></li>
<li role="listitem"><a class="picto-font picto-share" href="#">R</a></li>-->
<#assign rdfUrl = individual.rdfUrl>
<#if rdfUrl??>
<li role="listitem"><a class="icon-rdf" href="${rdfUrl}">RDF</a></li>
</#if>
</ul>
</nav>
<#-- Links -->
<@p.vitroLinks propertyGroups editable />
</section>
</section>
<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl -->
<#-- Property group menu -->
<#include "individual-propertyGroupMenu.ftl">
<#-- Ontology properties -->
<#include "individual-properties.ftl">
${stylesheets.add("/css/individual/individual.css")}
<#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) -->
${headScripts.add("/js/jquery_plugins/getURLParam.js",
"/js/jquery_plugins/colorAnimations.js",
"/js/jquery_plugins/jquery.form.js",
"/js/tiny_mce/tiny_mce.js",
"/js/controls.js",
"/js/toggle.js")}
${scripts.add("/js/imageUpload/imageUploadUtils.js")}
<#include "individual-vitro.ftl">

View file

@ -10,7 +10,7 @@
<section class="property-group" role="region">
<nav class="scroll-up" role="navigation">
<a href="#property-group-menu">
<img src="${urls.images}/individual/scroll-up.png" alt="scroll to property group menus" />
<img src="${urls.images}/individual/scroll-up.gif" alt="scroll to property group menus" />
</a>
</nav>

View file

@ -38,7 +38,7 @@ name will be used as the label. -->
<#macro addLinkWithLabel property editable label="${property.name?capitalize}">
<#local addLink><@addLink property editable /></#local>
<#if addLink?has_content>
<h3>${label} ${addLink}</h3>
<h3 id="${property.localName}">${label} ${addLink}</h3>
</#if>
</#macro>
@ -46,7 +46,7 @@ name will be used as the label. -->
<#if editable>
<#local url = property.addUrl>
<#if url?has_content>
<a href="${url}" title="add entry"><img class="add-individual" src="${urls.images}/individual/addIcon.gif" alt="add" /></a>
<a class="add-${property.localName}" href="${url}" title="add entry"><img class="add-individual" src="${urls.images}/individual/addIcon.gif" alt="add" /></a>
</#if>
</#if>
</#macro>
@ -68,14 +68,14 @@ name will be used as the label. -->
<#macro editLink property statement>
<#local url = statement.editUrl>
<#if url?has_content>
<a href="${url}" title="edit this entry"><img class="edit-individual" src="${urls.images}/individual/editIcon.gif" alt="edit" /></a>
<a class="edit-${property.localName}" href="${url}" title="edit this entry"><img class="edit-individual" src="${urls.images}/individual/editIcon.gif" alt="edit" /></a>
</#if>
</#macro>
<#macro deleteLink property statement>
<#local url = statement.deleteUrl>
<#if url?has_content>
<a href="${url}" title="delete this entry"><img class="delete-individual" src="${urls.images}/individual/deleteIcon.gif" alt="delete" /></a>
<a class="delete-${property.localName}" href="${url}" title="delete this entry"><img class="delete-individual" src="${urls.images}/individual/deleteIcon.gif" alt="delete" /></a>
</#if>
</#macro>
@ -117,13 +117,13 @@ name will be used as the label. -->
<#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-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
<@p.editingLinks mainImage mainImage.statements[0] showEditLinks />
<#if (mainImage.statements)?has_content && thumbUrl?has_content>
<div class="thumb-links"><@p.editingLinks mainImage mainImage.statements[0] showEditLinks /></div>
<a href="${individual.imageUrl}"><img class="individual-photo" src="${thumbUrl}" title="click to view larger image" alt="${individual.name}" width="160" /></a>
<#else>
<@p.addLinkWithLabel mainImage showEditLinks "Photo" />
<#if placeholderImage?has_content>
<img class="individual-photo" src="${placeholderImage}" title = "no image" alt="placeholder image" width="160" />
</#if>
<img class="individual-photo" src="${placeholderImage}" title = "no image" alt="placeholder image" width="160" />
</#if>
</#if>
</#macro>