inject map link html

This commit is contained in:
Oleg Belyaev 2025-03-21 22:44:51 +03:00
parent 04f2106615
commit d19a835055

View file

@ -40,8 +40,9 @@ declare function page:head($title as xs:string, $script as node()* := ()) {
declare function page:header($lang as xs:string, $href-other as xs:string) {
<header>
<nav>
<ul>
<li><strong>{
<ul class="abv-brand">
<li><img class="abv-logo" src="/static/Abaev_logo.png" alt="Abaevdict logo"></img>
<strong>{
switch($lang)
case 'ru' return 'ИЭСОЯ В.&#160;И.&#160;Абаева'
default return 'Abaevdict'
@ -343,8 +344,15 @@ declare %rest:path("{$lang}/dict")
<main>
{for $doc at $i in $page:sorted
where $i > ($p - 1) * $page:items and $i <= $p * $page:items
let $html := doc(`abaevdict_{$lang}/html/{$doc/@xml:id}.html`)
return $html}
let $html := doc(`abaevdict_{$lang}/html/{$doc/@xml:id}.html`)
return if (doc('abaevdict_index/mentioned_en.xml')/
lang-index/lang/word/entry[@id=string($doc/@xml:id)]) then
$html transform with {insert nodes (<br/>,
<a class="abv-map" data-abv-entry="{$doc/@xml:id}">
<img src="/static/map.png"></img></a>) as last
into ./article[1]/h6[1]}
else $html
}
</main>
<!-- Footer for page navigation -->
@ -356,7 +364,7 @@ declare %rest:path("{$lang}/dict")
</li>
</ul>
<!-- <ul><li>Page {$p} of {$page:total}</li></ul> -->
<ul>
<ul class="abv-nextpage">
<li>
{if ($p < $page:total) then
<a class="pagination__next" href="?page={$p + 1}">Next page</a> else ()}