search results modal
This commit is contained in:
parent
0b4fd5f468
commit
6e7cf5a3f1
3 changed files with 150 additions and 59 deletions
|
@ -120,7 +120,7 @@ declare function page:header($lang as xs:string, $href-other as xs:string) {
|
|||
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/>
|
||||
</svg>
|
||||
</button>,
|
||||
<button disabled="true">{session:get('searchN')}/{array:size(session:get('searchData'))}</button>
|
||||
<button type="button" id="abv-btn-searchResults">{session:get('searchN')}/{array:size(session:get('searchData'))}</button>
|
||||
,
|
||||
if (session:get('searchN') and session:get('searchN') < array:size(session:get('searchData'))) then
|
||||
<button type="button" class="link" data-href="./search/next">
|
||||
|
@ -208,7 +208,17 @@ declare %rest:path("{$lang}/search/prev")
|
|||
let $r1 := session:set('searchN', $n)
|
||||
let $sd := session:get('searchData')
|
||||
return page:by-id($lang, $sd($n)('entry_id'), string-join($sd($n)('path')?*,"|"))
|
||||
};
|
||||
};
|
||||
|
||||
declare %rest:path("{$lang}/search/position")
|
||||
%rest:query-param("p", "{$p}")
|
||||
%output:method("html")
|
||||
%output:html-version('5')
|
||||
function page:search-position($lang,$p) {
|
||||
let $r1 := session:set('searchN', $p)
|
||||
let $sd := session:get('searchData')
|
||||
return page:by-id($lang, $sd($p)('entry_id'), string-join($sd($p)('path')?*,"|"))
|
||||
};
|
||||
|
||||
declare %rest:path("{$lang}/search/clear")
|
||||
%output:method("html")
|
||||
|
@ -543,18 +553,61 @@ declare %rest:path("{$lang}/dict")
|
|||
<!-- Modal for map display -->
|
||||
<dialog id="modal_map">
|
||||
<article>
|
||||
<header><button class="abv-close-map" aria-label="Close" rel="prev"></button>
|
||||
<p>Map</p>
|
||||
<header>
|
||||
<button class="abv-close-map" aria-label="Close" rel="prev">
|
||||
</button>
|
||||
<p>{if ($lang = 'ru') then 'Карта' else 'Map'}</p>
|
||||
</header>
|
||||
<p>
|
||||
<div id="map_display" style="width:100%;height:80%;"></div>
|
||||
</p>
|
||||
<footer><button class="abv-close-map">Close</button></footer>
|
||||
<footer><button class="abv-close-map">{if ($lang = 'ru') then 'Закрыть' else 'Close'}</button></footer>
|
||||
</article>
|
||||
</dialog>
|
||||
|
||||
{if (session:get('searchQuery')) then
|
||||
<!-- Modal for search results -->
|
||||
{if (exists(session:get('searchData'))) then
|
||||
<dialog id="modal_searchResults">
|
||||
<article>
|
||||
<header>
|
||||
<button class="abv-close-search" aria-label="Close" rel="prev"/>
|
||||
<p>{if ($lang = 'ru') then 'Результаты поиска'
|
||||
else 'Search results'}</p>
|
||||
</header>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{if ($lang = 'ru') then '№' else 'No.'}</td>
|
||||
<td>{if ($lang = 'ru') then 'Лемма' else 'Lemma'}</td>
|
||||
<td>{if ($lang = 'ru') then 'Фрагмент' else 'Fragment'}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
for $res in session:get('searchData')?*
|
||||
count $pos
|
||||
return <tr>
|
||||
<td>{$pos}</td>
|
||||
<td>
|
||||
<a href="./search/position?p={$pos}">
|
||||
{
|
||||
abv-m:entry-form-by-id($res('entry_id'))
|
||||
}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{
|
||||
xquery:eval($res('path')(1), {'': doc(`abaevdict_{$lang}/xml/{$res('entry_id')}.xml`)})
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<button class="abv-close-search">{if ($lang = 'ru') then 'Закрыть' else 'Close'}</button>
|
||||
</footer>
|
||||
</article>
|
||||
</dialog>}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue