[VIVO-1115] Add AltMetric embed code

This commit is contained in:
grahamtriggs 2015-10-22 15:27:31 +01:00
parent 349bd4a847
commit 5b0fc96cf4
3 changed files with 71 additions and 0 deletions

View file

@ -217,6 +217,34 @@ VitroConnection.DataSource.validationQuery = SELECT 1
# OTHER OPTIONS
# -----------------------------------------------------------------------------
# AltMetric badges
# ----------------
# Options to embed AltMetric badges on information resource (e.g. journal article) pages
# See the AltMetric documentation for more imformation about each option: http://api.altmetric.com/embeds.html
# The embed code will use a DOI, or PubMed ID, if present
# Enable AltMetric badges
resource.altmetric=enabled
# Display the badge to the left or right of the title (default = right)
# Options: left, right
#resource.altmetric.displayto=right
# Badge type to display (default = donut)
# Options: See AltMetric documentation - recommended settings: donut, medium-donut
#resource.altmetric.badge-type=donut
# Hide the badge if there are no mentions (default = true)
# Options: true, false
#resource.altmetric.hide-no-mentions=true
# Display more details about the score when you hover over the badge (default = right)
# Options, right, left, up, down
#resource.altmetric.badge-popover=right
# Dsiplay extended details alongside the badge (default = none)
#resource.altmetric.badge-details=right
#
# When the following flag is set to enabled, the VIVO home page displays a
# global map highlighting the geographical focus of foaf:person individuals.

View file

@ -5,6 +5,10 @@
<#include "individual-setup.ftl">
<#import "lib-vivo-properties.ftl" as vp>
<#assign individualProductExtensionPreHeader>
<#include "individual-altmetric.ftl">
</#assign>
<#assign individualProductExtension>
<#-- Include for any class specific template additions -->
${classSpecificExtension!}
@ -39,3 +43,4 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/indi
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/individual/individualUtils.js"></script>')}
${scripts.add('<script type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>')}

View file

@ -0,0 +1,38 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Overview on individual profile page -->
<#if altmetricEnabled??>
<#assign doi = propertyGroups.getProperty("http://purl.org/ontology/bibo/doi")!>
<#if doi?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
<#if doi.statements[0]??>
<div class="individual-altmetric-badge">
<div class="altmetric-embed"
style="float: ${altmetricDisplayTo}; padding-left: 15px; padding-right: 15px;"
data-badge-type="${altmetricBadgeType}"
<#if altmetricPopover??>data-badge-popover="${altmetricPopover}"</#if>
<#if altmetricDetails??>data-badge-details="${altmetricDetails}"</#if>
<#if altmetricHideEmpty??>data-hide-no-mentions="true"</#if>
data-link-target="_blank"
data-doi="${doi.statements[0].value}">
</div>
</div>
</#if>
<#else>
<#assign pmid = propertyGroups.getProperty("http://purl.org/ontology/bibo/pmid")!>
<#if pmid?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
<#if pmid.statements[0]??>
<div class="individual-altmetric-badge">
<div class="altmetric-embed"
style="float: ${altmetricDisplayTo}; padding-left: 15px; padding-right: 15px;"
data-badge-type="${altmetricBadgeType}"
<#if altmetricPopover??>data-badge-popover="${altmetricPopover}"</#if>
<#if altmetricDetails??>data-badge-details="${altmetricDetails}"</#if>
<#if altmetricHideEmpty??>data-hide-no-mentions="true"</#if>
data-link-target="_blank"
data-pmid="${pmid.statements[0].value}"></div>
</div>
</#if>
</#if>
</#if>
</#if>