Custom template for compilation
This commit is contained in:
parent
385c42d415
commit
293804fcfb
4 changed files with 410 additions and 1 deletions
|
@ -128,7 +128,7 @@
|
|||
<vitro:prohibitedFromUpdateBelowRoleLevelAnnot rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/role#public"/>
|
||||
<vitro:hiddenFromPublishBelowRoleLevelAnnot rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/role#public"/>
|
||||
<vitro:hiddenFromDisplayBelowRoleLevelAnnot rdf:resource="http://vitro.mannlib.cornell.edu/ns/vitro/role#public"/>
|
||||
<vitro:customDisplayViewAnnot>elenphAritcle.ftl</vitro:customDisplayViewAnnot>
|
||||
<vitro:customDisplayViewAnnot>compilation.ftl</vitro:customDisplayViewAnnot>
|
||||
<rdfs:label xml:lang="en-US">Compilation</rdfs:label>
|
||||
<vitro:customEntryFormAnnot>edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.CompilationGenerator</vitro:customEntryFormAnnot>
|
||||
</owl:Class>
|
||||
|
|
18
webapp/src/main/webapp/js/toc.js
Normal file
18
webapp/src/main/webapp/js/toc.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
let content = document.getElementById("wrapper-content");
|
||||
let toc = document.getElementById("TOC");
|
||||
createTOC(content, toc);
|
||||
|
||||
function createTOC(content, toc){
|
||||
if (toc === null){
|
||||
alert("no TOC element found");
|
||||
return;
|
||||
}
|
||||
if (content === null){
|
||||
alert("no content element found");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
353
webapp/src/main/webapp/templates/freemarker/compilation.ftl
Normal file
353
webapp/src/main/webapp/templates/freemarker/compilation.ftl
Normal file
|
@ -0,0 +1,353 @@
|
|||
<#-- $This file is distributed under the terms of the license in LICENSE$ -->
|
||||
|
||||
<#-- Individual profile page template for foaf:Person individuals -->
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="${urls.base}/css/individual/ie7-standard-view.css" />
|
||||
<![endif]-->
|
||||
<#include "individual-setup.ftl">
|
||||
${scripts.add('<script async type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>')}
|
||||
${scripts.add('<script async type="text/javascript" src="//cdn.plu.mx/widget-popup.js"></script>')}
|
||||
${scripts.add('<script async type="text/javascript" src="${urls.base}/themes/iph/js/print.js"></script>')}
|
||||
<#import "individual-qrCodeGenerator.ftl" as qr>
|
||||
<#import "lib-vivo-properties.ftl" as vp>
|
||||
<#include "text-lib.ftl">
|
||||
|
||||
<#--Number of labels present-->
|
||||
<#if !labelCount??>
|
||||
<#assign labelCount = 0 >
|
||||
</#if>
|
||||
<#--Number of available locales-->
|
||||
<#if !localesCount??>
|
||||
<#assign localesCount = 1>
|
||||
</#if>
|
||||
<#--Number of distinct languages represented, with no language tag counting as a language, across labels-->
|
||||
<#if !languageCount??>
|
||||
<#assign languageCount = 1>
|
||||
</#if>
|
||||
<#assign qrCodeIcon = "qr-code-icon.png">
|
||||
<#assign visRequestingTemplate = "foaf-person-2column">
|
||||
<#--add the VIVO-ORCID interface -->
|
||||
<#include "individual-orcidInterface.ftl">
|
||||
<section id="individual-intro" class="vcard person" role="region"><span itemscope itemtype="http://schema.org/Person">
|
||||
<section id="individual-info" ${infoClass!} role="region" style="width: 100%;">
|
||||
<#include "individual-adminPanel.ftl">
|
||||
<header>
|
||||
<#if relatedSubject??>
|
||||
<h2>${relatedSubject.relatingPredicateDomainPublic} ${i18n().for} ${relatedSubject.name}</h2>
|
||||
<p><a href="${relatedSubject.url}" title="${i18n().return_to(relatedSubject.name)}">← ${i18n().return_to(relatedSubject.name)}</a></p>
|
||||
<#else>
|
||||
<h1 itemprop="name" class="vcard foaf-person fn" <#if !editable>style="float:left;border-right:1px solid #A6B1B0;"</#if>>
|
||||
<#-- Label -->
|
||||
<@p.label individual editable labelCount localesCount/>
|
||||
<@p.deleteIndividualLink individual />
|
||||
</h1>
|
||||
<#-- 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")!>
|
||||
<#if title?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
||||
<#if (title.statements?size < 1) >
|
||||
<@p.addLinkWithLabel title editable />
|
||||
<#elseif editable>
|
||||
<h2>${title.name?capitalize!}</h2>
|
||||
<@p.verboseDisplay title />
|
||||
</#if>
|
||||
<#list title.statements as statement>
|
||||
<#if !editable >
|
||||
<div id="titleContainer"><span itemprop="jobTitle" class="display-title-not-editable">${statement.preferredTitle}</span></div>
|
||||
<#else>
|
||||
<span itemprop="jobTitle" class="display-title-editable">${statement.preferredTitle}</span>
|
||||
<@p.editingLinks "${title.localName}" "${title.name}" statement editable title.rangeUri />
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#-- If preferredTitle is unpopulated, display mostSpecificTypes -->
|
||||
<#if ! (title.statements)?has_content>
|
||||
<@p.mostSpecificTypesPerson individual editable/>
|
||||
</#if>
|
||||
</#if>
|
||||
<span id="iconControlsRightSide" class="<#if editable>iconControlsEditable<#else>iconControlsNotEditable</#if>" <#if !user.hasSiteAdminAccess>style="top:5px"</#if>>
|
||||
<#include "individual-iconControls.ftl">
|
||||
</span>
|
||||
<#if editable && profilePageTypesEnabled >
|
||||
<#include "individual-profilePageTypes.ftl">
|
||||
</#if>
|
||||
</header>
|
||||
<!-- Positions -->
|
||||
<#include "individual-positions.ftl">
|
||||
|
||||
<!-- Overview -->
|
||||
<#if !editable>
|
||||
<p></p>
|
||||
</#if>
|
||||
<#include "individual-overview.ftl">
|
||||
|
||||
<!-- Research Areas -->
|
||||
<#include "individual-researchAreas.ftl">
|
||||
|
||||
<!-- Geographic Focus -->
|
||||
<#include "individual-geographicFocus.ftl">
|
||||
|
||||
<#include "individual-openSocial.ftl">
|
||||
</section> <!-- end individual-info -->
|
||||
</span></section> <!-- end individual-intro -->
|
||||
|
||||
<#assign nameForOtherGroup = "${i18n().other}">
|
||||
<#if !editable>
|
||||
<#-- We don't want to see the first name and last name unless we might edit them. -->
|
||||
<#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/firstName")!>
|
||||
<#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/lastName")!>
|
||||
</#if>
|
||||
<div class="expandSwitch">
|
||||
<label class="switch">Раскрыть статью
|
||||
<input id="expandlCB" type="checkbox" onclick="switchExpand();">
|
||||
</label>
|
||||
</div>
|
||||
<div id="TOC"></div>
|
||||
<#assign firstPub = propertyGroups.pullProperty("https://litvinovg.pro/text_structures#firstPublication")!>
|
||||
<#if firstPub.statements?has_content && firstPub.type == "data">
|
||||
<div class="firstPub" style="list-style:none;">
|
||||
<div class="label">Первая публикация статьи
|
||||
</div>
|
||||
<@p.dataPropertyList firstPub editable />
|
||||
</div>
|
||||
</#if>
|
||||
|
||||
<#if authors??>
|
||||
<#list authors as author>
|
||||
<div class="affiliations" >
|
||||
<b><#if author.authorFamily??>${author.authorFamily} </#if><#if author.authorGivenName??>${author.authorGivenName}</#if></b>
|
||||
<#if author.orgName??>
|
||||
<br><span style="color:rgba(0,0,0,0.54);">${author.orgName}</span>
|
||||
</#if>
|
||||
<#if author.orgAddress??>
|
||||
<br>
|
||||
<span style="color:rgba(0,0,0,0.54);">Адрес организации: <#if author.orgPostalCode??>${author.orgPostalCode}, </#if>${author.orgAddress} </span>
|
||||
</#if>
|
||||
|
||||
</div>
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
<@showRubrics />
|
||||
|
||||
<div class="articleParts" style="display:block;">
|
||||
<#list paths as order>
|
||||
<#-- ${order.path} -->
|
||||
<#list excerpts as excerptProperties>
|
||||
<#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt>
|
||||
<#assign excerptText = excerptProperties.htmlContent >
|
||||
<#assign excerptTextName = excerptProperties.htmlLabel >
|
||||
<#assign worksCounter = excerptProperties.worksCounter >
|
||||
<#assign bibliographyCounter = excerptProperties.bibliographyCounter >
|
||||
</#if>
|
||||
</#list>
|
||||
<div class = "articleExcerpt">
|
||||
<#if excerptText?? && excerptTextName?? && excerptTextName?has_content && excerptText?has_content>
|
||||
<button type="button" style="border:none;padding: 18px;width: 100%; text-align:left;" class="collapsible">${excerptTextName}</button>
|
||||
<div class="htmlExcerpt" style="list-style:none; display:none;">
|
||||
${excerptText}
|
||||
<#if works?? && works?has_content && worksCounter?number > 0 >
|
||||
<div>
|
||||
<button type="button" class="collapsible" style="background-color:white;border:none;padding: 18px;width: 100%;text-align:left;">Работы</button>
|
||||
<div class="works" style="display:none;">
|
||||
<#list works as work>
|
||||
<#if work.elenphExcerpt == order.elenphExcerpt >
|
||||
<div class="work" style="list-style:none;">
|
||||
<p> ${work.works} </p>
|
||||
</div>
|
||||
</#if>
|
||||
</#list>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
|
||||
<#if bibliography?? && bibliography?has_content && bibliographyCounter?number > 0>
|
||||
<div>
|
||||
<button type="button" class="collapsible" style="background-color:white;border:none;padding: 18px;width: 100%; text-align: left;">Литература</button>
|
||||
<div class="bibliography" style="display:none;">
|
||||
<#list bibliography as one_bibliography>
|
||||
<#if one_bibliography.elenphExcerpt == order.elenphExcerpt >
|
||||
<div class="bibliography_entry" style="list-style:none;">
|
||||
<p> ${one_bibliography.bibliography} </p>
|
||||
</div>
|
||||
</#if>
|
||||
</#list>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</#if>
|
||||
</div> <#-- articleExcerpt -->
|
||||
</#list>
|
||||
|
||||
<#if works?? && works?has_content>
|
||||
<div>
|
||||
<button type="button" class="collapsible" style="border:none;padding: 18px;width: 100%;text-align:left;">Работы</button>
|
||||
<div class="works" style="display:none;">
|
||||
<#list works as work>
|
||||
<div class="work" style="list-style:none;">
|
||||
<p> ${work.works} </p>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
|
||||
<#if bibliography?? && bibliography?has_content>
|
||||
<div>
|
||||
<button type="button" class="collapsible" style="border:none;padding: 18px;width: 100%; text-align: left;">Литература</button>
|
||||
<div class="bibliography" style="display:none;">
|
||||
<#list bibliography as one_bibliography>
|
||||
<div class="bibliography_entry" style="list-style:none;">
|
||||
<p> ${one_bibliography.bibliography} </p>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
|
||||
<#if authors??>
|
||||
<#list authors as author>
|
||||
<div class="authors" style="display:block;float:right; margin:15px;">
|
||||
<#if author.authorFamily??>${author.authorFamily}</#if> <#if author.authorInitials??>${author.authorInitials}</#if>
|
||||
</div>
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
<script>
|
||||
var coll = document.getElementsByClassName("collapsible");
|
||||
var i;
|
||||
|
||||
for (i = 0; i < coll.length; i++) {
|
||||
coll[i].addEventListener("click", function() {
|
||||
this.classList.toggle("active");
|
||||
var content = this.nextElementSibling;
|
||||
if (content.style.display === "block") {
|
||||
content.style.display = "none";
|
||||
} else {
|
||||
content.style.display = "block";
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<#-- <@dumpAll /> -->
|
||||
|
||||
<#assign selectedTemplate = "individual--foaf-person-2column.ftl" >
|
||||
|
||||
<#if profilePageTypesEnabled >
|
||||
<#assign profilePageType = profileType >
|
||||
|
||||
<#-- targetedView takes precedence over the profilePageType. -->
|
||||
|
||||
<#if targetedView?has_content>
|
||||
<#if targetedView != "standardView">
|
||||
<#assign selectedTemplate = "individual--foaf-person-quickview.ftl" >
|
||||
</#if>
|
||||
<#elseif profilePageType == "quickView" >
|
||||
<#assign selectedTemplate = "individual--foaf-person-quickview.ftl" >
|
||||
</#if>
|
||||
</#if>
|
||||
<#-- <#include "individual-property-group-tabs.ftl"> -->
|
||||
|
||||
<#if profilePageTypesEnabled && (targetedView?has_content || user.loggedIn) >
|
||||
<span id="quickViewLink" >
|
||||
<a href="${urls.base}/display/${individual.localName}?destination=quickView" >
|
||||
<img id="quickViewIcon" src="${urls.images}/individual/quickViewIcon.png" alt="${i18n().quick_view_icon}"/>
|
||||
</a>
|
||||
</span>
|
||||
</#if>
|
||||
|
||||
<script>
|
||||
console.log(localStorage.getItem('switchExpand'));
|
||||
if (localStorage.getItem('switchExpand') === true || localStorage.getItem('switchExpand') === 'true') {
|
||||
console.log("show html excerpts");
|
||||
$('.htmlExcerpt').show();
|
||||
}
|
||||
function switchExpand(){
|
||||
var checkBox = document.getElementById("expandlCB");
|
||||
if (checkBox.checked == true){
|
||||
$('.htmlExcerpt').show();
|
||||
localStorage.setItem('switchExpand',true);
|
||||
} else {
|
||||
$('.htmlExcerpt').hide();
|
||||
localStorage.setItem('switchExpand',false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<#if !editable>
|
||||
<script>
|
||||
var title = $('div#titleContainer').width();
|
||||
var name = $('h1.vcard').width();
|
||||
var total = parseInt(title,10) + parseInt(name,10);
|
||||
if ( name < 280 && total > 600 ) {
|
||||
var diff = total - 600;
|
||||
$('div#titleContainer').width(title - diff);
|
||||
}
|
||||
else if ( name > 279 && name + title > 600 ) {
|
||||
$('div#titleContainer').width('620');
|
||||
}
|
||||
</script>
|
||||
</#if>
|
||||
<script>
|
||||
var imagesPath = '${urls.images}';
|
||||
</script>
|
||||
<#assign rdfUrl = individual.rdfUrl>
|
||||
|
||||
<#if rdfUrl??>
|
||||
<script>
|
||||
var individualRdfUrl = '${rdfUrl}';
|
||||
</script>
|
||||
</#if>
|
||||
<script type="text/javascript">
|
||||
var individualUri = '${individual.uri!}';
|
||||
var individualPhoto = '${individual.thumbNail!}';
|
||||
var exportQrCodeUrl = '${urls.base}/qrcode?uri=${individual.uri!}';
|
||||
var baseUrl = '${urls.base}';
|
||||
var profileTypeData = {
|
||||
processingUrl: '${urls.base}/edit/primitiveRdfEdit',
|
||||
individualUri: '${individual.uri!}',
|
||||
defaultProfileType: '${profileType!}'
|
||||
};
|
||||
var i18nStrings = {
|
||||
errorProcessingTypeChange: '${i18n().error_processing_type_change}',
|
||||
displayLess: '${i18n().display_less}',
|
||||
displayMoreEllipsis: '${i18n().display_more_ellipsis}',
|
||||
showMoreContent: '${i18n().show_more_content}',
|
||||
verboseTurnOff: '${i18n().verbose_turn_off}',
|
||||
standardviewTooltipOne: '${i18n().standardview_tooltip_one}',
|
||||
standardviewTooltipTwo: '${i18n().standardview_tooltip_two}',
|
||||
researchAreaTooltipOne: '${i18n().research_area_tooltip_one}',
|
||||
researchAreaTooltipTwo: '${i18n().research_area_tooltip_two}'
|
||||
};
|
||||
var i18nStringsUriRdf = {
|
||||
shareProfileUri: '${i18n().share_profile_uri}',
|
||||
viewRDFProfile: '${i18n().view_profile_in_rdf}',
|
||||
closeString: '${i18n().close}'
|
||||
};
|
||||
</script>
|
||||
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual.css" />',
|
||||
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-vivo.css" />',
|
||||
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-2column-view.css" />',
|
||||
'<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.12.1.css" />',
|
||||
'<link rel="stylesheet" type="text/css" href="${urls.base}/css/jquery_plugins/qtip/jquery.qtip.min.css" />')}
|
||||
|
||||
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip.min.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/json2.js"></script>',
|
||||
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>')}
|
||||
|
||||
${scripts.add('<script async type="text/javascript" src="${urls.base}/js/individual/individualUriRdf.js"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/individual/individualQtipBubble.js"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.12.1.min.js"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/individual/individualUtils.js?vers=1.5.1"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/individual/moreLessController.js"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/individual/individualProfilePageType.js"></script>',
|
||||
'<script async type="text/javascript" src="${urls.base}/js/imageUpload/imageUploadUtils.js"></script>',
|
||||
'<script async type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>',
|
||||
'<script async type="text/javascript" src="//cdn.plu.mx/widget-popup.js"></script>')}
|
||||
|
||||
<script type="text/javascript">
|
||||
i18n_confirmDelete = "${i18n().confirm_delete}";
|
||||
</script>
|
38
webapp/src/main/webapp/templates/freemarker/text-lib.ftl
Normal file
38
webapp/src/main/webapp/templates/freemarker/text-lib.ftl
Normal file
|
@ -0,0 +1,38 @@
|
|||
|
||||
<#macro showRubrics>
|
||||
<#assign currentRubrics = propertyGroups.pullProperty("https://iph.ras.ru/relationships#belongsTo")!>
|
||||
<#if currentRubrics?? && currentRubrics?has_content>
|
||||
<div class="label">Относится к рубрикам: <@p.addLink currentRubrics editable /> <@p.verboseDisplay currentRubrics /></div>
|
||||
<#if rubrics?? && rubrics?has_content>
|
||||
<#list rubrics as rubric>
|
||||
<li role="listitem" style="list-style:none;">
|
||||
<a href="${urls.base}/individual?uri=${rubric.rubricID?url}"">${rubric.rubricName}</a>
|
||||
</li>
|
||||
</#list>
|
||||
</#if>
|
||||
<br/>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#macro showIssue>
|
||||
<#assign issue = propertyGroups.pullProperty("https://litvinovg.pro/text_structures#issue")!>
|
||||
<#if issue.statements?has_content && issue.type == "data">
|
||||
<div class="issue" style="list-style:none;">
|
||||
<div class="label">Входит в выпуск</div>
|
||||
<@p.dataPropertyList issue editable />
|
||||
</div>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#macro showYear>
|
||||
<#assign year = propertyGroups.pullProperty("https://litvinovg.pro/text_structures#year")!>
|
||||
<#if year.statements?has_content && year.type == "data">
|
||||
<div class="year" style="list-style:none;">
|
||||
<div class="label">Год</div>
|
||||
<@p.dataPropertyList year editable />
|
||||
</div>
|
||||
</#if>
|
||||
</#macro>
|
||||
<#macro showWorks works >
|
||||
|
||||
</#macro>
|
Loading…
Add table
Reference in a new issue