Commit 36765d5a authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

person/persGrp – add support for creator and member

parent 9e125f36
...@@ -121,6 +121,30 @@ for $n in $note ...@@ -121,6 +121,30 @@ for $n in $note
} }
}; };
(:~
: creates a list of all creations or points to the creator of a work
: :)
declare function local:creator($creators as element(tei:link)+)
as element(xhtml:li) {
element xhtml:li {
attribute class { "creator" },
"Urheber:",
element xhtml:ul {
for $c in $creators
let $currentId := $c/parent::*/parent::*/@xml:id
let $target := try { ($c/@target => replace("#", "") => tokenize(" "))[. != $currentId] => substring-after(":") }
catch * { "Propably invalid format. Please check!" }
return
element xhtml:li {
element xhtml:a {
attribute href { "?e=" || string-join($target) },
$target
}
}
}
}
};
(:~ (:~
: a list item with a list of links : a list item with a list of links
: :) : :)
...@@ -597,6 +621,8 @@ else ...@@ -597,6 +621,8 @@ else
let $state := $pers/tei:state/tei:desc let $state := $pers/tei:state/tei:desc
let $note := $pers/tei:note let $note := $pers/tei:note
let $bibl := $pers/tei:bibl let $bibl := $pers/tei:bibl
let $members := $pers/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P107_has_current_or_former_member"]
let $creator := $pers/tei:linkGrp/tei:link[@corresp="http://purl.org/dc/terms/creator"]
let $links := $pers/tei:linkGrp/tei:link[@corresp="https://schema.org/mentions"] let $links := $pers/tei:linkGrp/tei:link[@corresp="https://schema.org/mentions"]
return return
element xhtml:li { element xhtml:li {
...@@ -649,6 +675,27 @@ else ...@@ -649,6 +675,27 @@ else
attribute class { "state" }, attribute class { "state" },
$s/text() $s/text()
}, },
(: current or former member :)
if(not(exists($members))) then () else
element xhtml:li {
attribute class { "member" },
"Mitglieder:",
element xhtml:ul {
for $member in $members
let $memberId := $members/@target => substring-after(" ") => substring-after("#")
return
element xhtml:li {
element xhtml:a {
attribute href { "?e=" || $memberId },
<xhtml:i class="fa fa-user" aria-hidden="true"></xhtml:i>,
"&#160;",
$memberId
}
}
}
},
if (not(exists($creator))) then () else
local:creator($creator),
(: note :) (: note :)
local:note($note), local:note($note),
(: bibl :) (: bibl :)
...@@ -904,16 +951,8 @@ else ...@@ -904,16 +951,8 @@ else
$d/text() $d/text()
}, },
(: creator :) (: creator :)
for $c in $creator if (not(exists($creator))) then () else
let $target := $c/@target => substring-after(":") local:creator($creator),
return
element xhtml:li {
attribute class { "creator" },
element xhtml:a {
attribute href { "?e=" || $target },
$target
}
},
(: note :) (: note :)
local:note($note), local:note($note),
(: bibl :) (: bibl :)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment