34 lines
768 B
Plaintext
34 lines
768 B
Plaintext
func Pages.Discover(tytd,ctx)
|
|
{
|
|
|
|
var q = ctx.QueryParams.TryGetFirst("q");
|
|
var res = null;
|
|
var q2 = "";
|
|
if(TypeOf(q) == "String")
|
|
{
|
|
q2 = q;
|
|
res = tytd.Discover(q);
|
|
|
|
}
|
|
|
|
var html = <null>
|
|
<form hx-get="./discover" hx-target="body" hx-push-url="true">
|
|
<div class="field large prefix round fill active">
|
|
<i class="front">search</i>
|
|
<input name="q" value={q2}>
|
|
|
|
</div>
|
|
</form>
|
|
<if(res != null)>
|
|
<true>
|
|
<ul>
|
|
<each(var item : res.items)>
|
|
<li><raw(Components.DiscoverEntry(item))></li>
|
|
</each>
|
|
</ul>
|
|
<button class="responsive">More</button>
|
|
</true></null>;
|
|
|
|
|
|
return Components.Shell($"Discover {q2}",html,1);
|
|
} |