Makeover of searchbar, add "not found" results-redirects

- Tagged Search has priority
- Best guess search if no tag provided
- "Hard" errors only on searchtag-malformed or searchtag-unknown, or if best guess search fails
This commit is contained in:
Christoph Kluge
2023-01-12 11:26:01 +01:00
parent a5298a3630
commit bad3f9ea95
3 changed files with 111 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
<script>
import { Icon, Button, InputGroup, Input, Collapse,
Navbar, NavbarBrand, Nav, NavItem, NavLink, NavbarToggler,
Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'sveltestrap'
Dropdown, DropdownToggle, DropdownMenu, DropdownItem, InputGroupText } from 'sveltestrap'
export let username // empty string if auth. is disabled, otherwise the username as string
export let isAdmin // boolean
@@ -55,8 +55,9 @@
<div class="d-flex">
<form method="GET" action="/search">
<InputGroup>
<Input type="text" placeholder={isAdmin ? "Search jobId/username/projectId" : "Search jobId"} name="searchId"/>
<Input type="text" placeholder="Search 'type:<query>' ..." name="searchId"/>
<Button outline type="submit"><Icon name="search"/></Button>
<InputGroupText style="cursor:help;" title={isAdmin ? "Example: 'projectId:a100cd', Types are: jobId | jobName | projectId | username" : "Example: 'jobName:myjob', Types are jobId | jobName"}><Icon name="info-circle"/></InputGroupText>
</InputGroup>
</form>
{#if username}