e20aef8fbad8f942306a60dbdc85ba26165cb677
[oweals/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 sensitive content</label>
22           <button i18n class="reset-button reset-button-small" (click)="resetField('nsfw')" *ngIf="advancedSearch.nsfw !== undefined">
23             Reset
24           </button>
25         </div>
26
27         <div class="peertube-radio-container">
28           <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw">
29           <label i18n for="sensitiveContentYes" class="radio">Yes</label>
30         </div>
31
32         <div class="peertube-radio-container">
33           <input type="radio" name="sensitiveContent" id="sensitiveContentNo" value="false" [(ngModel)]="advancedSearch.nsfw">
34           <label i18n for="sensitiveContentNo" class="radio">No</label>
35         </div>
36       </div>
37
38       <div class="form-group">
39         <div class="radio-label label-container">
40           <label i18n>Published date</label>
41           <button i18n class="reset-button reset-button-small" (click)="resetLocalField('publishedDateRange')" *ngIf="publishedDateRange !== undefined">
42             Reset
43           </button>
44         </div>
45
46         <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges">
47           <input type="radio" (change)="inputUpdated()" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange">
48           <label [for]="date.id" class="radio">{{ date.label }}</label>
49         </div>
50       </div>
51
52       <div class="form-group">
53         <div class="label-container">
54           <label i18n for="original-publication-after">Original publication year</label>
55           <button i18n class="reset-button reset-button-small" (click)="resetOriginalPublicationYears()" *ngIf="originallyPublishedStartYear || originallyPublishedEndYear">
56             Reset
57           </button>
58         </div>
59
60         <div class="row">
61           <div class="pl-0 col-sm-6">
62             <input
63               (change)="inputUpdated()"
64               (keydown.enter)="$event.preventDefault()"
65               type="text" id="original-publication-after" name="original-publication-after"
66               i18n-placeholder placeholder="After..."
67               [(ngModel)]="originallyPublishedStartYear"
68               class="form-control"
69             >
70           </div>
71           <div class="pr-0 col-sm-6">
72             <input
73               (change)="inputUpdated()"
74               (keydown.enter)="$event.preventDefault()"
75               type="text" id="original-publication-before" name="original-publication-before"
76               i18n-placeholder placeholder="Before..."
77               [(ngModel)]="originallyPublishedEndYear"
78               class="form-control"
79             >
80           </div>
81         </div>
82       </div>
83
84     </div>
85
86     <div class="col-lg-4 col-md-6 col-xs-12">
87       <div class="form-group">
88         <div class="radio-label label-container">
89           <label i18n>Duration</label>
90           <button i18n class="reset-button reset-button-small" (click)="resetLocalField('durationRange')" *ngIf="durationRange !== undefined">
91             Reset
92           </button>
93         </div>
94
95         <div class="peertube-radio-container" *ngFor="let duration of durationRanges">
96           <input type="radio" (change)="inputUpdated()" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange">
97           <label [for]="duration.id" class="radio">{{ duration.label }}</label>
98         </div>
99       </div>
100
101       <div class="form-group">
102         <label i18n for="category">Category</label>
103         <button i18n class="reset-button reset-button-small" (click)="resetField('categoryOneOf')" *ngIf="advancedSearch.categoryOneOf !== undefined">
104           Reset
105         </button>
106         <div class="peertube-select-container">
107           <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf" class="form-control">
108             <option [value]="undefined" i18n>Display all categories</option>
109             <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
110           </select>
111         </div>
112       </div>
113
114       <div class="form-group">
115         <label i18n for="licence">Licence</label>
116         <button i18n class="reset-button reset-button-small" (click)="resetField('licenceOneOf')" *ngIf="advancedSearch.licenceOneOf !== undefined">
117           Reset
118         </button>
119         <div class="peertube-select-container">
120           <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf" class="form-control">
121             <option [value]="undefined" i18n>Display all licenses</option>
122             <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
123           </select>
124         </div>
125       </div>
126
127       <div class="form-group">
128         <label i18n for="language">Language</label>
129         <button i18n class="reset-button reset-button-small" (click)="resetField('languageOneOf')" *ngIf="advancedSearch.languageOneOf !== undefined">
130           Reset
131         </button>
132         <div class="peertube-select-container">
133           <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf" class="form-control">
134             <option [value]="undefined" i18n>Display all languages</option>
135             <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option>
136           </select>
137         </div>
138       </div>
139     </div>
140
141     <div class="col-lg-4 col-md-6 col-xs-12">
142       <div class="form-group">
143         <label i18n for="tagsAllOf">All of these tags</label>
144         <button i18n class="reset-button reset-button-small" (click)="resetField('tagsAllOf')" *ngIf="advancedSearch.tagsAllOf">
145           Reset
146         </button>
147         <tag-input
148           [(ngModel)]="advancedSearch.tagsAllOf" name="tagsAllOf" id="tagsAllOf"
149           [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
150           i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag"
151           [maxItems]="5" [modelAsStrings]="true"
152         ></tag-input>
153       </div>
154
155       <div class="form-group">
156         <label i18n for="tagsOneOf">One of these tags</label>
157         <button i18n class="reset-button reset-button-small" (click)="resetField('tagsOneOf')" *ngIf="advancedSearch.tagsOneOf">
158           Reset
159         </button>
160         <tag-input
161           [(ngModel)]="advancedSearch.tagsOneOf" name="tagsOneOf" id="tagsOneOf"
162           [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
163           i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag"
164           [maxItems]="5" [modelAsStrings]="true"
165         ></tag-input>
166       </div>
167
168       <div class="form-group" *ngIf="isSearchTargetEnabled()">
169         <div class="radio-label label-container">
170           <label i18n>Search target</label>
171         </div>
172
173         <div class="peertube-radio-container">
174           <input type="radio" name="searchTarget" id="searchTargetLocal" value="local" [(ngModel)]="advancedSearch.searchTarget">
175           <label i18n for="searchTargetLocal" class="radio">Instance</label>
176         </div>
177
178         <div class="peertube-radio-container">
179           <input type="radio" name="searchTarget" id="searchTargetSearchIndex" value="search-index" [(ngModel)]="advancedSearch.searchTarget">
180           <label i18n for="searchTargetSearchIndex" class="radio">Vidiverse</label>
181         </div>
182       </div>
183     </div>
184   </div>
185
186   <div class="submit-button">
187     <button i18n class="reset-button" (click)="reset()" *ngIf="advancedSearch.size()">
188       Reset
189     </button>
190
191     <input type="submit" i18n-value value="Filter">
192   </div>
193 </form>