Commit a44cf19f authored by mrodzis's avatar mrodzis 🌎
Browse files

Revert "Implement entities in work index, general formatting"

This reverts commit 09e82c16.
parent a6d11661
......@@ -779,16 +779,9 @@ return
(: note :)
ixp:note($note),
(: where :)
for $where in $wheres return
element xhtml:li {
attribute class { "where" },
element xhtml:a {
attribute href { "register.html?e="|| $where },
<xhtml:i class="fa fa-map-marker" aria-hidden="true"></xhtml:i>,
"&#160;",
$ixp:dataCollection/id($where)/*[1]/string()
}
},
for $where in $wheres
return
ixp:data-loader($ixp:dataCollection/id($where)),
(: bibl :)
ixp:bibl($bibl),
(: links :)
......@@ -1092,14 +1085,7 @@ else
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;",
$ixp:dataCollection/id($memberId)/*[1]/string()
}
}
ixp:data-loader($ixp:dataCollection/id($memberId))
}
},
if (not(exists($creator))) then () else
......@@ -1210,6 +1196,15 @@ else
let $tookPlaceAt := $place/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P7_took_place_at"]
let $formerCurrentLocation := $place/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P53_has_former_or_current_location"]
let $links := $place/tei:linkGrp/tei:link[@corresp="https://schema.org/mentions"]
let $itemRefs := $ixp:dataCollection//tei:link
[@corresp="http://erlangen-crm.org/current/P53_has_former_or_current_location"]
[ends-with(@target, " plc:" || $id)]/parent::tei:linkGrp/parent::tei:*
let $itemsRefNodes := for $item in $itemRefs
let $node := ixp:data-loader($item)
order by string($node)
return
$node
return
element xhtml:li {
attribute id { string($id) },
......@@ -1270,17 +1265,13 @@ else
for $l in $tookPlaceAt
let $id := $l/@target => substring-after(":") => substring-before(" ")
return
element xhtml:li {
attribute class { "took-place-at" },
element xhtml:a {
attribute href { "?e=" || $id },
<xhtml:i class="fa fa-flag" aria-hidden="true"></xhtml:i>,
"&#160;",
$ixp:dataCollection/id($id)/*[1]/string()
}
},
ixp:data-loader($ixp:dataCollection/id($id)),
(: former_or_current_location :)
ixp:has-former-or-current-location($formerCurrentLocation),
(: entries referencing this entity :)
if($itemsRefNodes)
then <xhtml:ul class="itemsRef"> { $itemsRefNodes } </xhtml:ul>
else (),
(: links :)
ixp:links($place),
ixp:li-code($place),
......@@ -1493,3 +1484,35 @@ else
}
}
};
(:~
: A generic list item that is enabled for loading the entry it points to
: via ajax call.
: @author Mathias Göbel
: @param $targetNode The TEI element to load in place
: @return a xhtml:li with the title and an icon to click for loading the entry
:)
declare function ixp:data-loader($targetNode as element())
as element(xhtml:li) {
let $targetId := string($targetNode/@xml:id)
let $title := string($targetNode/*[1])
return
element xhtml:li {
attribute class { "registerEintrag", $targetNode/local-name() },
element xhtml:a {
attribute href { "register.html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else $title
},
text{ "&#8195;" },
element xhtml:span {
attribute class { "load-entity" },
attribute data-load { $targetId },
element xhtml:i {
attribute class {"fa fa-plus-square-o"},
attribute aria-hidden {"true"}
}
}
}
};
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