diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-04 17:12:23 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-05 09:06:01 +0100 |
commit | 25266908666d4d465e1c8ec90135eaa00c91732e (patch) | |
tree | a769c6d59f021b6b0a39766f4054a0d31a57a0c6 /client/src/app/search/search-filters.component.html | |
parent | fee47735bde36d9b8d0aed6284e9e8c9f6697001 (diff) | |
download | PeerTube-25266908666d4d465e1c8ec90135eaa00c91732e.tar.gz PeerTube-25266908666d4d465e1c8ec90135eaa00c91732e.tar.zst PeerTube-25266908666d4d465e1c8ec90135eaa00c91732e.zip |
search filtering improvements per #1654
Diffstat (limited to 'client/src/app/search/search-filters.component.html')
-rw-r--r-- | client/src/app/search/search-filters.component.html | 82 |
1 files changed, 70 insertions, 12 deletions
diff --git a/client/src/app/search/search-filters.component.html b/client/src/app/search/search-filters.component.html index 8220a990b..07fb2c048 100644 --- a/client/src/app/search/search-filters.component.html +++ b/client/src/app/search/search-filters.component.html | |||
@@ -3,7 +3,12 @@ | |||
3 | <div class="row"> | 3 | <div class="row"> |
4 | <div class="col-lg-4 col-md-6 col-xs-12"> | 4 | <div class="col-lg-4 col-md-6 col-xs-12"> |
5 | <div class="form-group"> | 5 | <div class="form-group"> |
6 | <div i18n class="radio-label">Sort</div> | 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> | ||
7 | 12 | ||
8 | <div class="peertube-radio-container" *ngFor="let sort of sorts"> | 13 | <div class="peertube-radio-container" *ngFor="let sort of sorts"> |
9 | <input type="radio" name="sort" [id]="sort.id" [value]="sort.id" [(ngModel)]="advancedSearch.sort"> | 14 | <input type="radio" name="sort" [id]="sort.id" [value]="sort.id" [(ngModel)]="advancedSearch.sort"> |
@@ -12,20 +17,32 @@ | |||
12 | </div> | 17 | </div> |
13 | 18 | ||
14 | <div class="form-group"> | 19 | <div class="form-group"> |
15 | <div i18n class="radio-label">Published date</div> | 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> | ||
16 | 26 | ||
17 | <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges"> | 27 | <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges"> |
18 | <input type="radio" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange"> | 28 | <input type="radio" (change)="inputUpdated()" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange"> |
19 | <label [for]="date.id" class="radio">{{ date.label }}</label> | 29 | <label [for]="date.id" class="radio">{{ date.label }}</label> |
20 | </div> | 30 | </div> |
21 | </div> | 31 | </div> |
22 | 32 | ||
23 | <div class="form-group"> | 33 | <div class="form-group"> |
24 | <label i18n for="original-publication-after">Original publication year</label> | 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> | ||
25 | 40 | ||
26 | <div class="row"> | 41 | <div class="row"> |
27 | <div class="col-sm-6"> | 42 | <div class="col-sm-6"> |
28 | <input | 43 | <input |
44 | (change)="inputUpdated()" | ||
45 | (keydown.enter)="$event.preventDefault()" | ||
29 | type="text" id="original-publication-after" name="original-publication-after" | 46 | type="text" id="original-publication-after" name="original-publication-after" |
30 | i18n-placeholder placeholder="After..." | 47 | i18n-placeholder placeholder="After..." |
31 | [(ngModel)]="originallyPublishedStartYear" | 48 | [(ngModel)]="originallyPublishedStartYear" |
@@ -33,6 +50,8 @@ | |||
33 | </div> | 50 | </div> |
34 | <div class="col-sm-6"> | 51 | <div class="col-sm-6"> |
35 | <input | 52 | <input |
53 | (change)="inputUpdated()" | ||
54 | (keydown.enter)="$event.preventDefault()" | ||
36 | type="text" id="original-publication-before" name="original-publication-before" | 55 | type="text" id="original-publication-before" name="original-publication-before" |
37 | i18n-placeholder placeholder="Before..." | 56 | i18n-placeholder placeholder="Before..." |
38 | [(ngModel)]="originallyPublishedEndYear" | 57 | [(ngModel)]="originallyPublishedEndYear" |
@@ -42,16 +61,26 @@ | |||
42 | </div> | 61 | </div> |
43 | 62 | ||
44 | <div class="form-group"> | 63 | <div class="form-group"> |
45 | <div i18n class="radio-label">Duration</div> | 64 | <div class="radio-label label-container"> |
65 | <label i18n>Duration</label> | ||
66 | <button i18n class="reset-button reset-button-small" (click)="resetLocalField('durationRange')" *ngIf="durationRange !== undefined"> | ||
67 | Reset | ||
68 | </button> | ||
69 | </div> | ||
46 | 70 | ||
47 | <div class="peertube-radio-container" *ngFor="let duration of durationRanges"> | 71 | <div class="peertube-radio-container" *ngFor="let duration of durationRanges"> |
48 | <input type="radio" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange"> | 72 | <input type="radio" (change)="inputUpdated()" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange"> |
49 | <label [for]="duration.id" class="radio">{{ duration.label }}</label> | 73 | <label [for]="duration.id" class="radio">{{ duration.label }}</label> |
50 | </div> | 74 | </div> |
51 | </div> | 75 | </div> |
52 | 76 | ||
53 | <div class="form-group"> | 77 | <div class="form-group"> |
54 | <div i18n class="radio-label">Display sensitive content</div> | 78 | <div class="radio-label label-container"> |
79 | <label i18n>Display sensitive content</label> | ||
80 | <button i18n class="reset-button reset-button-small" (click)="resetField('nsfw')" *ngIf="advancedSearch.nsfw !== undefined"> | ||
81 | Reset | ||
82 | </button> | ||
83 | </div> | ||
55 | 84 | ||
56 | <div class="peertube-radio-container"> | 85 | <div class="peertube-radio-container"> |
57 | <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw"> | 86 | <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw"> |
@@ -69,9 +98,12 @@ | |||
69 | <div class="col-lg-4 col-md-6 col-xs-12"> | 98 | <div class="col-lg-4 col-md-6 col-xs-12"> |
70 | <div class="form-group"> | 99 | <div class="form-group"> |
71 | <label i18n for="category">Category</label> | 100 | <label i18n for="category">Category</label> |
101 | <button i18n class="reset-button reset-button-small" (click)="resetField('categoryOneOf')" *ngIf="advancedSearch.categoryOneOf !== undefined"> | ||
102 | Reset | ||
103 | </button> | ||
72 | <div class="peertube-select-container"> | 104 | <div class="peertube-select-container"> |
73 | <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf"> | 105 | <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf"> |
74 | <option></option> | 106 | <option [value]="undefined" i18n>Any or no category set</option> |
75 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> | 107 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> |
76 | </select> | 108 | </select> |
77 | </div> | 109 | </div> |
@@ -79,9 +111,12 @@ | |||
79 | 111 | ||
80 | <div class="form-group"> | 112 | <div class="form-group"> |
81 | <label i18n for="licence">Licence</label> | 113 | <label i18n for="licence">Licence</label> |
114 | <button i18n class="reset-button reset-button-small" (click)="resetField('licenceOneOf')" *ngIf="advancedSearch.licenceOneOf !== undefined"> | ||
115 | Reset | ||
116 | </button> | ||
82 | <div class="peertube-select-container"> | 117 | <div class="peertube-select-container"> |
83 | <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf"> | 118 | <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf"> |
84 | <option></option> | 119 | <option [value]="undefined" i18n>Any or no license set</option> |
85 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> | 120 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> |
86 | </select> | 121 | </select> |
87 | </div> | 122 | </div> |
@@ -89,9 +124,12 @@ | |||
89 | 124 | ||
90 | <div class="form-group"> | 125 | <div class="form-group"> |
91 | <label i18n for="language">Language</label> | 126 | <label i18n for="language">Language</label> |
127 | <button i18n class="reset-button reset-button-small" (click)="resetField('languageOneOf')" *ngIf="advancedSearch.languageOneOf !== undefined"> | ||
128 | Reset | ||
129 | </button> | ||
92 | <div class="peertube-select-container"> | 130 | <div class="peertube-select-container"> |
93 | <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf"> | 131 | <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf"> |
94 | <option></option> | 132 | <option [value]="undefined" i18n>Any or no language set</option> |
95 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> | 133 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> |
96 | </select> | 134 | </select> |
97 | </div> | 135 | </div> |
@@ -101,17 +139,37 @@ | |||
101 | <div class="col-lg-4 col-md-6 col-xs-12"> | 139 | <div class="col-lg-4 col-md-6 col-xs-12"> |
102 | <div class="form-group"> | 140 | <div class="form-group"> |
103 | <label i18n for="tagsAllOf">All of these tags</label> | 141 | <label i18n for="tagsAllOf">All of these tags</label> |
104 | <input type="text" name="tagsAllOf" id="tagsAllOf" [(ngModel)]="advancedSearch.tagsAllOf" /> | 142 | <button i18n class="reset-button reset-button-small" (click)="resetField('tagsAllOf')" *ngIf="advancedSearch.tagsAllOf"> |
143 | Reset | ||
144 | </button> | ||
145 | <tag-input | ||
146 | [(ngModel)]="advancedSearch.tagsAllOf" name="tagsAllOf" id="tagsAllOf" | ||
147 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" | ||
148 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" | ||
149 | maxItems="5" modelAsStrings="true" | ||
150 | ></tag-input> | ||
105 | </div> | 151 | </div> |
106 | 152 | ||
107 | <div class="form-group"> | 153 | <div class="form-group"> |
108 | <label i18n for="tagsOneOf">One of these tags</label> | 154 | <label i18n for="tagsOneOf">One of these tags</label> |
109 | <input type="text" name="tagsOneOf" id="tagsOneOf" [(ngModel)]="advancedSearch.tagsOneOf" /> | 155 | <button i18n class="reset-button reset-button-small" (click)="resetField('tagsOneOf')" *ngIf="advancedSearch.tagsOneOf"> |
156 | Reset | ||
157 | </button> | ||
158 | <tag-input | ||
159 | [(ngModel)]="advancedSearch.tagsOneOf" name="tagsOneOf" id="tagsOneOf" | ||
160 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" | ||
161 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" | ||
162 | maxItems="5" modelAsStrings="true" | ||
163 | ></tag-input> | ||
110 | </div> | 164 | </div> |
111 | </div> | 165 | </div> |
112 | </div> | 166 | </div> |
113 | 167 | ||
114 | <div class="submit-button"> | 168 | <div class="submit-button"> |
169 | <button i18n class="reset-button" (click)="reset()" *ngIf="advancedSearch.size()"> | ||
170 | Reset | ||
171 | </button> | ||
172 | |||
115 | <input type="submit" i18n-value value="Filter"> | 173 | <input type="submit" i18n-value value="Filter"> |
116 | </div> | 174 | </div> |
117 | </form> | 175 | </form> |