]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/header/search-typeahead.component.html
First implem global search
[github/Chocobozzz/PeerTube.git] / client / src / app / header / search-typeahead.component.html
1 <div class="d-inline-flex position-relative" id="typeahead-container">
2 <input
3 type="text" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, channels…"
4 [(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)" (keydown.enter)="doSearch()"
5 aria-label="Search" autocomplete="off"
6 >
7 <span class="icon icon-search" (click)="doSearch()"></span>
8
9 <div class="position-absolute jump-to-suggestions">
10
11 <ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0">
12 <li
13 *ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5"
14 role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionlicked(result)"
15 >
16 <my-suggestion [result]="result" [highlight]="search"></my-suggestion>
17 </li>
18 </ul>
19
20 <!-- suggestion help, not shown until one of the suggestions is selected and specific to that suggestion -->
21 <div *ngIf="showSearchGlobalHelp()" id="typeahead-help" class="overflow-hidden">
22 <div class="d-flex justify-content-between">
23 <label class="small-title" i18n>GLOBAL SEARCH</label>
24 <div class="advanced-search-status text-muted">
25 <span *ngIf="serverConfig" class="mr-1" i18n>using {{ serverConfig.search.searchIndex.url }}</span>
26 <i class="glyphicon glyphicon-globe"></i>
27 </div>
28 </div>
29 <div class="text-muted" i18n>Results will be augmented with those of a third-party index. Only data necessary to make the query will be sent.</div>
30 </div>
31
32 <!-- search instructions, when search input is empty -->
33 <div *ngIf="areInstructionsDisplayed()" id="typeahead-instructions" class="overflow-hidden">
34 <div class="d-flex justify-content-between">
35 <label class="small-title" i18n>ADVANCED SEARCH</label>
36 <div class="advanced-search-status c-help">
37 <span [ngClass]="canSearchAnyURI ? 'text-success' : 'text-muted'" i18n-title title="Determines whether you can resolve any distant content, or if this instance only allows doing so for instances it follows.">
38 <span *ngIf="canSearchAnyURI()" class="mr-1" i18n>any instance</span>
39 <span *ngIf="!canSearchAnyURI()" class="mr-1" i18n>only followed instances</span>
40 <i [ngClass]="canSearchAnyURI() ? 'glyphicon glyphicon-ok-sign' : 'glyphicon glyphicon-exclamation-sign'"></i>
41 </span>
42 </div>
43 </div>
44 <ul>
45 <li>
46 <em>@channel_id@domain</em> <span class="flex-auto text-muted" i18n>will list the matching channel</span>
47 </li>
48 <li>
49 <em>URL</em> <span class="text-muted" i18n>will list the matching channel</span>
50 </li>
51 <li>
52 <em>UUID</em> <span class="text-muted" i18n>will list the matching video</span>
53 </li>
54 </ul>
55 <span class="text-muted" i18n>Any other input will return matching video or channel names.</span>
56 </div>
57 </div>
58
59 </div>