additional home page redesign changes
This commit is contained in:
parent
94e23fef67
commit
af4f84759c
6 changed files with 221 additions and 166 deletions
|
@ -8,13 +8,13 @@
|
|||
@prefix vivoweb: <http://vivoweb.org/ontology#> .
|
||||
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
||||
|
||||
# research facility datagetter
|
||||
# academic departments datagetter
|
||||
|
||||
<freemarker:researchFacilities.ftl> display:hasDataGetter display:researchFacsDataGetter .
|
||||
<freemarker:lib-home-page.ftl> display:hasDataGetter display:academicDeptsDataGetter .
|
||||
|
||||
display:researchFacsDataGetter
|
||||
display:academicDeptsDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
|
||||
display:saveToVar "researchFacsDG" ;
|
||||
display:saveToVar "academicDeptDG" ;
|
||||
display:query """
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
|
|
|
@ -310,8 +310,18 @@ $(document).ready(function(){
|
|||
action: "getGeoFocusLocations",
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
var results = $.parseJSON(xhr.responseText);
|
||||
|
||||
var results = $.parseJSON(xhr.responseText);
|
||||
if ( results.length == 0 ) {
|
||||
var html = "There are currently no researchers with a defined geographic focus.";
|
||||
$('section#home-geo-focus div#timeIndicator span').html(html);
|
||||
$('section#home-geo-focus').css("height","175px");
|
||||
$('section#home-geo-focus div#timeIndicator').css("margin-top","50px");
|
||||
$('section#home-geo-focus div#mapGlobal').hide();
|
||||
$('section#home-geo-focus div#mapUS').hide();
|
||||
$('section#home-geo-focus div#mapState').hide();
|
||||
}
|
||||
else {
|
||||
$.each(results, function() {
|
||||
var locale = this.properties.popupContent;
|
||||
this.geometry.coordinates = getLatLong(locale);
|
||||
|
@ -321,6 +331,7 @@ $(document).ready(function(){
|
|||
buildGlobalMap();
|
||||
$('div#timeIndicator').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
$.extend(this, urlsBase);
|
||||
// $.extend(this, facultyMemberCount);
|
||||
$.extend(this, facultyMemberCount);
|
||||
|
||||
// this will ensure that the hidden classgroup input is cleared if the back button is used
|
||||
// to return to th ehome page from the search results
|
||||
$('input[name="classgroup"]').val("");
|
||||
|
||||
getFacultyMembers();
|
||||
buildAcademicDepartments();
|
||||
|
@ -13,7 +17,8 @@ $(document).ready(function(){
|
|||
}
|
||||
|
||||
function getFacultyMembers() {
|
||||
|
||||
var individualList = "";
|
||||
if ( facultyMemberCount > 0 ) {
|
||||
// determine the row at which to start the solr query
|
||||
var rowStart = Math.floor((Math.random()*facultyMemberCount)+1)-1;
|
||||
var diff;
|
||||
|
@ -35,9 +40,9 @@ $(document).ready(function(){
|
|||
url += "&page=" + rowStart + "&pageSize=" + pageSize;
|
||||
|
||||
$.getJSON(url, function(results) {
|
||||
var individualList = "";
|
||||
|
||||
if ( results == null || results.individuals.length == 0 ) {
|
||||
individualList = "<p><li>No faculty records found.</li></p>";
|
||||
individualList = "<p><li>No faculty members found.</li></p>";
|
||||
$('div#tempSpacing').hide();
|
||||
$('div#research-faculty-mbrs ul#facultyThumbs').append(individualList);
|
||||
}
|
||||
|
@ -69,6 +74,13 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
individualList = "<p><li>No faculty members found.</li></p>";
|
||||
$('div#tempSpacing').hide();
|
||||
$('div#research-faculty-mbrs ul#facultyThumbs').append(individualList);
|
||||
$('div#research-faculty-mbrs ul#facultyThumbs').css("padding", "1.0em 0 0.825em 0.75em");
|
||||
}
|
||||
}
|
||||
|
||||
function adjustImageHeight(theImg) {
|
||||
$img = theImg;
|
||||
|
@ -87,7 +99,7 @@ $(document).ready(function(){
|
|||
var index = Math.floor((Math.random()*deptNbr)+1)-1;
|
||||
|
||||
if ( deptNbr == 0 ) {
|
||||
html += "<p><li>No academic departments found.</li></p>";
|
||||
html = "<ul style='list-style:none'><p><li style='padding-top:0.3em'>No academic departments found.</li></p></ul>";
|
||||
}
|
||||
else if ( deptNbr > 6 ) {
|
||||
for ( var i=0;i<6;i++) {
|
||||
|
|
|
@ -12,6 +12,20 @@
|
|||
</#list>
|
||||
</#macro>
|
||||
|
||||
<#-- 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" >
|
||||
<h4>Faculty</h4>
|
||||
<div id="tempSpacing"> </div>
|
||||
<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 solr query -->
|
||||
<#macro facultyMemberCount classGroups>
|
||||
<#assign foundClassGroup = false />
|
||||
|
@ -39,23 +53,21 @@
|
|||
<#-- Loop through classGroups first so we can account for situations when all class groups are empty -->
|
||||
<#assign selected = 'class="selected" ' />
|
||||
<#assign classGroupList>
|
||||
<section id="home-stats" class="home-sections" >
|
||||
<h4>Statistics</h4>
|
||||
<ul id="stats">
|
||||
<#assign groupCount = 1>
|
||||
<#list classGroups as group>
|
||||
<#if (groupCount > 6) >
|
||||
<#break/>
|
||||
</#if>
|
||||
<#-- 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>
|
||||
<#-- Determine the active (selected) group -->
|
||||
<#assign activeGroup = "" />
|
||||
<#if !classGroup??>
|
||||
<#if group_index == 0>
|
||||
<#assign activeGroup = selected />
|
||||
</#if>
|
||||
<#elseif classGroup.uri == group.uri>
|
||||
<#assign activeGroup = selected />
|
||||
</#if>
|
||||
<#if group.displayName != "equipment" && group.displayName != "locations" && group.displayName != "courses" >
|
||||
<#if group.displayName != "equipment" && group.displayName != "courses" >
|
||||
<li>
|
||||
<a href="#">
|
||||
<p class="stats-count">
|
||||
|
@ -72,16 +84,20 @@
|
|||
<p class="stats-type">${group.displayName?capitalize}</p>
|
||||
</a>
|
||||
</li>
|
||||
<#assign groupCount = groupCount + 1>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
</#list>
|
||||
</ul>
|
||||
</section>
|
||||
</#assign>
|
||||
|
||||
<#-- Display the class group browse only if we have at least one populated class group -->
|
||||
<#if firstPopulatedClassGroup??>
|
||||
${classGroupList}
|
||||
<#else>
|
||||
<h3>There is currently no content in the system, or you need to create class groups and assign your classes to them.</h3>
|
||||
<h3 id="noContentMsg">There is currently no content in the system, or you need to create class groups and assign your classes to them.</h3>
|
||||
|
||||
<#if user.loggedIn>
|
||||
<#if user.hasSiteAdminAccess>
|
||||
|
@ -97,6 +113,9 @@
|
|||
<#-- builds the "research" box on the home page -->
|
||||
<#macro researchClasses classGroups=vClassGroups>
|
||||
<#assign foundClassGroup = false />
|
||||
<section id="home-research" class="home-sections">
|
||||
<h4>Research</h4>
|
||||
<ul>
|
||||
<#list classGroups as group>
|
||||
<#if (group.individualCount > 0) && group.displayName == "research" >
|
||||
<#assign foundClassGroup = true />
|
||||
|
@ -109,12 +128,24 @@
|
|||
</#if>
|
||||
</#list>
|
||||
<#if !foundClassGroup>
|
||||
<p><li>No research records found.</li></p>
|
||||
<p><li>No research content found.</li></p>
|
||||
</#if>
|
||||
</ul>
|
||||
</section>
|
||||
</#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">
|
||||
<h4>Departments</h4>
|
||||
<div id="academic-depts">
|
||||
</div>
|
||||
</section>
|
||||
</#macro>
|
||||
|
||||
<#-- builds the "academic departments" box on the home page -->
|
||||
<#macro academicDepartments>
|
||||
<#macro listAcademicDepartments>
|
||||
<script>
|
||||
var academicDepartments = [
|
||||
<#if academicDeptDG?has_content>
|
||||
|
@ -129,3 +160,33 @@ var academicDepartments = [
|
|||
var urlsBase = "${urls.base}";
|
||||
</script>
|
||||
</#macro>
|
||||
|
||||
<#-- 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">
|
||||
<h4>Geographic Focus</h4>
|
||||
<#-- 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:">Global Research</a> |
|
||||
<a id="usLink" href="javascript:">US Research</a> |
|
||||
<a id="stateLink" href="javascript:">State-wide Research</a>
|
||||
</div>
|
||||
-->
|
||||
<div id="researcherTotal"></div>
|
||||
<div id="timeIndicator">
|
||||
<span>Loading map information . . .
|
||||
<img src="${urls.images}/indicatorWhite.gif">
|
||||
</span>
|
||||
</div>
|
||||
<div id="mapGlobal" class="mapArea"></div>
|
||||
<#--
|
||||
<div id="mapUS" class="mapArea"></div>
|
||||
<div id="mapState" class="mapArea"></div>
|
||||
-->
|
||||
</section>
|
||||
</#macro>
|
|
@ -62,7 +62,6 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
|
|||
try {
|
||||
geoLocations = getGeoLocations(vreq);
|
||||
|
||||
// String response = "{\"type\": \"FeatureCollection\",\"features\": [";
|
||||
String response = "[";
|
||||
String geometry = "{\"geometry\": {\"type\": \"Point\",\"coordinates\": \"\"},";
|
||||
String typeProps = "\"type\": \"Feature\",\"properties\": {\"mapType\": \"\",";
|
||||
|
@ -71,11 +70,14 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
|
|||
for (Map<String, String> map: geoLocations) {
|
||||
String label = map.get("label");
|
||||
String html = map.get("count");
|
||||
String uri = UrlBuilder.urlEncode(map.get("location"));
|
||||
String uri = map.get("location");
|
||||
if ( uri != null ) {
|
||||
uri = UrlBuilder.urlEncode(uri);
|
||||
}
|
||||
Integer count = Integer.parseInt(map.get("count"));
|
||||
String radius = String.valueOf(calculateRadius(count));
|
||||
|
||||
if ( !label.equals(previousLabel) ) {
|
||||
if ( label != null && !label.equals(previousLabel) ) {
|
||||
String tempStr = geometry; //+label
|
||||
tempStr += typeProps //+ label
|
||||
+ "\"popupContent\": \""
|
||||
|
@ -91,7 +93,9 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
|
|||
previousLabel = label;
|
||||
}
|
||||
}
|
||||
if ( response.lastIndexOf(",") > 0 ) {
|
||||
response = response.substring(0, response.lastIndexOf(","));
|
||||
}
|
||||
response += " ]";
|
||||
log.debug(response);
|
||||
return response;
|
||||
|
|
|
@ -49,7 +49,9 @@
|
|||
<input type="hidden" name="classgroup" class="search-homepage" value="" autocapitalize="off" />
|
||||
</div>
|
||||
|
||||
<a class="filter-search filter-default" href="#" title="Filter search"><span class="displace">filter search</span></a>
|
||||
<a class="filter-search filter-default" href="#" title="Filter search">
|
||||
<span class="displace">filter search</span>
|
||||
</a>
|
||||
|
||||
<ul id="filter-search-nav">
|
||||
<li><a class="active" href="">All</a></li>
|
||||
|
@ -63,60 +65,25 @@
|
|||
|
||||
<@widget name="login" />
|
||||
|
||||
<section id="home-research" class="home-sections">
|
||||
<h4>Research</h4>
|
||||
<ul>
|
||||
<!-- List of research classes: e.g., articles, books, collections, conference papers -->
|
||||
<@lh.researchClasses />
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
<!-- List of four randomly selected faculty members -->
|
||||
<@lh.facultyMbrHtml />
|
||||
|
||||
<section id="home-faculty-mbrs" class="home-sections" >
|
||||
<h4>Faculty</h4>
|
||||
<div id="tempSpacing"> </div>
|
||||
<div id="research-faculty-mbrs">
|
||||
<!-- populated via an ajax call -->
|
||||
<ul id="facultyThumbs">
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="home-academic-depts" class="home-sections">
|
||||
<h4>Departments</h4>
|
||||
<div id="academic-depts"></div>
|
||||
</section>
|
||||
<!-- List of randomly selected academic departments -->
|
||||
<@lh.academicDeptsHtml />
|
||||
|
||||
<#if geoFocusMapsEnabled >
|
||||
<section id="home-geo-focus" class="home-sections">
|
||||
<h4>Geographic Focus</h4>
|
||||
<div id="mapControls">
|
||||
<a id="globalLink" class="selected" href="javascript:">Global Research</a> |
|
||||
<a id="usLink" href="javascript:">US Research</a> |
|
||||
<#-- <a id="stateLink" href="javascript:">NY Research</a> -->
|
||||
</div>
|
||||
<div id="researcherTotal"></div>
|
||||
<div id="timeIndicator">
|
||||
<span>Loading map information . . .
|
||||
<img src="${urls.images}/indicatorWhite.gif">
|
||||
</span>
|
||||
</div>
|
||||
<div id="mapGlobal" class="mapArea"></div>
|
||||
<div id="mapUS" class="mapArea"></div>
|
||||
<div id="mapState" class="mapArea"></div>
|
||||
</section>
|
||||
<!-- Map display of researchers' areas of geographic focus. Must be enabled in runtime.properties -->
|
||||
<@lh.geographicFocusHtml />
|
||||
</#if>
|
||||
|
||||
<section id="home-stats" class="home-sections" >
|
||||
<h4>Statistics</h4>
|
||||
|
||||
<ul id="stats">
|
||||
<!-- Statistical information relating to property groups and their classes; displayed horizontally, not vertically-->
|
||||
<@lh.allClassGroups vClassGroups! />
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<#include "footer.ftl">
|
||||
<#-- builds a json object that is used by js to render the academic departments section -->
|
||||
<@lh.academicDepartments />
|
||||
<@lh.listAcademicDepartments />
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue