10fb0911cd
Mainly the inclusion/exclusion of facettes got a major rewrite.
45 lines
1.9 KiB
HTML
45 lines
1.9 KiB
HTML
@use super::{base_html, data_positions_html, photo_link_html};
|
|
@use crate::models::Coord;
|
|
@use crate::server::{Context, PhotoLink};
|
|
@use crate::server::search::SearchQuery;
|
|
|
|
@(context: &Context, query: &SearchQuery, n: usize, photos: &[PhotoLink], coords: &[(Coord, i32)])
|
|
@:base_html(context, "Search", &[], {}, {
|
|
<main>
|
|
<h1>Search@if n > 0 { <small class="n_hits">(@n hits)</small>}</h1>
|
|
<form class="search" action="/search/" method="get">
|
|
<label for="s_q" accesskey="s" title="Search">🔍</label>
|
|
<div class="refs">
|
|
@for (p, inc) in &query.p {
|
|
<label class="@if !inc {not }p">@p.person_name <input type="checkbox" name="p" value="@if !inc {!}@p.slug" checked/></label>
|
|
}
|
|
@for (t, inc) in &query.t {
|
|
<label class="@if !inc {not }t">@t.tag_name <input type="checkbox" name="t" value="@if !inc {!}@t.slug" checked/></label>
|
|
}
|
|
@for (l, inc) in &query.l {
|
|
<label class="@if !inc {not }l">@l.place_name <input type="checkbox" name="l" value="@if !inc {!}@l.slug" checked/></label>
|
|
}
|
|
@if let Some(pos) = &query.pos {
|
|
<label@if !pos { class="not"}>pos <input type="checkbox" name="pos" value="@if !pos {!}t" checked/></label>
|
|
}
|
|
<input id="s_q" name="q" type="search"/>
|
|
</div>
|
|
<div class="time">
|
|
<span><input type="date" name="since_date" value="@query.since.date_val()">
|
|
<input type="time" name="since_time" value="@query.since.time_val()" step="1"></span>
|
|
-
|
|
<span><input type="date" name="until_date" value="@query.until.date_val()">
|
|
<input type="time" name="until_time" value="@query.until.time_val()" step="1"></span>
|
|
</div>
|
|
</form>
|
|
@if !query.q.is_empty() {
|
|
<p>Sorry, no raw queries supported yet.
|
|
Try selection some suggestions
|
|
(javascript is needed for this, sorry again).</p>
|
|
}
|
|
<div class="group"@:data_positions_html(coords)>
|
|
@for p in photos {@:photo_link_html(p)}
|
|
</div>
|
|
</main>
|
|
})
|