From 102de0c3fd26f1c32069b61761a186885fffbd46 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Jul 2020 13:20:58 +0200 Subject: [PATCH] Templates and SPARQL requests for rubrics, elenph excerpts and articles --- .../everytime/article_custom_fields.n3 | 19 ++ .../everytime/elenphArticleDataGetters.n3 | 108 ++++++++ .../display/everytime/rubricDataGetters.n3 | 113 +++++++++ .../tbox/firsttime/elenphArticle-template.n3 | 5 + .../tbox/firsttime/elenphExcerpt-template.n3 | 5 + .../rdf/tbox/firsttime/rubric-template.n3 | 5 + .../templates/freemarker/elenphAritcle.ftl | 158 ++++++++++++ .../freemarker/elenphExcerpt-internal.ftl | 238 ++++++++++++++++++ .../templates/freemarker/elenphExcerpt.ftl | 42 ++++ .../freemarker/elenphExcerptShortView.ftl | 48 ++++ .../webapp/templates/freemarker/rubric.ftl | 131 ++++++++++ .../webapp/templates/freemarker/rubrics.ftl | 49 ++++ 12 files changed, 921 insertions(+) create mode 100644 home/src/main/resources/rdf/display/everytime/article_custom_fields.n3 create mode 100644 home/src/main/resources/rdf/display/everytime/elenphArticleDataGetters.n3 create mode 100644 home/src/main/resources/rdf/display/everytime/rubricDataGetters.n3 create mode 100644 home/src/main/resources/rdf/tbox/firsttime/elenphArticle-template.n3 create mode 100644 home/src/main/resources/rdf/tbox/firsttime/elenphExcerpt-template.n3 create mode 100644 home/src/main/resources/rdf/tbox/firsttime/rubric-template.n3 create mode 100644 webapp/src/main/webapp/templates/freemarker/elenphAritcle.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/elenphExcerpt-internal.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/elenphExcerpt.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/elenphExcerptShortView.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/rubric.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/rubrics.ftl diff --git a/home/src/main/resources/rdf/display/everytime/article_custom_fields.n3 b/home/src/main/resources/rdf/display/everytime/article_custom_fields.n3 new file mode 100644 index 00000000..d92cdbc0 --- /dev/null +++ b/home/src/main/resources/rdf/display/everytime/article_custom_fields.n3 @@ -0,0 +1,19 @@ +@prefix : . +@prefix rdfs: . + +:vivodocumentModifier_openAccess + a , + ; + rdfs:label "Elenph article excerpts" ; + :hasTargetField "ALLTEXT" ; + :hasSelectQuery """ + PREFIX rdfs: + PREFIX ts_: + PREFIX rdf: + SELECT DISTINCT ?elenphExcerpt ?property ?value + WHERE { + ?uri rdf:type ts_:elenphArticle . + ?uri (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt . + ?elenphExcerpt ?property ?value . + } + """ . diff --git a/home/src/main/resources/rdf/display/everytime/elenphArticleDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/elenphArticleDataGetters.n3 new file mode 100644 index 00000000..15529683 --- /dev/null +++ b/home/src/main/resources/rdf/display/everytime/elenphArticleDataGetters.n3 @@ -0,0 +1,108 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix vitro: . +@prefix xsd: . +@prefix ts_: . +@prefix display: . + + + display:hasDataGetter display:getArticleExcerptsContentDataGetter . + + display:hasDataGetter display:getArticleExcerptPathsDataGetter . + + display:hasDataGetter display:getArticleWorksDataGetter . + + display:hasDataGetter display:getArticleBibliographyDataGetter . + + display:hasDataGetter display:getArticleAuthorsDataGetter . + +display:getArticleExcerptsContentDataGetter + a ; + display:saveToVar "excerpts"; + display:query + """ + PREFIX rdfs: + PREFIX ts_: + SELECT ?elenphExcerpt ?property ?value + WHERE { + ?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt . + ?elenphExcerpt ?property ?value . + } ORDER BY ?elenphExcerpt + """ . + +display:getArticleExcerptPathsDataGetter + a ; + display:saveToVar "paths"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + SELECT (GROUP_CONCAT(substr(concat("000",str(?outline)),strlen(str(?outline))); SEPARATOR = ".") AS ?path ) ?tocElement ?elenphExcerpt + WHERE { + ?individualURI ts_:hasTOCItem/(ts_:pointsTo/ts_:hasTOCItem)* ?tmpTOCItem . + ?tmpTOCItem rdf:type ts_:TOCItem . + ?tmpTOCItem ts_:pointsTo/(ts_:hasTOCItem/ts_:pointsTo)* ?tocElement . + ?tmpTOCItem ts_:itemNumber ?outline . + OPTIONAL { + ?tocElement ts_:hasText ?elenphExcerpt . + } + { + SELECT ?elenphArticle ?tocElement + WHERE { + ?individualURI (ts_:hasTOCItem/ts_:pointsTo)+ ?tocElement . + ?tocElement rdf:type ts_:TOCElement . + ?individualURI rdf:type ts_:elenphArticle . + } + } + } GROUP BY ?tocElement ?elenphExcerpt ORDER BY ?path + """ . + +display:getArticleBibliographyDataGetter + a ; + display:saveToVar "bibliography"; + display:query + """ + PREFIX rdfs: + PREFIX ts_: + PREFIX rdf: + SELECT DISTINCT ?bibliography + WHERE { + ?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt . + ?elenphExcerpt ts_:bibliography ?bibliography . + } ORDER BY ?bibliography + """ . + +display:getArticleWorksDataGetter + a ; + display:saveToVar "works"; + display:query + """ + PREFIX rdfs: + PREFIX ts_: + PREFIX rdf: + SELECT DISTINCT ?works + WHERE { + ?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt . + ?elenphExcerpt ts_:works ?works . + } ORDER BY ?works + """ . + +display:getArticleAuthorsDataGetter + a ; + display:saveToVar "authors"; + display:query + """ + PREFIX rdfs: + PREFIX ts_: + PREFIX rdf: + SELECT DISTINCT ?author + WHERE { + ?individualURI (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?elenphExcerpt . + ?elenphExcerpt ts_:author ?author . + } ORDER BY ?author + """ . + + + diff --git a/home/src/main/resources/rdf/display/everytime/rubricDataGetters.n3 b/home/src/main/resources/rdf/display/everytime/rubricDataGetters.n3 new file mode 100644 index 00000000..d95d033f --- /dev/null +++ b/home/src/main/resources/rdf/display/everytime/rubricDataGetters.n3 @@ -0,0 +1,113 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix vitro: . +@prefix xsd: . +@prefix ts_: . +@prefix display: . + + + display:hasDataGetter display:getArticlesWithRubricDataGetter . + + display:hasDataGetter display:getArticlesWithChildRubricDataGetter . + + display:hasDataGetter display:getChildRubricsDataGetter . + + display:hasDataGetter display:getExcerptsWithRubricDataGetter . + + display:hasDataGetter display:getExcerptsWithRubricsChildsDataGetter . + +display:getArticlesWithChildRubricDataGetter + a ; + display:saveToVar "childArticles"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + PREFIX pr: + SELECT DISTINCT ?childArticleID ?childArticleName + WHERE { + ?rubric (pr:hasParent)+ ?individualURI . + ?excerpt pr:belongsTo ?rubric . + ?excerpt rdf:type ts_:elenphExcerpt . + ?childArticleID (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?excerpt . + ?childArticleID rdfs:label ?childArticleName . + ?childArticleID rdf:type ts_:elenphArticle . + } ORDER BY ?childArticleName + """ . + + +display:getArticlesWithRubricDataGetter + a ; + display:saveToVar "articles"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + PREFIX pr: + SELECT DISTINCT ?articleID ?articleName + WHERE { + ?excerpt pr:belongsTo ?individualURI . + ?excerpt rdf:type ts_:elenphExcerpt . + ?articleID (ts_:hasTOCItem/ts_:pointsTo)+/ts_:hasText ?excerpt . + ?articleID rdfs:label ?articleName . + ?articleID rdf:type ts_:elenphArticle . + } ORDER BY ?articleName + """ . + +display:getChildRubricsDataGetter + a ; + display:saveToVar "childRubrics"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + PREFIX pr: + SELECT DISTINCT ?rubricID ?rubricName + WHERE { + ?rubricID pr:hasParent ?individualURI . + ?rubricID pr:rubricOrder ?order . + ?rubricID rdfs:label ?rubricName . + ?rubricID rdf:type pr:rubric . + } ORDER BY ?order + """ . + +display:getExcerptsWithRubricsChildsDataGetter + a ; + display:saveToVar "childExcerpts"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + PREFIX pr: + SELECT DISTINCT ?childExcerptID ?childExcerptName + WHERE { + ?tmpChildRubrics (pr:hasParent)+ ?individualURI . + ?childExcerptID pr:belongsTo ?tmpChildRubrics . + ?childExcerptID rdfs:label ?childExcerptName . + ?childExcerptID rdf:type ts_:elenphExcerpt . + } ORDER BY ?childExcerptName + """ . + +display:getExcerptsWithRubricDataGetter + a ; + display:saveToVar "excerpts"; + display:query + """ + PREFIX rdfs: + PREFIX rdf: + PREFIX ts_: + PREFIX pr: + SELECT DISTINCT ?excerptID ?excerptName + WHERE { + ?excerptID pr:belongsTo ?individualURI . + ?excerptID rdfs:label ?excerptName . + ?excerptID rdf:type ts_:elenphExcerpt . + } ORDER BY ?excerptName + """ . + + diff --git a/home/src/main/resources/rdf/tbox/firsttime/elenphArticle-template.n3 b/home/src/main/resources/rdf/tbox/firsttime/elenphArticle-template.n3 new file mode 100644 index 00000000..97061317 --- /dev/null +++ b/home/src/main/resources/rdf/tbox/firsttime/elenphArticle-template.n3 @@ -0,0 +1,5 @@ +@prefix vitro: . +@prefix xsd: . +@prefix ts_: . + +ts_:elenphArticle vitro:customDisplayViewAnnot "elenphAritcle.ftl"^^xsd:string . diff --git a/home/src/main/resources/rdf/tbox/firsttime/elenphExcerpt-template.n3 b/home/src/main/resources/rdf/tbox/firsttime/elenphExcerpt-template.n3 new file mode 100644 index 00000000..05ca36a4 --- /dev/null +++ b/home/src/main/resources/rdf/tbox/firsttime/elenphExcerpt-template.n3 @@ -0,0 +1,5 @@ +@prefix vitro: . +@prefix xsd: . +@prefix ts_: . + +ts_:elenphExcerpt vitro:customDisplayViewAnnot "elenphExcerpt.ftl"^^xsd:string . diff --git a/home/src/main/resources/rdf/tbox/firsttime/rubric-template.n3 b/home/src/main/resources/rdf/tbox/firsttime/rubric-template.n3 new file mode 100644 index 00000000..77bcf93c --- /dev/null +++ b/home/src/main/resources/rdf/tbox/firsttime/rubric-template.n3 @@ -0,0 +1,5 @@ +@prefix vitro: . +@prefix xsd: . +@prefix pr: . + +pr:rubric vitro:customDisplayViewAnnot "rubric.ftl"^^xsd:string . diff --git a/webapp/src/main/webapp/templates/freemarker/elenphAritcle.ftl b/webapp/src/main/webapp/templates/freemarker/elenphAritcle.ftl new file mode 100644 index 00000000..e57cf337 --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/elenphAritcle.ftl @@ -0,0 +1,158 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> + +<#-- + + This version of individual--foaf-person.ftl is a "router" template. The original VIVO + version of this template now resides in the /themes/wilma/templates directory. + + This version of the template is used when the profile page types feature is enabled. + This template serves to "rout" the user to the correct template based (1) the + profile page type of the foaf person being displayed or (2) the targeted view that + the user wants to see. For example, when a user is routed to a quick view template, + the user has the option of displaying the full view. If the user chooses that option, + the targetedView variable gets set. + + This template could also be used to load just the "individual--foaf-person-2column.ftl" + without enabling profile page types. "individual--foaf-person-2column.ftl" is a slightly + different design than the "individual--foaf-person.ftl" template in the themes/wilma + directory. + + --> + +<#include "individual-setup.ftl"> + +${scripts.add('')} +${scripts.add('')} + +

style="float:left;text-align:center;width:100%;border-right:1px solid #A6B1B0;"<#else> style="text-align:center;width:100%;"> + <@p.label individual editable labelCount localesCount/> +

+ +<#-- +<#assign issue = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#issue")!> + <#if issue.statements?has_content && issue.type == "data"> +
+
Выпуск
+ <@p.dataPropertyList issue editable /> +
+ + +<#assign year = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#year")!> + <#if year.statements?has_content && year.type == "data"> +
+
Год
+ <@p.dataPropertyList year editable /> +
+ +--> +
+<#list paths as order> +
+ <#-- ${order.path} --> + <#list excerpts as excerptProperties> + + <#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt> + <#if excerptProperties.property == "https://iph.ras.ru/text_structures#htmlExcerpt"> + <#assign excerptText = excerptProperties.value > + + <#if excerptProperties.property == "http://www.w3.org/2000/01/rdf-schema#label"> + <#assign excerptTextName = excerptProperties.value > + + + + <#if excerptText?? && excerptTextName?? && excerptTextName?has_content && excerptText?has_content> + + + +
<#-- articleExcerpt --> + + +
+<#-- <@dump var="works" /> --> +<#if works??> + <#assign no_works = true> + <#list works as work> + <#if no_works> + + <#-- works class--> + + + +<#if bibliography??> + <#assign no_bibliography = true> + <#list bibliography as one_bibliography> + <#if no_bibliography> + + <#-- bibliography class--> + + + +<#if authors??> + <#assign no_authors = true> + <#list authors as author> + <#if no_authors> +
+ <#assign no_authors = false> + <#else> + ", " + + ${author.author} + +
<#-- authors class--> + + + + <#-- <@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" > + + <#elseif profilePageType == "quickView" > + <#assign selectedTemplate = "individual--foaf-person-quickview.ftl" > + + +<#-- <#include selectedTemplate > --> diff --git a/webapp/src/main/webapp/templates/freemarker/elenphExcerpt-internal.ftl b/webapp/src/main/webapp/templates/freemarker/elenphExcerpt-internal.ftl new file mode 100644 index 00000000..01650cde --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/elenphExcerpt-internal.ftl @@ -0,0 +1,238 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> + +<#-- Individual profile page template for foaf:Person individuals --> + +<#-- <#include "individual-setup.ftl"> --> +<#import "individual-qrCodeGenerator.ftl" as qr> +<#import "lib-vivo-properties.ftl" as vp> +<#--Number of labels present--> +<#if !labelCount??> + <#assign labelCount = 0 > + +<#--Number of available locales--> +<#if !localesCount??> + <#assign localesCount = 1> + +<#--Number of distinct languages represented, with no language tag counting as a language, across labels--> +<#if !languageCount??> + <#assign languageCount = 1> + +<#assign qrCodeIcon = "qr-code-icon.png"> +<#assign visRequestingTemplate = "foaf-person-2column"> +<#--add the VIVO-ORCID interface --> +<#include "individual-orcidInterface.ftl"> +
+
+ <#include "individual-adminPanel.ftl"> +
+ <#if relatedSubject??> +

${relatedSubject.relatingPredicateDomainPublic} ${i18n().for} ${relatedSubject.name}

+

← ${i18n().return_to(relatedSubject.name)}

+ <#else> +

style="float:left;border-right:1px solid #A6B1B0;"> + <#-- Label --> + <@p.label individual editable labelCount localesCount/> +

+ <#-- 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> +

${title.name?capitalize!}

+ <@p.verboseDisplay title /> + + <#list title.statements as statement> + <#if !editable > +
${statement.preferredTitle}
+ <#else> + ${statement.preferredTitle} + <@p.editingLinks "${title.localName}" "${title.name}" statement editable title.rangeUri /> + + + + <#-- If preferredTitle is unpopulated, display mostSpecificTypes --> + <#if ! (title.statements)?has_content> + <@p.mostSpecificTypesPerson individual editable/> + + + style="top:5px"> + <#include "individual-iconControls.ftl"> + + <#if editable && profilePageTypesEnabled > + <#include "individual-profilePageTypes.ftl"> + +
+ + <#include "individual-positions.ftl"> + + + <#if !editable> +

+ + <#include "individual-overview.ftl"> + + + <#include "individual-researchAreas.ftl"> + + + <#include "individual-geographicFocus.ftl"> + + <#include "individual-openSocial.ftl"> +
+
+ +<#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")!> + + +<#assign author = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#author")!> + <#if author.statements?has_content && author.type == "data"> +
+
Автор
+ <@p.dataPropertyList author editable /> +
+ + + <#assign affiliation = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#affiliation")!> + <#if affiliation.statements?has_content && affiliation.type == "data"> +
+
Аффилиация
+ <@p.dataPropertyList affiliation editable /> +
+ + + <#assign rubrics = propertyGroups.pullProperty("https://iph.ras.ru/relationships#belongsTo")!> + <#if rubrics?has_content > +
Относится к: <@p.addLink rubrics editable /> <@p.verboseDisplay rubrics />
+ <#if rubrics.statements?has_content > +
+ <@p.objectProperty rubrics editable /> +
+ + + <#assign keywords = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#keywords")!> + <#if keywords?has_content > +
Ключевые слова: <@p.addLink keywords editable /> <@p.verboseDisplay keywords />
+ <#if keywords.statements?has_content && keywords.type == "data"> +
+ <@p.dataPropertyList keywords editable /> +
+ + + <#assign htmlExcerpt = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#htmlExcerpt")!> + <#if htmlExcerpt.statements?has_content && htmlExcerpt.type == "data"> +
+ <@p.dataPropertyList htmlExcerpt editable /> + <#-- object property --> +
+ + + <#assign works = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#works")!> + <#if works.statements?has_content && works.type == "data"> +
+
+

Работы:

+ <@p.dataPropertyList works editable /> +
+ + + <#assign biblio= propertyGroups.pullProperty("https://iph.ras.ru/text_structures#bibliography")!> + <#if biblio.statements?has_content && biblio.type == "data"> +
+
+

Литература:

+ <@p.dataPropertyList biblio editable /> +
+ + +<#-- <#include "individual-property-group-tabs.ftl"> --> + +<#if profilePageTypesEnabled && (targetedView?has_content || user.loggedIn) > + + + ${i18n().quick_view_icon} + + + +<#if !editable> + + + +<#assign rdfUrl = individual.rdfUrl> + +<#if rdfUrl??> + + + + +${stylesheets.add('', + '', + '', + '', + '')} + +${headScripts.add('', + '', + '', + '')} + +${scripts.add('', + '', + '', + '', + '', + '', + '', + '', + '')} + + diff --git a/webapp/src/main/webapp/templates/freemarker/elenphExcerpt.ftl b/webapp/src/main/webapp/templates/freemarker/elenphExcerpt.ftl new file mode 100644 index 00000000..893cbea3 --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/elenphExcerpt.ftl @@ -0,0 +1,42 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> + +<#-- + + This version of individual--foaf-person.ftl is a "router" template. The original VIVO + version of this template now resides in the /themes/wilma/templates directory. + + This version of the template is used when the profile page types feature is enabled. + This template serves to "rout" the user to the correct template based (1) the + profile page type of the foaf person being displayed or (2) the targeted view that + the user wants to see. For example, when a user is routed to a quick view template, + the user has the option of displaying the full view. If the user chooses that option, + the targetedView variable gets set. + + This template could also be used to load just the "individual--foaf-person-2column.ftl" + without enabling profile page types. "individual--foaf-person-2column.ftl" is a slightly + different design than the "individual--foaf-person.ftl" template in the themes/wilma + directory. + + --> + +<#include "individual-setup.ftl"> + +${scripts.add('')} +${scripts.add('')} + +<#assign selectedTemplate = "elenphExcerpt-internal.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" > + + <#elseif profilePageType == "quickView" > + <#assign selectedTemplate = "individual--foaf-person-quickview.ftl" > + + +<#include selectedTemplate > diff --git a/webapp/src/main/webapp/templates/freemarker/elenphExcerptShortView.ftl b/webapp/src/main/webapp/templates/freemarker/elenphExcerptShortView.ftl new file mode 100644 index 00000000..804aa80f --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/elenphExcerptShortView.ftl @@ -0,0 +1,48 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> +<#-- Default individual search view --> + +<#import "lib-vivo-properties.ftl" as p> + +<#-- <@dumpAll /> --> + + +
+ ${individual.name} + <@p.displayTitle individual /> +

${individual.snippet}

+
diff --git a/webapp/src/main/webapp/templates/freemarker/rubric.ftl b/webapp/src/main/webapp/templates/freemarker/rubric.ftl new file mode 100644 index 00000000..f2330967 --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/rubric.ftl @@ -0,0 +1,131 @@ +<#import "lib-vivo-properties.ftl" as vp> +<#include "individual-setup.ftl"> + +
+ +
+ <#include "individual-adminPanel.ftl"> +
+ <#if relatedSubject??> +

${relatedSubject.relatingPredicateDomainPublic} ${i18n().for} ${relatedSubject.name}

+

← ${i18n().return_to(relatedSubject.name)}

+ <#else> +

style="float:left;width:100%;border-right:1px solid #A6B1B0;"> + <@p.label individual editable labelCount localesCount/> +

+ + + <#if editable && profilePageTypesEnabled > + <#include "individual-profilePageTypes.ftl"> + +
+
+
+
+ + <#assign parent = propertyGroups.pullProperty("https://iph.ras.ru/relationships#hasParent")!> + <#if parent?has_content> +
Родительская рубрика<#if !parent.statements?has_content> <@p.addLink parent editable /> <@p.verboseDisplay parent />
+ <#if parent.statements?has_content > +
+ <@p.objectProperty parent editable /> +
+ + +<#if editable > + + <#assign order = propertyGroups.pullProperty("https://iph.ras.ru/relationships#rubricOrder")!> + <#if order?has_content> +
Порядок рубрики<#if !order.statements?has_content> <@p.addLink order editable /> <@p.verboseDisplay order />
+ <#if order.statements?has_content > +
+ <@p.dataPropertyList order editable /> +
+ + + + + <#if childRubrics?has_content> + +
+ <#list childRubrics as childRubric> + <#if childRubric?has_content > + + + +
+ + + <#if childArticles?has_content> + +
+ <#list childArticles as childArticle> + <#if childArticle?has_content > + + + +
+ + + <#if childExcerpts?has_content> + +
+ <#list childExcerpts as childExcerpt> + <#if childExcerpt?has_content > + + + +
+ + + <#if articles?has_content> + + + + + <#if excerpts?has_content> + + + + + + + + diff --git a/webapp/src/main/webapp/templates/freemarker/rubrics.ftl b/webapp/src/main/webapp/templates/freemarker/rubrics.ftl new file mode 100644 index 00000000..75d0b045 --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/rubrics.ftl @@ -0,0 +1,49 @@ +<#list rubrics as rubric> + <#if !rubric.parentUri??> + <#assign childs = rubric.childs?number> + + + + + + + + + +<#macro nestedRubrics allrubrics parentUri deep level> + <#assign count = 0> + <#list allrubrics as innerRubric> + <#if innerRubric.parentUri?? && innerRubric.parentUri == parentUri> + <#assign childs = innerRubric.childs?number> + <#assign count = count + 1 > + + + + <#if count = childs > + <#break> + + +