NIHVIVO-1332 Modifications to controller, template models, and templates for editing controls

This commit is contained in:
rjy7 2011-01-11 17:03:52 +00:00
parent e13564c983
commit 3451bb4786
14 changed files with 103 additions and 98 deletions

View file

@ -1,21 +1,13 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for individual profile page -->
<#-- Generic template for individual profile page -->
<#import "lib-list.ftl" as l>
<#import "lib-properties.ftl" as p>
<#assign core = "http://vivoweb.org/ontology/core#">
<#include "individual-setup.ftl">
<#assign editingClass>
<#if editStatus.showEditingLinks>editing<#else></#if>
</#assign>
<#if editStatus.showAdminPanel>
<#if individual.showAdminPanel>
<#include "individual-adminPanel.ftl">
</#if>
<#assign propertyGroups = individual.propertyList>
<section id="individual-intro" class="vcard" role="region">
<section id="share-contact" role="region">
<#-- Thumbnail -->
@ -48,6 +40,7 @@
<#assign overview = propertyGroups.getPropertyAndRemoveFromList("${core}overview")!>
<#if overview?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
<#list overview.statements as statement>
<@p.editingLinks statement showEditingLinks />
<p class="individual-overview">${statement.value}</p>
</#list>
</#if>
@ -87,8 +80,9 @@
</section>
</section>
<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl -->
<#-- Property group menu -->
<#assign nameForOtherGroup = "other">
<#include "individual-propertyGroupMenu.ftl">
<#-- Ontology properties -->

View file

@ -30,13 +30,13 @@
<ul class="property-list" role="list">
<#-- data property -->
<#if property.type == "data">
<@p.dataPropertyList property.statements />
<@p.dataPropertyList property.statements showEditingLinks />
<#-- object property -->
<#elseif property.collatedBySubclass> <#-- collated -->
<@p.collatedObjectPropertyList property />
<@p.collatedObjectPropertyList property showEditingLinks />
<#else> <#-- uncollated -->
<@p.objectPropertyList property.statements property.template />
<@p.objectPropertyList property.statements property.template showEditingLinks />
</#if>
</ul>
</article> <!-- end property -->

View file

@ -4,56 +4,58 @@
Macros for generating property lists
------------------------------------------------------------------------------>
<#macro dataPropertyList statements>
<#macro dataPropertyList statements showEditingLinks>
<#list statements as statement>
<@propertyListItem statement>${statement.value}</@propertyListItem>
<@propertyListItem statement showEditingLinks>${statement.value}</@propertyListItem>
</#list>
</#macro>
<#macro collatedObjectPropertyList property>
<#macro collatedObjectPropertyList property showEditingLinks>
<#assign subclasses = property.subclasses>
<#list subclasses?keys as subclass>
<li class="subclass">
<h3>${subclass?lower_case}</h3>
<ul class="subclass-property-list">
<@objectPropertyList subclasses[subclass] property.template />
<@objectPropertyList subclasses[subclass] property.template showEditingLinks />
</ul>
</li>
</#list>
</#macro>
<#macro simpleObjectPropertyList property>
<@objectPropertyList property.statements "propStatement-simple.ftl" />
<#macro simpleObjectPropertyList property showEditingLinks>
<@objectPropertyList property.statements "propStatement-simple.ftl" showEditingLinks />
</#macro>
<#macro objectPropertyList statements template>
<#macro objectPropertyList statements template showEditingLinks>
<#list statements as statement>
<@propertyListItem statement><#include "${template}"></@propertyListItem>
<@propertyListItem statement showEditingLinks><#include "${template}"></@propertyListItem>
</#list>
</#macro>
<#macro propertyListItem statement>
<#macro propertyListItem statement showEditingLinks>
<li role="listitem">
<@editLink statement />
<@deleteLink statement />
<@editingLinks statement showEditingLinks />
<#nested>
</li>
</#macro>
<#macro editLink statement>
<#if editStatus.showEditingLinks>
<#local url = statement.editUrl>
<#if url?has_content>
<a href="${url}">edit</a>
</#if>
<#macro editingLinks statement showEditingLinks>
<#if showEditingLinks>
<@editLink statement />
<@deleteLink statement />
</#if>
</#macro>
<#macro deleteLink statement>
<#if editStatus.showEditingLinks>
<#local url = statement.deleteUrl>
<#if url?has_content>
<a href="${url}">delete</a>
</#if>
<#macro editLink statement>
<#local url = statement.editUrl>
<#if url?has_content>
<a href="${url}">edit</a>
</#if>
</#macro>
<#macro deleteLink statement>
<#local url = statement.deleteUrl>
<#if url?has_content>
<a href="${url}">delete</a>
</#if>
</#macro>