]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/search/search-filters.component.html
Use form-control to display box-shadow on form inputs/selects upon focus
[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>Published date</label>
22 <button i18n class="reset-button reset-button-small" (click)="resetLocalField('publishedDateRange')" *ngIf="publishedDateRange !== undefined">
23 Reset
24 </button>
25 </div>
26
27 <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges">
28 <input type="radio" (change)="inputUpdated()" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange">
29 <label [for]="date.id" class="radio">{{ date.label }}</label>
30 </div>
31 </div>
32
33 <div class="form-group">
34 <div class="label-container">
35 <label i18n for="original-publication-after">Original publication year</label>
36 <button i18n class="reset-button reset-button-small" (click)="resetOriginalPublicationYears()" *ngIf="originallyPublishedStartYear || originallyPublishedEndYear">
37 Reset
38 </button>
39 </div>
40
41 <div class="row">
42 <div class="col-sm-6">
43 <input
44 (change)="inputUpdated()"
45 (keydown.enter)="$event.preventDefault()"
46 type="text" id="original-publication-after" name="original-publication-after"
47 i18n-placeholder placeholder="After..."
48 [(ngModel)]="originallyPublishedStartYear"
49 class="form-control"
50 >
51 </div>
52 <div class="col-sm-6">
53 <input
54 (change)="inputUpdated()"
55 (keydown.enter)="$event.preventDefault()"
56 type="text" id="original-publication-before" name="original-publication-before"
57 i18n-placeholder placeholder="Before..."
58 [(ngModel)]="originallyPublishedEndYear"
59 class="form-control"
60 >
61 </div>
62 </div>
63 </div>
64
65 <div class="form-group">
66 <div class="radio-label label-container">
67 <label i18n>Duration</label>
68 <button i18n class="reset-button reset-button-small" (click)="resetLocalField('durationRange')" *ngIf="durationRange !== undefined">
69 Reset
70 </button>
71 </div>
72
73 <div class="peertube-radio-container" *ngFor="let duration of durationRanges">
74 <input type="radio" (change)="inputUpdated()" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange">
75 <label [for]="duration.id" class="radio">{{ duration.label }}</label>
76 </div>
77 </div>
78
79 <div class="form-group">
80 <div class="radio-label label-container">
81 <label i18n>Display sensitive content</label>
82 <button i18n class="reset-button reset-button-small" (click)="resetField('nsfw')" *ngIf="advancedSearch.nsfw !== undefined">
83 Reset
84 </button>
85 </div>
86
87 <div class="peertube-radio-container">
88 <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw">
89 <label i18n for="sensitiveContentYes" class="radio">Yes</label>
90 </div>
91
92 <div class="peertube-radio-container">
93 <input type="radio" name="sensitiveContent" id="sensitiveContentNo" value="false" [(ngModel)]="advancedSearch.nsfw">
94 <label i18n for="sensitiveContentNo" class="radio">No</label>
95 </div>
96 </div>
97
98 </div>
99
100 <div class="col-lg-4 col-md-6 col-xs-12">
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 </div>
168 </div>
169
170 <div class="submit-button">
171 <button i18n class="reset-button" (click)="reset()" *ngIf="advancedSearch.size()">
172 Reset
173 </button>
174
175 <input type="submit" i18n-value value="Filter">
176 </div>
177 </form>