/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ markup::define! { SearchPage { h1 { @trs(&lang, "search.title") } form[action="", method="GET"] { input[type="text", name="query", placeholder=&*tr(lang, "search.placeholder"), value=&query]; input[type="submit", value="Search"]; } @if let Some((count, results, search_dur)) = &results { h2 { @trs(&lang, "search.results.title") } p.stats { @tr(lang, "search.results.stats").replace("{count}", &count.to_string()).replace("{dur}", &format!("{search_dur:?}")) } ul.children {@for (node, udata) in results.iter() { li { @NodeCard { node, udata, lang: &lang } } }} // TODO pagination } } } pub fn search_page() { LayoutPage { title: tr(lang, "search.title").to_string(), class: Some("search"), content: SearchPage, } }