Moved property group menu to a separate template. Some code cleanup.

This commit is contained in:
rjy7 2010-12-17 19:08:03 +00:00
parent 9118452d4f
commit 758c8761ea
4 changed files with 22 additions and 22 deletions

View file

@ -17,8 +17,7 @@ public abstract class BaseObjectPropertyDataPreprocessor implements
this.objectPropertyTemplateModel = optm; this.objectPropertyTemplateModel = optm;
this.wdf = wdf; this.wdf = wdf;
} }
@Override @Override
public void process(List<Map<String, String>> data) { public void process(List<Map<String, String>> data) {
for (Map<String, String> map : data) { for (Map<String, String> map : data) {

View file

@ -25,12 +25,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
private static final Log log = LogFactory.getLog(ObjectPropertyTemplateModel.class); private static final Log log = LogFactory.getLog(ObjectPropertyTemplateModel.class);
private static final String TYPE = "object"; private static final String TYPE = "object";
/* NB The default preprocessor is not the same as the preprocessor for the default view. The latter
* actually defines its own preprocessor, whereas the default preprocessor is used for custom views
* that don't define a preprocessor.
*/
private static final String DEFAULT_PREPROCESSOR =
"edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseObjectPropertyDataPreprocessor";
private PropertyListConfig config; private PropertyListConfig config;

View file

@ -56,13 +56,13 @@
<p><a href="${relatedSubject.url}">&larr; return to ${relatedSubject.name}</a></p> <p><a href="${relatedSubject.url}">&larr; return to ${relatedSubject.name}</a></p>
<#else> <#else>
<#-- Label --> <#-- Label -->
<h1 class="fn">${individual.name} <h1 class="fn">${individual.name}
<#-- Moniker --> <#-- Moniker -->
<#if individual.moniker?has_content> <#if individual.moniker?has_content>
<span class="preferred-title">${individual.moniker}</span> <span class="preferred-title">${individual.moniker}</span>
</#if> </#if>
</h1> </h1>
</#if> </#if>
<h2>Current Positions</h2> <h2>Current Positions</h2>
@ -114,19 +114,9 @@
</section> </section>
</section> </section>
<#-- Property group menu -->
<#assign nameForOtherGroup = "other"> <#assign nameForOtherGroup = "other">
<nav id="property-group-menus" role="navigation"> <#include "individual-propertyGroupMenu.ftl">
<ul role="list">
<#list propertyGroups as group>
<#assign groupname = group.name(nameForOtherGroup)>
<#if groupname?has_content>
<#-- capitalize will capitalize each word in the name; cap_first only the first. We may need a custom
function to capitalize all except function words. -->
<li role="listitem"><a href="#${groupname}">${groupname?capitalize}</a></li>
</#if>
</#list>
</ul>
</nav>
<#-- Ontology properties --> <#-- Ontology properties -->
<#include "individual-properties.ftl"> <#include "individual-properties.ftl">

View file

@ -0,0 +1,17 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for property group menu on individual profile page -->
<#assign nameForOtherGroup = nameForOtherGroup!"other">
<nav id="property-group-menus" role="navigation">
<ul role="list">
<#list propertyGroups as group>
<#assign groupname = group.name(nameForOtherGroup)>
<#if groupname?has_content>
<#-- capitalize will capitalize each word in the name; cap_first only the first. We may need a custom
function to capitalize all except function words. -->
<li role="listitem"><a href="#${groupname}">${groupname?capitalize}</a></li>
</#if>
</#list>
</ul>
</nav>