vivo/productMods/templates/freemarker/lib/lib-home-page.ftl

205 lines
9.1 KiB
Text
Raw Normal View History

2013-04-30 14:46:22 -04:00
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Macros used to build the statistical information on the home page -->
<#-- Get the classgroups so they can be used to qualify searches -->
<#macro allClassGroupNames classGroups>
<#list classGroups as group>
<#-- Only display populated class groups -->
<#if (group.individualCount > 0)>
<li role="listitem"><a href="" title="${group.uri}">${group.displayName?capitalize}</a></li>
</#if>
</#list>
</#macro>
2013-05-02 12:34:18 -04:00
<#-- Renders the html for the faculty member section on the home page. -->
<#-- Works in conjunction with the homePageUtils.js file, which contains the ajax call. -->
<#macro facultyMbrHtml>
<section id="home-faculty-mbrs" class="home-sections" >
2013-05-31 11:56:18 -04:00
<h4>${i18n().faculty_capitalized}</h4>
<div id="tempSpacing">
2013-05-31 11:56:18 -04:00
<span>${i18n().loading_faculty}&nbsp;&nbsp;&nbsp;
<img src="${urls.images}/indicatorWhite.gif">
</span>
</div>
2013-05-02 12:34:18 -04:00
<div id="research-faculty-mbrs">
<!-- populated via an ajax call -->
<ul id="facultyThumbs">
</ul>
</div>
</section>
</#macro>
<#-- We need the faculty count in order to randomly select 4 faculty using a search query -->
2013-04-30 14:46:22 -04:00
<#macro facultyMemberCount classGroups>
<#assign foundClassGroup = false />
<#list classGroups as group>
<#if (group.individualCount > 0) && group.uri?contains("people") >
2013-04-30 14:46:22 -04:00
<#list group.classes as class>
<#if (class.uri?contains("FacultyMember")) >
2013-04-30 14:46:22 -04:00
<#assign foundClassGroup = true />
<#if (class.individualCount > 0) >
<script>var facultyMemberCount = ${class.individualCount?string?replace(",","")?replace(".","")};</script>
2013-04-30 14:46:22 -04:00
<#else>
<script>var facultyMemberCount = 0;</script>
</#if>
</#if>
</#list>
</#if>
</#list>
<#if !foundClassGroup>
<script>var facultyMemberCount = 0;</script>
</#if>
</#macro>
<#-- builds the "stats" section of the home page, i.e., class group counts -->
<#macro allClassGroups classGroups>
<#-- Loop through classGroups first so we can account for situations when all class groups are empty -->
<#assign selected = 'class="selected" ' />
<#assign classGroupList>
2013-05-02 12:34:18 -04:00
<section id="home-stats" class="home-sections" >
2013-05-31 11:56:18 -04:00
<h4>${i18n().statistics}</h4>
2013-05-02 12:34:18 -04:00
<ul id="stats">
<#assign groupCount = 1>
<#list classGroups as group>
<#if (groupCount > 6) >
<#break/>
2013-04-30 14:46:22 -04:00
</#if>
2013-05-02 12:34:18 -04:00
<#-- Only display populated class groups -->
<#if (group.individualCount > 0)>
<#-- Catch the first populated class group. Will be used later as the default selected class group -->
<#if !firstPopulatedClassGroup??>
<#assign firstPopulatedClassGroup = group />
</#if>
<#if !group.uri?contains("equipment") && !group.uri?contains("course") >
2013-05-02 12:34:18 -04:00
<li>
<a href="${urls.base}/browse">
2013-05-02 12:34:18 -04:00
<p class="stats-count">
<#if (group.individualCount > 10000) >
<#assign overTen = group.individualCount/1000>
${overTen?round}<span>k</span>
<#elseif (group.individualCount > 1000)>
<#assign underTen = group.individualCount/1000>
${underTen?string("0.#")}<span>k</span>
<#else>
${group.individualCount}<span>&nbsp;</span>
</#if>
</p>
<p class="stats-type">${group.displayName?capitalize}</p>
</a>
</li>
<#assign groupCount = groupCount + 1>
</#if>
</#if>
</#list>
</ul>
</section>
2013-04-30 14:46:22 -04:00
</#assign>
<#-- Display the class group browse only if we have at least one populated class group -->
<#if firstPopulatedClassGroup??>
${classGroupList}
<#else>
2013-05-31 11:56:18 -04:00
<h3 id="noContentMsg">${i18n().no_content_create_groups_classes}</h3>
2013-04-30 14:46:22 -04:00
<#if user.loggedIn>
<#if user.hasSiteAdminAccess>
2013-05-31 11:56:18 -04:00
<p>${i18n().you_can} <a href="${urls.siteAdmin}" title="${i18n().add_content_manage_site}">${i18n().add_content_manage_site}</a> ${i18n().from_site_admin_page}</p>
2013-04-30 14:46:22 -04:00
</#if>
<#else>
2013-05-31 11:56:18 -04:00
<p>${i18n().please} <a href="${urls.login}" title="${i18n().login_to_manage_site}">${i18n().log_in}</a> ${i18n().to_manage_content}</p>
2013-04-30 14:46:22 -04:00
</#if>
</#if>
</#macro>
2013-06-28 10:15:32 -04:00
<#-- Renders the html for the research section on the home page. -->
<#-- Works in conjunction with the homePageUtils.js file -->
2013-04-30 14:46:22 -04:00
<#macro researchClasses classGroups=vClassGroups>
2013-06-28 10:15:32 -04:00
<#assign foundClassGroup = false />
<section id="home-research" class="home-sections">
<h4>${i18n().research_capitalized}</h4>
<ul>
<#list classGroups as group>
2013-11-18 11:06:43 -05:00
<#if (group.individualCount > 0) && group.uri?contains("publications") >
2013-06-28 10:15:32 -04:00
<#assign foundClassGroup = true />
<#list group.classes as class>
2013-11-18 11:06:43 -05:00
<#if (class.individualCount > 0) && (class.uri?contains("AcademicArticle") || class.uri?contains("Book") || class.uri?contains("Chapter") ||class.uri?contains("ConferencePaper") || class.uri?contains("Grant") || class.uri?contains("Report")) >
2013-06-28 10:15:32 -04:00
<li role="listitem">
<span>${class.individualCount!}</span>&nbsp;
<a href='${urls.base}/individuallist?vclassId=${class.uri?replace("#","%23")!}'>
<#if class.name?substring(class.name?length-1) == "s">
${class.name}
<#else>
${class.name}s
</#if>
</a>
</li>
</#if>
</#list>
<li><a href="${urls.base}/research" alt="${i18n().view_all_research}">${i18n().view_all}</a></li>
2013-05-02 12:34:18 -04:00
</#if>
2013-06-28 10:15:32 -04:00
</#list>
<#if !foundClassGroup>
2013-12-06 12:25:36 -05:00
<p><li style="padding-left:1.2em">${i18n().no_research_content_found}</li></p>
2013-06-28 10:15:32 -04:00
</#if>
</ul>
</section>
2013-05-02 12:34:18 -04:00
</#macro>
<#-- Renders the html for the academic departments section on the home page. -->
<#-- Works in conjunction with the homePageUtils.js file -->
<#macro academicDeptsHtml>
<section id="home-academic-depts" class="home-sections">
2013-05-31 11:56:18 -04:00
<h4>${i18n().departments}</h4>
2013-05-02 12:34:18 -04:00
<div id="academic-depts">
</div>
</section>
2013-04-30 14:46:22 -04:00
</#macro>
<#-- builds the "academic departments" box on the home page -->
2013-05-02 12:34:18 -04:00
<#macro listAcademicDepartments>
2013-04-30 14:46:22 -04:00
<script>
var academicDepartments = [
<#if academicDeptDG?has_content>
<#list academicDeptDG as resultRow>
2013-06-28 10:15:32 -04:00
<#assign uri = resultRow["theURI"] />
2013-04-30 14:46:22 -04:00
<#assign label = resultRow["name"] />
{"uri": "${uri?url}", "name": "${label}"}<#if (resultRow_has_next)>,</#if>
2013-04-30 14:46:22 -04:00
</#list>
</#if>
];
var urlsBase = "${urls.base}";
</script>
</#macro>
2013-05-02 12:34:18 -04:00
<#-- renders the "geographic focus" section on the home page. works in -->
<#-- conjunction with the homePageMaps.js and latLongJson.js files, as well -->
<#-- as the leaflet javascript library. -->
<#macro geographicFocusHtml>
<section id="home-geo-focus" class="home-sections">
2013-05-31 11:56:18 -04:00
<h4>${i18n().geographic_focus}</h4>
2013-05-02 12:34:18 -04:00
<#-- map controls allow toggling between multiple map types: e.g., global, country, state/province. -->
<#-- VIVO default is for only a global display, though the javascript exists to support the other -->
<#-- types. See map documentation for additional information on how to implement additional types. -->
<#--
<div id="mapControls">
<a id="globalLink" class="selected" href="javascript:">${i18n().global_research}</a>&nbsp;|&nbsp;
<a id="countryLink" href="javascript:">${i18n().country_wide_research}</a>&nbsp;|&nbsp;
<a id="localLink" href="javascript:">${i18n().local_research}</a>
2013-05-02 12:34:18 -04:00
</div>
-->
<div id="researcherTotal"></div>
<div id="timeIndicatorGeo">
2013-05-31 11:56:18 -04:00
<span>${i18n().loading_map_information}&nbsp;&nbsp;&nbsp;
2013-05-02 12:34:18 -04:00
<img src="${urls.images}/indicatorWhite.gif">
</span>
</div>
<div id="mapGlobal" class="mapArea"></div>
<#--
<div id="mapCountry" class="mapArea"></div>
<div id="mapLocal" class="mapArea"></div>
-->
2013-05-02 12:34:18 -04:00
</section>
</#macro>