1. Made changes so that on individual pages the div containers for network links & sparkline image/text is only generated if there is content to be shown. This as opposed to always creating it first, hiding it & then shoing the container if there was any content.
2. Made sure that network link DIVs are separated by border & padding only if there is need. Now if a person only has grants, on it's profile page there is no longer border & padding on top of the co-investiogator link.
This commit is contained in:
parent
5ee4bf2ac6
commit
5cacc57292
6 changed files with 179 additions and 185 deletions
|
@ -92,6 +92,7 @@ p.datatable {
|
|||
.toggle_visualization {
|
||||
max-width: 180px;
|
||||
float:right;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#grant-count-sparkline-include,
|
||||
|
|
|
@ -48,11 +48,13 @@ span.incomplete-data-holder,
|
|||
}
|
||||
|
||||
.collaboratorship-link-container {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.collaboratorship-link-separator {
|
||||
margin-top: 20px;
|
||||
display: none;
|
||||
border-top: 1px dotted #A6B1B0;
|
||||
padding-top: 20px;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.sparkline_text {
|
||||
|
|
|
@ -21,10 +21,6 @@ var visualization = {
|
|||
if ($.trim(data) != "") {
|
||||
containerCoAuthor.html(data);
|
||||
containerCoAuthor.children("#pub_count_short_sparkline_vis");
|
||||
|
||||
/* Since there are publications there are chances that there will be co-authors as well, so show the
|
||||
* co-author network icon.*/
|
||||
$("#coauthorship_link_container").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,42 +3,43 @@
|
|||
<#-- Template for sparkline visualization on individual profile page -->
|
||||
|
||||
<#-- Determine whether this person is an author -->
|
||||
<#assign authorship = propertyGroups.getProperty("${core}authorInAuthorship")!false>
|
||||
<#assign authorship = propertyGroups.getProperty("${core}authorInAuthorship")!>
|
||||
<#assign isAuthor = p.hasStatements(authorship)!false />
|
||||
<#-- Uncomment the following line for a quick confirmation on Publications logic -->
|
||||
<#-- <h1>Publications? <#if isAuthor>Ding Ding Ding!<#else>Wah Wuh!</#if></h1> -->
|
||||
|
||||
<#-- Determine whether this person is involved in any grants -->
|
||||
<#assign investigatorRole = propertyGroups.getProperty("${core}hasInvestigatorRole")!false>
|
||||
<#assign piRole = propertyGroups.getProperty("${core}hasPrincipalInvestigatorRole")!false>
|
||||
<#assign coPiRole = propertyGroups.getProperty("${core}hasCo-PrincipalInvestigatorRole")!false>
|
||||
<#if ( p.hasStatements(investigatorRole) || p.hasStatements(piRole) || p.hasStatements(coPiRole) )>
|
||||
<#assign investigatorRole = propertyGroups.getProperty("${core}hasInvestigatorRole")!>
|
||||
<#assign piRole = propertyGroups.getProperty("${core}hasPrincipalInvestigatorRole")!>
|
||||
<#assign coPiRole = propertyGroups.getProperty("${core}hasCo-PrincipalInvestigatorRole")!>
|
||||
<#if (p.hasStatements(investigatorRole) || p.hasStatements(piRole) || p.hasStatements(coPiRole))>
|
||||
<#assign isInvestigator = true />
|
||||
<#else>
|
||||
<#assign isInvestigator = false />
|
||||
</#if>
|
||||
<#-- Uncomment the following line for a quick confirmation on Grants logic -->
|
||||
<#-- <h1>Grants? <#if isInvestigator>Ding Ding Ding!<#else>Wah Wuh!</#if></h1> -->
|
||||
|
||||
<#-- NO LONGER NEEDED! GET RID OF THIS AND ANY OTHER VIVO REFERENCE IN IndividualTemplateModel.java -->
|
||||
<#-- <#if individual.visualizationUrl??> -->
|
||||
<#assign coAuthorIcon = '${urls.images}/visualization/co_author_icon.png'>
|
||||
<#assign coInvestigatorIcon = '${urls.images}/visualization/co_investigator_icon.png'>
|
||||
<#assign informationIcon = '${urls.images}/iconInfo.gif'>
|
||||
<#assign standardVisualizationURLRoot ="/visualization">
|
||||
<#assign googleJSAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D'>
|
||||
<#assign coAuthorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=coauthor'>
|
||||
<#assign coInvestigatorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=copi'>
|
||||
<#assign visualizationHelperJavaScript = 'js/visualization/visualization-helper-functions.js'>
|
||||
|
||||
<#if (isAuthor || isInvestigator)>
|
||||
<#assign coAuthorIcon = '${urls.images}/visualization/co_author_icon.png'>
|
||||
<#assign coInvestigatorIcon = '${urls.images}/visualization/co_investigator_icon.png'>
|
||||
<#assign informationIcon = '${urls.images}/iconInfo.gif'>
|
||||
<#assign standardVisualizationURLRoot ="/visualization">
|
||||
<#assign googleJSAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D'>
|
||||
<#assign coAuthorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=coauthor'>
|
||||
<#assign coInvestigatorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=copi'>
|
||||
<#assign visualizationHelperJavaScript = 'js/visualization/visualization-helper-functions.js'>
|
||||
|
||||
<section id="sparklines-publications" role="region">
|
||||
${stylesheets.add("css/visualization/visualization.css")}
|
||||
|
||||
<img class="infoIcon" src="${informationIcon}" alt="information icon" title="The publication information may be incomplete" />
|
||||
|
||||
<section id="visualization-container" role="region">
|
||||
|
||||
<#if isAuthor>
|
||||
|
||||
<img class="infoIcon" src="${informationIcon}" alt="information icon." title="The publication and grant information may be incomplete." width="20px" height="21px" />
|
||||
|
||||
<div id="vis_container_coauthor"> </div>
|
||||
|
||||
<div class="collaboratorship-link-separator"></div>
|
||||
|
||||
<div id="coauthorship_link_container" class="collaboratorship-link-container">
|
||||
<div class="collaboratorship-icon">
|
||||
<a href="${coAuthorURL}"><img src="${coAuthorIcon}" alt="Co-author Network icon" width="30px" height="30px" /></a>
|
||||
|
@ -46,14 +47,6 @@
|
|||
<div class="collaboratorship-link"><a href="${coAuthorURL}">Co-Author Network</a></div>
|
||||
</div>
|
||||
|
||||
<div id="coinvestigator_link_container" class="collaboratorship-link-container">
|
||||
<div class="collaboratorship-icon">
|
||||
<a href="${coInvestigatorURL}"><img src="${coInvestigatorIcon}" alt="Co-investigator Network icon" width="30px" height="30px" /></a>
|
||||
</div>
|
||||
<div class="collaboratorship-link"><a href="${coInvestigatorURL}">Co-Investigator Network</a></div>
|
||||
</div>
|
||||
|
||||
${stylesheets.add("css/visualization/visualization.css")}
|
||||
${scripts.add(googleJSAPI)}
|
||||
${scripts.add(visualizationHelperJavaScript)}
|
||||
${scripts.add("/js/visualization/sparkline.js")}
|
||||
|
@ -61,23 +54,25 @@
|
|||
<#-- Aside from the variable declarations, this should be moved to an external js file -->
|
||||
<script type="text/javascript">
|
||||
var visualizationUrl = '${individual.visualizationUrl}';
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: "${urls.base}/visualizationAjax",
|
||||
data: ({vis: "utilities", vis_mode: "SHOW_GRANTS_LINK", uri: '${individual.uri}'}),
|
||||
dataType: "json",
|
||||
success:function(data){
|
||||
/*
|
||||
Collaboratorship links do not show up by default. They should show up only if there any data to
|
||||
show on that page.
|
||||
*/
|
||||
if (data.numOfGrants !== undefined && data.numOfGrants > 0) {
|
||||
$("#coinvestigator_link_container").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<#if isInvestigator>
|
||||
<div class="collaboratorship-link-separator"></div>
|
||||
</#if>
|
||||
|
||||
</#if>
|
||||
|
||||
<#if isInvestigator>
|
||||
|
||||
<div id="coinvestigator_link_container" class="collaboratorship-link-container">
|
||||
<div class="collaboratorship-icon">
|
||||
<a href="${coInvestigatorURL}"><img src="${coInvestigatorIcon}" alt="Co-investigator Network icon" width="30px" height="30px" /></a>
|
||||
</div>
|
||||
<div class="collaboratorship-link"><a href="${coInvestigatorURL}">Co-Investigator Network</a></div>
|
||||
</div>
|
||||
|
||||
</#if>
|
||||
|
||||
</section>
|
||||
|
||||
</#if>
|
|
@ -97,7 +97,7 @@ $(document).ready(function(){
|
|||
show on that page.
|
||||
*/
|
||||
if (data.numOfGrants !== undefined && data.numOfGrants > 0) {
|
||||
$("#coinvestigator_link_container").show();
|
||||
$(".toggle_visualization").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ $(document).ready(function(){
|
|||
show on that page.
|
||||
*/
|
||||
if (data.numOfPublications !== undefined && data.numOfPublications > 0) {
|
||||
$("#coauthorship_link_container").show();
|
||||
$(".toggle_visualization").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue