Improve search UI (#375)

This commit is contained in:
Baptiste Gelez
2019-01-28 13:12:56 +01:00
committed by GitHub
parent 716c58cb71
commit 5880dc1957
15 changed files with 1359 additions and 500 deletions
+8
View File
@@ -30,6 +30,10 @@
</nav>
<nav>
@if ctx.2.is_some() {
<a href="@uri!(search::search: _)">
<i class="icon icon-search"></i>
<span class="mobile-label">@i18n!(ctx.1, "Search")</span>
</a>
<a href="@uri!(user::dashboard)">
<i class="icon icon-home" aria-label="@i18n!(ctx.1, "Dashboard")"></i>
<span class="mobile-label">@i18n!(ctx.1, "Dashboard")</span>
@@ -47,6 +51,10 @@
<span class="mobile-label">@i18n!(ctx.1, "My account")</span>
</a>
} else {
<a href="@uri!(search::search: _)">
<i class="icon icon-search"></i>
<span class="mobile-label">@i18n!(ctx.1, "Search")</span>
</a>
<a href="@uri!(session::new: m = _)">
<i class="icon icon-log-in"></i>
<span class="mobile-label">@i18n!(ctx.1, "Log In")</span>
+14 -15
View File
@@ -6,23 +6,22 @@
@:base(ctx, "Search", {}, {}, {
<h1>@i18n!(ctx.1, "Search")</h1>
<form method="get" id="form">
<input id="q" name="q" placeholder="Your search query" type="search">
<br/>
<input id="q" name="q" placeholder="@i18n!(ctx.1, "Your query")" type="search">
<details>
<summary>Advanced search</summary>
@input!(ctx.1, title (text), "Article title matching these words", "placeholder=\"Title\"")
@input!(ctx.1, subtitle (text), "Subtitle matching these words", "placeholder=\"Subtitle - byline\"")
@input!(ctx.1, content (text), "Content matching these words", "placeholder=\"Body content\"")
@input!(ctx.1, after (date), "From this date", &format!("max={}", now))
@input!(ctx.1, before (date), "To this date", &format!("max={}", now))
<summary>@i18n!(ctx.1, "Advanced search")</summary>
@input!(ctx.1, title (text), "Article title matching these words", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Title")))
@input!(ctx.1, subtitle (text), "Subtitle matching these words", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Subtitle byline")))
@input!(ctx.1, content (text), "Content matching these words", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Body content")))
@input!(ctx.1, after (date), "From this date", &format!("max={}", now))
@input!(ctx.1, before (date), "To this date", &format!("max={}", now))
@input!(ctx.1, tag (text), "Containing these tags", "placeholder=\"Tags\"")
@input!(ctx.1, instance (text), "Posted on one of these instances", "placeholder=\"Instance domain\"")
@input!(ctx.1, author (text), "Posted by one of these authors", "placeholder=\"Authors\"")
@input!(ctx.1, blog (text), "Posted on one of these blogs", "placeholder=\"Blog title\"")
@input!(ctx.1, lang (text), "Written in this language", "placeholder=\"Language\"")
@input!(ctx.1, license (text), "Published under this license", "placeholder=\"Article License\"")
@input!(ctx.1, tag (text), "Containing these tags", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Tags")))
@input!(ctx.1, instance (text), "Posted on one of these instances", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Instance domain")))
@input!(ctx.1, author (text), "Posted by one of these authors", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Authors")))
@input!(ctx.1, blog (text), "Posted on one of these blogs", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Blog title")))
@input!(ctx.1, lang (text), "Written in this language", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Language")))
@input!(ctx.1, license (text), "Published under this license", &format!("placeholder=\"{}\"", i18n!(ctx.1, "Article license")))
</details>
<input type="submit" value="Search"/>
<input type="submit" value="@i18n!(ctx.1, "Search")"/>
</form>
})
+2 -2
View File
@@ -11,9 +11,9 @@
@if articles.is_empty() {
<section>
@if page == 1 {
<h2>@i18n!(ctx.1, "No result for your query")</h2>
<h2>@i18n!(ctx.1, "No result for your query")</h2>
} else {
<h2>@i18n!(ctx.1, "No more result for your query")</h2>
<h2>@i18n!(ctx.1, "No more result for your query")</h2>
}
</section>
} else {