navbar search removed where it shouldnt be

This commit is contained in:
Priec
2026-06-25 14:56:19 +02:00
parent d68ed5ce7c
commit c0f4d0c93c
3 changed files with 7 additions and 15 deletions

View File

@@ -108,10 +108,10 @@
</span> </span>
</a> </a>
<!-- in-header search → existing GET /search (q param). Hidden on small <!-- in-header search → existing GET /search (q param). Only on the home
screens (a compact copy lives in the mobile menu panel below), and on page; elsewhere the shop's own toolbar carries the search box. Hidden
the shop page (whose listing toolbar carries its own search box). --> on small screens (a compact copy lives in the mobile menu below). -->
{% if not on_shop | default(value=false) %} {% if on_home | default(value=false) %}
<form action="/search" method="get" role="search" class="hidden min-w-0 flex-1 md:flex md:max-w-xl"> <form action="/search" method="get" role="search" class="hidden min-w-0 flex-1 md:flex md:max-w-xl">
<div class="flex min-w-0 flex-1 overflow-hidden rounded-radius border border-outline transition focus-within:border-primary dark:border-outline-dark dark:focus-within:border-primary-dark"> <div class="flex min-w-0 flex-1 overflow-hidden rounded-radius border border-outline transition focus-within:border-primary dark:border-outline-dark dark:focus-within:border-primary-dark">
<span class="pointer-events-none flex items-center bg-surface-alt pl-3.5 text-on-surface/40 dark:bg-surface-dark-alt dark:text-on-surface-dark/40">{{ ui::icon(name="search", size="size-[18px]") }}</span> <span class="pointer-events-none flex items-center bg-surface-alt pl-3.5 text-on-surface/40 dark:bg-surface-dark-alt dark:text-on-surface-dark/40">{{ ui::icon(name="search", size="size-[18px]") }}</span>
@@ -213,7 +213,7 @@
underline focus), active state via data-nav + markActiveNav() --> underline focus), active state via data-nav + markActiveNav() -->
<ul x-show="mobile" x-cloak @click.outside="mobile = false" x-transition <ul x-show="mobile" x-cloak @click.outside="mobile = false" x-transition
class="absolute inset-x-0 top-full mx-4 mt-2 flex flex-col gap-1 rounded-radius border border-outline bg-surface p-2 shadow-lg md:hidden dark:border-outline-dark dark:bg-surface-dark-alt"> class="absolute inset-x-0 top-full mx-4 mt-2 flex flex-col gap-1 rounded-radius border border-outline bg-surface p-2 shadow-lg md:hidden dark:border-outline-dark dark:bg-surface-dark-alt">
{% if not on_shop | default(value=false) %} {% if on_home | default(value=false) %}
<li class="mb-1"> <li class="mb-1">
<form action="/search" method="get" role="search" class="flex overflow-hidden rounded-radius border border-outline dark:border-outline-dark"> <form action="/search" method="get" role="search" class="flex overflow-hidden rounded-radius border border-outline dark:border-outline-dark">
<input type="search" name="q" autocomplete="off" <input type="search" name="q" autocomplete="off"

View File

@@ -30,6 +30,8 @@ async fn index(
"customer_account_type": c.customer_account_type, "customer_account_type": c.customer_account_type,
"currency_symbol": cur.symbol, "currency_symbol": cur.symbol,
"lang": current_lang(&jar), "lang": current_lang(&jar),
// The header search bar only appears on the landing page.
"on_home": true,
}), }),
) )
} }

View File

@@ -340,11 +340,6 @@ async fn index(
let mut context = run_search(&ctx, user.as_ref(), &SearchParams::default(), &cur).await?; let mut context = run_search(&ctx, user.as_ref(), &SearchParams::default(), &cur).await?;
let c = guard::chrome_from(&ctx, user.as_ref()); let c = guard::chrome_from(&ctx, user.as_ref());
add_chrome(&mut context, &c, &current_lang(&jar)); add_chrome(&mut context, &c, &current_lang(&jar));
// The shop page carries its own search box in the listing toolbar, so the
// header search bar is redundant here — flag it so base.html can hide it.
if let Some(map) = context.as_object_mut() {
map.insert("on_shop".into(), json!(true));
}
format::view(&v, "shop/index.html", context) format::view(&v, "shop/index.html", context)
} }
@@ -382,11 +377,6 @@ async fn search(
let c = guard::chrome_from(&ctx, user.as_ref()); let c = guard::chrome_from(&ctx, user.as_ref());
add_chrome(&mut context, &c, &lang); add_chrome(&mut context, &c, &lang);
// The shop page carries its own search box in the listing toolbar, so the
// header search bar is redundant here — flag it so base.html can hide it.
if let Some(map) = context.as_object_mut() {
map.insert("on_shop".into(), json!(true));
}
format::view(&v, "shop/index.html", context) format::view(&v, "shop/index.html", context)
} }