NIHVIVO-1678 Updated menupage templates to handle VClasses with zero individuals.

This commit is contained in:
nac26 2011-01-13 00:40:19 +00:00
parent 00691d1d40
commit 8e24bb1350
2 changed files with 16 additions and 2 deletions

View file

@ -9,12 +9,23 @@ instead of the full URL of the requested page? Chintan was also asking for a
template variable with the domain name for an AJAX request with visualizations.
------------------------------------------------------------------------------------>
<#assign domainName = requestedPage?substring(0, requestedPage?index_of("/", 7)) />
<#list vClassGroup as vClass>
<#if (vClass.entityCount > 0)>
<#assign firstNonEmptyVClass = vClass.URI />
<#break>
</#if>
<#-- test if we're at the last class. If we've gotten this far, none of the classes have any individuals -->
<#if !vClass_has_next>
<#assign firstNonEmptyVClass = "false">
</#if>
</#list>
<script type="text/javascript">
var menupageData = {
baseUrl: '${domainName + urls.base}',
dataServiceUrl: '${domainName + urls.base}/dataservice?getLuceneIndividualsByVClass=1&vclassId=',
defaultBrowseVClassUri: '${vClassGroup[0].URI}'
defaultBrowseVClassUri: '${firstNonEmptyVClass}'
};
</script>

View file

@ -5,7 +5,10 @@
<nav role="navigation">
<ul id="vgraph-childClasses" role="list">
<#list vClassGroup as vClass>
<li role="listitem"><a href="#browse-by" title="Browse all people in this class" data-uri="${vClass.URI}">${vClass.name} <span class="count-classes">(${vClass.entityCount})</span></a></li>
<#-- Only display vClasses with individuals -->
<#if (vClass.entityCount > 0)>
<li role="listitem"><a href="#browse-by" title="Browse all people in this class" data-uri="${vClass.URI}">${vClass.name} <span class="count-classes">(${vClass.entityCount})</span></a></li>
</#if>
</#list>
</ul>
</nav>