Commit c109326c authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

rework index api for register.html

parent 45582b1f
......@@ -100,7 +100,7 @@ return
let $index := (collection($index:dataPath)/id($ref))[1]
let $name := string($index/*[1])
let $list := index:get-list-by-id($ref)
let $href := "register-" || $list || ".html?e=" || $ref
let $href := "register.html?e=" || $ref
order by $name
return
element xhtml:li {
......@@ -235,12 +235,14 @@ return
array{
for $hit in $hits
let $id := string($hit/@xml:id)
let $target := if($id) then $id else
$hit/tei:note/tei:ptr/substring-after(@target, "#")
let $list := index:get-list-by-node($hit)
where $list = $prepare
return
map{
"name": string($hit/*[1]),
"id": $id,
"id": $target,
"list": $list,
"type": $hit/local-name()
}
......
......@@ -370,7 +370,7 @@ element xhtml:li {
element xhtml:li {
attribute class {"item"},
element xhtml:a {
attribute href { "register-" || $htmlResource || ".html?e=" || string-join($targetId) },
attribute href { "register.html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else string($targetNode/*[1])
......@@ -410,7 +410,7 @@ element xhtml:li {
element xhtml:li {
attribute class {"person"},
element xhtml:a {
attribute href { "register-" || $htmlResource || ".html?e=" || string-join($targetId) },
attribute href { "register.html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else string($targetNode/*[1])
......@@ -447,7 +447,7 @@ return
element xhtml:li {
attribute class { "former-or-current-location" },
element xhtml:a {
attribute href { "register-" || $list || ".html?e=" || $id },
attribute href { "register.html?e=" || $id },
<xhtml:i class="fa fa-map-marker" aria-hidden="true"></xhtml:i>,
"&#160;",
$targetNode/*[1]/string(),
......@@ -531,7 +531,7 @@ as element(xhtml:span) {
attribute class {"registerLink"},
element xhtml:a {
attribute href {
"register-" || local:get-list-by-entity($id/parent::*) || ".html?e=" || $id
"register.html?e=" || $id
},
<xhtml:i title="Link zu diesem Eintrag" class="fa fa-link"></xhtml:i>
}
......@@ -710,7 +710,7 @@ return
element xhtml:li {
attribute class { "where" },
element xhtml:a {
attribute href { "register-listPlace.html?e="|| $where },
attribute href { "register.html?e="|| $where },
<xhtml:i class="fa fa-map-marker" aria-hidden="true"></xhtml:i>,
"&#160;",
$f-indexproc:dataCollection/id($where)/*[1]/string()
......
......@@ -230,5 +230,8 @@ else true()
};
declare function f-indexviewer:item($node, $map, $e as xs:string?) {
index:rendered-entity($e)
if(string-length($e) lt 2)
then
index:rendered-entity($e)
else ()
};
......@@ -727,9 +727,9 @@ declare function transfo:add($add as element(tei:add)) {
declare function transfo:add($add as element(tei:add), $force as xs:boolean) {
if( $add/@corresp and not($add/@type="multiphrase") and not($force) ) then () else
if($add[@place = ('above', 'below')]/contains(@rend, 'caret'))
then
then
transfo:add-worker($add)
else
transfo:add-worker($add),
if($add/@rend = "|")
......@@ -2366,7 +2366,7 @@ declare function local:teiref2href($ref as xs:string) as xs:string {
case "lit" return $transfo:base-url || "literaturvz.html?id=" || $id
default return
let $listName := index:get-list-by-id($id)
return $transfo:base-url || "register-" || $listName || ".html?e=" || $id
return $transfo:base-url || "register.html?e=" || $id
};
declare function transfo:figure($node as node()*) {
......
Markdown is supported
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