merging r4252 to the trunk

This commit is contained in:
tworrall 2012-08-07 19:37:11 +00:00
parent d5624a9669
commit cefee06309
7 changed files with 76 additions and 12 deletions

View file

@ -24,6 +24,7 @@
?appearsIn
?partOf
?editor
?hideThis
WHERE {
?subject ?property ?authorship
OPTIONAL { ?authorship core:linkedInformationResource ?infoResource .
@ -54,9 +55,10 @@
}
OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime
}
}
OPTIONAL { ?authorship core:hideFromDisplay ?hideThis }
}
NOT EXISTS { ?authorship core:hideFromDisplay ?hideThis }
# NOT EXISTS { ?authorship core:hideFromDisplay ?hideThis }
<critical-data-required>
FILTER ( bound(?infoResource) )
</critical-data-required>

View file

@ -20,6 +20,7 @@
?adminedByLabel
?dateTimeStartRole ?dateTimeEndRole
?dateTimeStartGrant ?dateTimeEndGrant
?hideThis
WHERE {
?subject ?property ?role
@ -55,7 +56,8 @@
?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant
}
}
NOT EXISTS { ?role core:hideFromDisplay ?hideThis }
OPTIONAL { ?role core:hideFromDisplay ?hideThis }
# NOT EXISTS { ?role core:hideFromDisplay ?hideThis }
<critical-data-required>
FILTER ( bound(?activity) )
</critical-data-required>

View file

@ -14,7 +14,9 @@
?position
?positionTitle
?person ?personName
?dateTimeStart ?dateTimeEnd WHERE {
?dateTimeStart ?dateTimeEnd
?hideThis
WHERE {
?subject ?property ?position
OPTIONAL { ?position core:positionForPerson ?person .
?person rdfs:label ?personName
@ -25,6 +27,7 @@
}
</collated>
OPTIONAL { ?position rdfs:label ?positionTitle }
OPTIONAL { ?position core:hideFromDisplay ?hideThis }
OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
@ -34,7 +37,7 @@
}
# Get current positions only: end date is either null or not in the past
}
NOT EXISTS { ?position core:hideFromDisplay ?hideThis }
# NOT EXISTS { ?position core:hideFromDisplay ?hideThis }
FILTER ( !bound(?dateTimeEnd) ||
afn:substring(str(?dateTimeEnd), 0, 4) &gt;= afn:substring(str(afn:now()), 0, 4) )
<critical-data-required>

View file

@ -97,6 +97,35 @@ $(document).ready(function(){
$('#qrCodeImage').toggleClass('hidden');
return false;
});
// For pubs and grants on the foaf:person profile, and affiliated people
// on the foaf:organization profile -- if a pub/grant/person has been hidden
// via the "manage" link, we need to ensure that the subclass heading gets removed
// if there are no items to display for that subclass.
$.each($('h3'), function() {
if ( $(this).next().attr('class') == "subclass-property-list hideThis" ) {
if ( $(this).next().children().length == 0 ) {
$(this).closest('li').remove();
}
}
});
// if there are no selected pubs, hide the manage link; same for grants
// and affiliated people on the org profile page
if ( $('ul#authorInAuthorshipList').children('li').length < 1 && $('h3#authorInAuthorship').attr('class') != "hiddenPubs" ) {
$('a#managePubLink').hide();
}
if ( $('ul#hasResearcherRoleList').children('li').length < 1 &&
$('ul#hasPrincipalInvestigatorRoleList').children('li').length < 1 &&
$('ul#hasCo-PrincipalInvestigatorRoleList').children('li').length < 1 &&
$('ul#hasInvestigatorRoleList').children('li').length < 1 &&
$('h3#hasResearcherRole').attr('class') != "hiddenGrants" ) {
$('a#manageGrantLink').hide();
}
if ( $('ul#organizationForPositionList').children('li').length < 1 && $('h3#organizationForPosition').attr('class') != "hiddenPeople" ) {
$('a#managePeopleLink').hide();
}
});

View file

@ -14,7 +14,16 @@
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showAuthorship statement>
<#if statement.hideThis?has_content>
<span class="hideThis">&nbsp;</span>
<script type="text/javascript" >
$('span.hideThis').parent().parent().addClass("hideThis");
if ( $('h3#authorInAuthorship').attr('class').length == 0 ) {
$('h3#authorInAuthorship').addClass('hiddenPubs');
}
$('span.hideThis').parent().remove();
</script>
<#else>
<#local citationDetails>
<#if statement.subclass??>
<#if statement.subclass?contains("Article")>
@ -103,5 +112,5 @@
</#local>
${resourceTitle} ${citationDetails} <@dt.yearSpan "${statement.dateTime!}" />
</#if>
</#macro>

View file

@ -13,6 +13,16 @@
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showRole statement>
<#if statement.hideThis?has_content>
<span class="hideThis">&nbsp;</span>
<script type="text/javascript" >
$('span.hideThis').parent().parent().addClass("hideThis");
if ( $('h3#hasResearcherRole').attr('class').length == 0 ) {
$('h3#hasResearcherRole').addClass('hiddenGrants');
}
$('span.hideThis').parent().remove();
</script>
<#else>
<#local linkedIndividual>
<#if statement.activity??>
<a href="${profileUrl(statement.uri("activity"))}" title="activity name">${statement.activityLabel!statement.activityName!}</a>
@ -38,6 +48,6 @@
</#if>
</#local>
${linkedIndividual} ${awardOrAdminBy} ${dateTime!}
${linkedIndividual} ${awardOrAdminBy} ${dateTime!} ${statement.subclass!}
</#if>
</#macro>

View file

@ -14,7 +14,16 @@
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showPosition statement>
<#if statement.hideThis?has_content>
<span class="hideThis">&nbsp;</span>
<script type="text/javascript" >
$('span.hideThis').parent().parent().addClass("hideThis");
if ( $('h3#organizationForPosition').attr('class').length == 0 ) {
$('h3#organizationForPosition').addClass('hiddenPeople');
}
$('span.hideThis').parent().remove();
</script>
<#else>
<#local linkedIndividual>
<#if statement.person??>
<a href="${profileUrl(statement.uri("person"))}" title="person name">${statement.personName}</a>
@ -25,5 +34,5 @@
</#local>
<@s.join [ linkedIndividual, statement.positionTitle! ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#if>
</#macro>