Changes for NIHVIVO-3629: removing spaces in the href links and ids for property groups and replacing them with underscores.

This commit is contained in:
hjkhjk54 2012-02-23 18:15:04 +00:00
parent 10908a7a65
commit c4091eaa1f
3 changed files with 11 additions and 3 deletions

View file

@ -16,7 +16,9 @@
<#-- Display the group heading --> <#-- Display the group heading -->
<#if groupName?has_content> <#if groupName?has_content>
<h2 id="${groupName}">${groupName?capitalize}</h2> <#--the function replaces spaces in the name with underscores, also called for the property group menu-->
<#assign groupNameHtmlId = p.createPropertyGroupHtmlId(groupName) >
<h2 id="${groupNameHtmlId}">${groupName?capitalize}</h2>
<#else> <#else>
<h2 id="properties">Properties</h2> <h2 id="properties">Properties</h2>
</#if> </#if>

View file

@ -12,11 +12,13 @@
<nav id="property-group-menu" role="navigation"> <nav id="property-group-menu" role="navigation">
<ul role="list"> <ul role="list">
<#list groups as group> <#list groups as group>
<#assign groupname = group.getName(nameForOtherGroup)> <#assign groupname = group.getName(nameForOtherGroup)>
<#if groupname?has_content> <#if groupname?has_content>
<#--create property group html id is the function that will replace all spaces with underscore to make a valid id-->
<#assign groupnameHtmlId = p.createPropertyGroupHtmlId(groupname) >
<#-- capitalize will capitalize each word in the name; cap_first only the first. We may need a custom <#-- 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. --> function to capitalize all except function words. -->
<li role="listitem"><a href="#${groupname}" title="group name">${groupname?capitalize}</a></li> <li role="listitem"><a href="#${groupnameHtmlId}" title="group name">${groupname?capitalize}</a></li>
</#if> </#if>
</#list> </#list>
</ul> </ul>

View file

@ -228,4 +228,8 @@ name will be used as the label. -->
</#list> </#list>
</#macro> </#macro>
<#--Property group names may have spaces in them, replace spaces with underscores for html id/hash-->
<#function createPropertyGroupHtmlId propertyGroupName>
<#return propertyGroupName?replace(" ", "_")>
</#function>