2024-12-05 13:00:17 +00:00
|
|
|
@import nu.marginalia.search.model.DecoratedSearchResults
|
|
|
|
@import nu.marginalia.search.model.ClusteredUrlDetails
|
|
|
|
@import nu.marginalia.search.model.NavbarModel
|
|
|
|
@import nu.marginalia.search.model.ResultsPage
|
|
|
|
|
|
|
|
@param DecoratedSearchResults results
|
|
|
|
@param NavbarModel navbar
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
@template.part.head(title = "Marginalia Search - " + results.getQuery())
|
|
|
|
|
2024-12-13 14:22:01 +00:00
|
|
|
<body class="min-h-screen bg-slate-100 dark:bg-gray-900 dark:text-white font-sans " >
|
2024-12-05 13:00:17 +00:00
|
|
|
@template.part.navbar(navbar = navbar)
|
|
|
|
|
|
|
|
<div>
|
2024-12-13 14:22:01 +00:00
|
|
|
<header class="border-b border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 shadow-md">
|
2024-12-05 13:00:17 +00:00
|
|
|
<div class="max-w-[1400px] mx-auto px-4 py-2 sm:py-4">
|
|
|
|
<div class="flex items-center">
|
2024-12-09 13:55:37 +00:00
|
|
|
<div class="hidden sm:block md:w-32 md:mr-16 md:ml-16"><h1 class="text-md sm:text-xl mr-8 font-serif whitespace-nowrap"><a href="/">Marginalia Search</a></h1></div>
|
|
|
|
<div class="w-full p-2 border-none backdrop-blur-sm">
|
2024-12-05 13:00:17 +00:00
|
|
|
@template.serp.part.searchform(query = results.getParams().query(), profile = results.getProfile(), filters = results.getFilters())
|
|
|
|
</div>
|
|
|
|
<div class="grow"></div>
|
2024-12-09 14:07:23 +00:00
|
|
|
<button class="fixed bottom-10 right-5 sm:hidden text-sm bg-margeblue text-white p-4 rounded-xl active:text-slate-200" id="filter-button">
|
2024-12-05 13:00:17 +00:00
|
|
|
<i class="fas fa-filter mr-3"></i>
|
|
|
|
Filters
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="max-w-[1400px] mx-auto flex gap-6">
|
|
|
|
<!-- Sidebar -->
|
|
|
|
@template.serp.part.sidebar(filters = results.getFilters())
|
|
|
|
|
|
|
|
<!-- Main content -->
|
2024-12-09 13:45:45 +00:00
|
|
|
<main class="flex-1 py-4 p-2 sm:p-4 max-w-3xl space-y-4">
|
2024-12-05 13:00:17 +00:00
|
|
|
|
|
|
|
@if (results.hasFocusDomain())
|
2024-12-25 14:06:05 +00:00
|
|
|
<div class="border dark:border-gray-600 rounded flex space-x-4 bg-white dark:bg-gray-800 text-gray-600 dark:text-gray-100 text-sm p-4 items-center">
|
2024-12-13 14:22:01 +00:00
|
|
|
<div>Showing results from <a class="underline text-liteblue dark:text-blue-200" href="/site/${results.getFocusDomain()}">${results.getFocusDomain()}</a></div>
|
2024-12-05 13:00:17 +00:00
|
|
|
<div class="grow"></div>
|
|
|
|
<a href="${results.getParams().renderUrlWithoutSiteFocus()}" class="fa fa-remove"></a>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2024-12-09 13:45:45 +00:00
|
|
|
<div class="space-y-4 sm:space-y-6">
|
2024-12-05 13:00:17 +00:00
|
|
|
<!-- Result items -->
|
|
|
|
@for(ClusteredUrlDetails details : results.results)
|
|
|
|
@template.serp.part.result(result = details, parameters = results.getParams(), domainSearch = results.hasFocusDomain())
|
|
|
|
@endfor
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Pagination -->
|
|
|
|
@if (results.getResultPages().size() > 1)
|
|
|
|
<div class="mt-8 flex justify-center space-x-2 font-mono text-sm">
|
|
|
|
@for(ResultsPage page : results.getResultPages())
|
|
|
|
@if (page.current())
|
2024-12-13 14:22:01 +00:00
|
|
|
<a href="${results.getParams().withPage(page.number()).renderUrl()}" class="px-2 py-1 border dark:border-gray-600 border-gray-300 bg-gray-100 dark:bg-gray-900">${page.number()}</a>
|
2024-12-05 13:00:17 +00:00
|
|
|
@else
|
2024-12-13 14:22:01 +00:00
|
|
|
<a href="${results.getParams().withPage(page.number()).renderUrl()}" class="px-2 py-1 bg-white border dark:border-gray-600 border-gray-300 hover:bg-gray-100 dark:bg-gray-800 hover:bg-gray-900">${page.number()}</a>
|
2024-12-05 13:00:17 +00:00
|
|
|
@endif
|
|
|
|
@endfor
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@template.serp.part.footerHowto()
|
|
|
|
|
|
|
|
@template.part.footerLegal()
|
|
|
|
|
|
|
|
<%-- Put this last to not bother SR users with double menus --%>
|
|
|
|
@template.serp.part.mobile-menu(filters = results.getFilters())
|
|
|
|
|
|
|
|
</body>
|
2024-12-06 20:38:36 +00:00
|
|
|
<script lang="javascript" src="js/mobile-button.js"></script>
|
|
|
|
<script lang="javascript" src="js/typeahead.js"></script>
|
|
|
|
|
2024-12-05 13:00:17 +00:00
|
|
|
</html>
|