abaev-basex/xq/site/components/index.xq

49 lines
No EOL
1.5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module namespace index = 'http://ossetic-studies.org/ns/abaevdict-site/index';
import module namespace shared = 'http://ossetic-studies.org/ns/abaevdict-site/shared' at '../shared/shared.xq';
declare function index:content($lang as xs:string) {
let $mlangs := doc(`abaevdict_index/langnames.xml`)/csv[1]/record
return
<html>
{shared:head('HEDO Index', <script src="/static/abaev-index.js"></script>)}
<body>
{shared:header($lang, `../{shared:invert-lang($lang)}/index`)}
<main>
<div class="index">
<div class="langs">
<label>{if ($lang = 'ru') then 'Языки' else 'Languages'}</label>
<select id="abv-select-lang" size="99999">
{
for $mlang in $mlangs
let $mlang-id := $mlang/code/text()
let $mlang-name := if ($lang = 'ru') then $mlang/ru/text() else $mlang/en/text()
where $mlang-name != ''
order by $mlang-name
return
<option value="{$mlang-id}">
{
$mlang-name
}
</option>
}
</select>
</div>
<div class="forms">
<Label>{if ($lang = 'ru') then 'Формы' else 'Forms'}</Label>
<select id="abv-select-word" size="99999">
</select>
</div>
<div class="entries">
<Label>{if ($lang = 'ru') then 'Лексемы' else 'Lexemes'}</Label>
<select id="abv-select-entry" size="99999">
</select>
</div>
</div>
<div class="index-submit">
<button id="btn-index-submit" hidden="1">{if ($lang = 'ru') then 'К форме' else 'Go to form'}</button>
</div>
</main>
</body>
</html>
};