Microformat markup for Persons using schema.org; JIRA VIVO-882

This commit is contained in:
Nate Prewitt 2014-10-14 15:44:40 -06:00
parent 3839b9a57e
commit acef06450d
6 changed files with 19 additions and 15 deletions

View file

@ -23,7 +23,7 @@
<#assign visRequestingTemplate = "foaf-person-2column">
<#--add the VIVO-ORCID interface -->
<#include "individual-orcidInterface.ftl">
<section id="individual-intro" class="vcard person" role="region">
<section itemscope itemtype="http://schema.org/Person" id="individual-intro" class="vcard person" role="region">
<section id="share-contact" role="region">
<#-- Image -->
<#assign individualImage>

View file

@ -51,7 +51,7 @@
</#if>
</#if>
</#if>
<section id="individual-intro" class="vcard person" role="region">
<section itemscope itemtype="http://schema.org/Person" id="individual-intro" class="vcard person" role="region">
<section id="label-title" <#if editable>style="width:45%"</#if> >
<header>
<#if relatedSubject??>

View file

@ -39,7 +39,7 @@
<ul id="phone-list" role="list">
<#list phone.statements as statement>
<li role="listitem" <#if editable>style="padding-left:10px;"</#if>>
${statement.number!}
<span itemprop="telephone">${statement.number!}</span>
<@p.editingLinks "${phone.localName}" "${phone.name}" statement editable phone.rangeUri />
</li>
</#list>
@ -65,7 +65,7 @@
<#list email.statements as statement>
<li role="listitem" <#if editable>style="padding-left:10px;"</#if>>
<a class="email" href="mailto:${statement.emailAddress!}" title="${i18n().email}">${statement.emailAddress!}</a>
<a itemprop="email" class="email" href="mailto:${statement.emailAddress!}" title="${i18n().email}">${statement.emailAddress!}</a>
<@p.editingLinks "${email.localName}" "${email.name}" statement editable email.rangeUri />
</li>
</#list>

View file

@ -24,7 +24,7 @@
<ul id="individual-phone" role="list" <#if editable>style="list-style:none;margin-left:0;"</#if>>
<#list phone.statements as statement>
<li role="listitem">
${statement.number!}
<span itemprop="telephone">${statement.number!}</span>
<@p.editingLinks "${phone.localName}" "${phone.name}" statement editable phone.rangeUri />
</li>
</#list>
@ -46,7 +46,7 @@
<ul id="${listId}" class="individual-emails" role="list" <#if editable>style="list-style:none;margin-left:0;"</#if>>
<#list email.statements as statement>
<li role="listitem">
<a class="email" href="mailto:${statement.emailAddress!}" title="${i18n().email}">${statement.emailAddress!}</a>
<a itemprop="email" class="email" href="mailto:${statement.emailAddress!}" title="${i18n().email}">${statement.emailAddress!}</a>
<@p.editingLinks "${email.localName}" "${email.name}" statement editable email.rangeUri />
</li>
</#list>

View file

@ -8,28 +8,32 @@
<#import "lib-sequence.ftl" as s>
<#import "lib-datetime.ftl" as dt>
<@showPosition statement />
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showPosition statement>
<#local posTitle>
<span itemprop="jobTitle">${statement.positionTitle!statement.hrJobTitle!}</span>
</#local>
<#local linkedIndividual>
<#if statement.org??>
<a href="${profileUrl(statement.uri("org"))}" title="${i18n().organization_name}">${statement.orgName}</a>
<a itemprop="worksFor" itemscope itemtype="http://schema.org/Organization" href="${profileUrl(statement.uri("org"))}" title="${i18n().organization_name}">${statement.orgName}</a>
<#else>
<#-- This shouldn't happen, but we must provide for it -->
<a href="${profileUrl(statement.uri("position"))}" title="${i18n().missing_organization}">${i18n().missing_organization}</a>
<a itemprop="worksFor" itemscope itemtype="http://schema.org/Organization" href="${profileUrl(statement.uri("position"))}" title="${i18n().missing_organization}">${i18n().missing_organization}</a>
</#if>
</#local>
<#-- The sparql query returns both the org's parent (middleOrg) and grandparent (outerOrg).
For now, we are only displaying the parent in the list view. -->
<#local middleOrganization>
<#if statement.middleOrg??>
<a href="${profileUrl(statement.uri("middleOrg"))}" title="${i18n().middle_organization}">${statement.middleOrgName!}</a>
<a itemprop="worksFor" itemscope itemtype="http://schema.org/Organization" href="${profileUrl(statement.uri("middleOrg"))}" title="${i18n().middle_organization}">${statement.middleOrgName!}</a>
</#if>
</#local>
<@s.join [ statement.positionTitle!statement.hrJobTitle!, linkedIndividual, middleOrganization! ]/> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
<@s.join [ posTitle, linkedIndividual, middleOrganization! ]/> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#macro>

View file

@ -24,7 +24,7 @@
<#--add the VIVO-ORCID interface -->
<#include "individual-orcidInterface.ftl">
<section id="individual-intro" class="vcard person" role="region">
<section itemscope itemtype="http://schema.org/Person" id="individual-intro" class="vcard person" role="region">
<section id="share-contact" role="region">
<!-- Image -->
@ -72,7 +72,7 @@
<#else>
<h1 class="vcard foaf-person">
<#-- Label -->
<span class="fn"><@p.label individual editable labelCount localesCount/></span>
<span itemprop="alternateName" class="fn"><@p.label individual editable labelCount localesCount/></span>
<#-- Display preferredTitle if it exists; otherwise mostSpecificTypes -->
<#assign title = propertyGroups.pullProperty("http://purl.obolibrary.org/obo/ARG_2000028","http://www.w3.org/2006/vcard/ns#Title")!>
@ -84,7 +84,7 @@
<@p.verboseDisplay title />
</#if>
<#list title.statements as statement>
<span class="display-title<#if editable>-editable</#if>">${statement.preferredTitle}</span>
<span itemprop="jobTitle" class="display-title<#if editable>-editable</#if>">${statement.preferredTitle}</span>
<@p.editingLinks "${title.localName}" "${title.name}" statement editable title.rangeUri />
</#list>
</#if>