]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+search/search-filters.component.html
Add ability to filter by host in search page
[github/Chocobozzz/PeerTube.git] / client / src / app / +search / search-filters.component.html
1 <form role="form" (ngSubmit)="formUpdated()">
2
3 <div class="row">
4 <div class="col-lg-4 col-md-6 col-xs-12">
5 <div class="form-group">
6 <div class="radio-label label-container">
7 <label i18n>Sort</label>
8 <button i18n class="reset-button reset-button-small" (click)="resetField('sort', '-match')" *ngIf="advancedSearch.sort !== '-match'">
9 Reset
10 </button>
11 </div>
12
13 <div class="peertube-radio-container" *ngFor="let sort of sorts">
14 <input type="radio" name="sort" [id]="sort.id" [value]="sort.id" [(ngModel)]="advancedSearch.sort">
15 <label [for]="sort.id" class="radio">{{ sort.label }}</label>
16 </div>
17 </div>
18
19 <div class="form-group">
20 <div class="radio-label label-container">
21 <label i18n>Display only</label>
22 <button i18n class="reset-button reset-button-small" (click)="resetField('isLive')" *ngIf="advancedSearch.isLive !== undefined">
23 Reset
24 </button>
25 </div>
26
27 <div class="peertube-radio-container">
28 <input type="radio" name="isLive" id="isLiveTrue" value="true" [(ngModel)]="advancedSearch.isLive">
29 <label i18n for="isLiveTrue" class="radio">Live videos</label>
30 </div>
31
32 <div class="peertube-radio-container">
33 <input type="radio" name="isLive" id="isLiveFalse" value="false" [(ngModel)]="advancedSearch.isLive">
34 <label i18n for="isLiveFalse" class="radio">VOD videos</label>
35 </div>
36 </div>
37
38 <div class="form-group">
39 <div class="radio-label label-container">
40 <label i18n>Display sensitive content</label>
41 <button i18n class="reset-button reset-button-small" (click)="resetField('nsfw')" *ngIf="advancedSearch.nsfw !== undefined">
42 Reset
43 </button>
44 </div>
45
46 <div class="peertube-radio-container">
47 <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw">
48 <label i18n for="sensitiveContentYes" class="radio">Yes</label>
49 </div>
50
51 <div class="peertube-radio-container">
52 <input type="radio" name="sensitiveContent" id="sensitiveContentNo" value="false" [(ngModel)]="advancedSearch.nsfw">
53 <label i18n for="sensitiveContentNo" class="radio">No</label>
54 </div>
55 </div>
56
57 <div class="form-group">
58 <div class="radio-label label-container">
59 <label i18n>Published date</label>
60 <button i18n class="reset-button reset-button-small" (click)="resetLocalField('publishedDateRange')" *ngIf="publishedDateRange !== undefined">
61 Reset
62 </button>
63 </div>
64
65 <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges">
66 <input type="radio" (change)="onDurationOrPublishedUpdated()" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange">
67 <label [for]="date.id" class="radio">{{ date.label }}</label>
68 </div>
69 </div>
70
71 <div class="form-group">
72 <div class="label-container">
73 <label i18n for="original-publication-after">Original publication year</label>
74 <button i18n class="reset-button reset-button-small" (click)="resetOriginalPublicationYears()" *ngIf="originallyPublishedStartYear || originallyPublishedEndYear">
75 Reset
76 </button>
77 </div>
78
79 <div class="row">
80 <div class="pl-0 col-sm-6">
81 <input
82 (change)="onDurationOrPublishedUpdated()"
83 (keydown.enter)="$event.preventDefault()"
84 type="text" id="original-publication-after" name="original-publication-after"
85 i18n-placeholder placeholder="After..."
86 [(ngModel)]="originallyPublishedStartYear"
87 class="form-control"
88 >
89 </div>
90 <div class="pr-0 col-sm-6">
91 <input
92 (change)="onDurationOrPublishedUpdated()"
93 (keydown.enter)="$event.preventDefault()"
94 type="text" id="original-publication-before" name="original-publication-before"
95 i18n-placeholder placeholder="Before..."
96 [(ngModel)]="originallyPublishedEndYear"
97 class="form-control"
98 >
99 </div>
100 </div>
101 </div>
102
103 </div>
104
105 <div class="col-lg-4 col-md-6 col-xs-12">
106 <div class="form-group">
107 <div class="radio-label label-container">
108 <label i18n>Duration</label>
109 <button i18n class="reset-button reset-button-small" (click)="resetLocalField('durationRange')" *ngIf="durationRange !== undefined">
110 Reset
111 </button>
112 </div>
113
114 <div class="peertube-radio-container" *ngFor="let duration of durationRanges">
115 <input type="radio" (change)="onDurationOrPublishedUpdated()" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange">
116 <label [for]="duration.id" class="radio">{{ duration.label }}</label>
117 </div>
118 </div>
119
120 <div class="form-group">
121 <label i18n for="category">Category</label>
122 <button i18n class="reset-button reset-button-small" (click)="resetField('categoryOneOf')" *ngIf="advancedSearch.categoryOneOf !== undefined">
123 Reset
124 </button>
125 <div class="peertube-select-container">
126 <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf" class="form-control">
127 <option [value]="undefined" i18n>Display all categories</option>
128 <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
129 </select>
130 </div>
131 </div>
132
133 <div class="form-group">
134 <label i18n for="licence">Licence</label>
135 <button i18n class="reset-button reset-button-small" (click)="resetField('licenceOneOf')" *ngIf="advancedSearch.licenceOneOf !== undefined">
136 Reset
137 </button>
138 <div class="peertube-select-container">
139 <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf" class="form-control">
140 <option [value]="undefined" i18n>Display all licenses</option>
141 <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
142 </select>
143 </div>
144 </div>
145
146 <div class="form-group">
147 <label i18n for="language">Language</label>
148 <button i18n class="reset-button reset-button-small" (click)="resetField('languageOneOf')" *ngIf="advancedSearch.languageOneOf !== undefined">
149 Reset
150 </button>
151 <div class="peertube-select-container">
152 <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf" class="form-control">
153 <option [value]="undefined" i18n>Display all languages</option>
154 <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option>
155 </select>
156 </div>
157 </div>
158 </div>
159
160 <div class="col-lg-4 col-md-6 col-xs-12">
161 <div class="form-group">
162 <label i18n for="tagsAllOf">All of these tags</label>
163 <button i18n class="reset-button reset-button-small" (click)="resetField('tagsAllOf')" *ngIf="advancedSearch.tagsAllOf">
164 Reset
165 </button>
166 <my-select-tags name="tagsAllOf" labelForId="tagsAllOf" id="tagsAllOf" [(ngModel)]="advancedSearch.tagsAllOf"></my-select-tags>
167 </div>
168
169 <div class="form-group">
170 <label i18n for="tagsOneOf">One of these tags</label>
171 <button i18n class="reset-button reset-button-small" (click)="resetField('tagsOneOf')" *ngIf="advancedSearch.tagsOneOf">
172 Reset
173 </button>
174 <my-select-tags name="tagsOneOf" labelForId="tagsOneOf" id="tagsOneOf" [(ngModel)]="advancedSearch.tagsOneOf"></my-select-tags>
175 </div>
176
177 <div class="form-group">
178 <label i18n for="host">PeerTube instance host</label>
179
180 <input (change)="onDurationOrPublishedUpdated()" (keydown.enter)="$event.preventDefault()" type="text" id="host" name="host"
181 placeholder="example.com" [(ngModel)]="advancedSearch.host" class="form-control"
182 >
183 </div>
184
185 <div class="form-group" *ngIf="isSearchTargetEnabled()">
186 <div class="radio-label label-container">
187 <label i18n>Search target</label>
188 </div>
189
190 <div class="peertube-radio-container">
191 <input type="radio" name="searchTarget" id="searchTargetLocal" value="local" [(ngModel)]="advancedSearch.searchTarget">
192 <label i18n for="searchTargetLocal" class="radio">Instance</label>
193 </div>
194
195 <div class="peertube-radio-container">
196 <input type="radio" name="searchTarget" id="searchTargetSearchIndex" value="search-index" [(ngModel)]="advancedSearch.searchTarget">
197 <label i18n for="searchTargetSearchIndex" class="radio">Vidiverse</label>
198 </div>
199 </div>
200 </div>
201 </div>
202
203 <div class="submit-button">
204 <button i18n class="reset-button" (click)="reset()" *ngIf="advancedSearch.size()">
205 Reset
206 </button>
207
208 <input type="submit" i18n-value value="Filter">
209 </div>
210 </form>