From 5030119bae29b520599b27f6b3caf6006df781b9 Mon Sep 17 00:00:00 2001 From: nac26 Date: Thu, 6 Jan 2011 03:05:05 +0000 Subject: [PATCH] My changes from r1974 were lost but the publication(s) malarkey is squashed once again --- .../personPublicationSparklineContent.ftl | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl b/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl index 27d64f52..11ee9bbe 100644 --- a/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl +++ b/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl @@ -69,7 +69,15 @@ renderedShortSparks += data.getValue(value, 1); }); - $('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearPublications})).css("font-weight", "bold").attr("class", "grey").append(" publication(s)
"); + var totalPubs = parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearPublications}); + + if ( totalPubs > 1 ) { + var pubDisplay = "publications"; + } else { + var pubDisplay = "publication"; + } + + $('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append(" "+ pubDisplay +"
"); var sparksText = ' within the last 10 years'; @@ -80,7 +88,15 @@ * any year associated with it. Hence. * */ var renderedSparks = ${sparklineVO.renderedSparks}; - $('#${sparklineContainerID} td.sparkline_number').text(parseInt(renderedSparks) + parseInt(${sparklineVO.unknownYearPublications})).css("font-weight", "bold").attr("class", "grey").append(" publication(s)
"); + var totalPubs = parseInt(renderedSparks) + parseInt(${sparklineVO.unkownYearPublications}); + + if ( totalPubs > 1 ) { + var pubDisplay = "publications"; + } else { + var pubDisplay = "publication"; + } + + $('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append(" "+ pubDisplay +"
"); var sparksText = ' from ${sparklineVO.earliestYearConsidered?c}' + ' to ${sparklineVO.latestRenderedPublicationYear?c} '