Added check for no data. When there is no content a message is displayed instead of rendering a blank index page.

This commit is contained in:
nac26 2011-01-16 23:13:06 +00:00
parent 12561a2d73
commit cbf08df272
2 changed files with 42 additions and 16 deletions

View file

@ -2,7 +2,10 @@
<#-- List class groups, and classes within each group. -->
<div class="siteMap">
<#include "classgroups-checkForData.ftl">
<#if (!noData)>
<div class="siteMap">
<#list classGroups as classGroup>
<#-- Only render classgroups that have at least one class with individuals -->
<#if (classGroup.individualCount > 0)>
@ -17,4 +20,7 @@
</ul>
</#if>
</#list>
</div>
</div>
<#else>
${noDataNotification}
</#if>

View file

@ -0,0 +1,20 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#list classGroups as classGroup>
<#assign populatedClassGroups = 0 />
<#-- Check to see if any of the class groups have individuals -->
<#if (classGroup.individualCount > 0)>
<#assign populatedClassGroups = populatedClassGroups + 1 />
</#if>
</#list>
<#if (populatedClassGroups == 0)>
<#assign noData = true />
<#else>
<#assign noData = false />
</#if>
<#assign noDataNotification>
<h3>There is currently no content in the system</h3>
<p>Please <a href="${urls.login}" title="log in to manage this site">login</a> to manage content.</p>
</#assign>