aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+search/search-filters.component.html
blob: ed0632a4dcdcb8f9ea076587eb08f092a556f545 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<form role="form" (ngSubmit)="formUpdated()">

  <div class="row">
    <div class="col-lg-4 col-md-6 col-xs-12">
      <div class="form-group">
        <div class="radio-label label-container">
          <label for="sort" i18n>Sort</label>
          <button i18n class="reset-button reset-button-small" (click)="resetField('sort', '-match')" *ngIf="advancedSearch.sort !== '-match'">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container" *ngFor="let sort of sorts">
          <input type="radio" name="sort" [id]="sort.id" [value]="sort.id" [(ngModel)]="advancedSearch.sort">
          <label [for]="sort.id" class="radio">{{ sort.label }}</label>
        </div>
      </div>

      <div class="form-group">
        <div class="radio-label label-container">
          <label for="isLive" i18n>Display only</label>
          <button i18n class="reset-button reset-button-small" (click)="resetField('isLive')" *ngIf="advancedSearch.isLive !== undefined">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="isLive" id="isLiveTrue" value="true" [(ngModel)]="advancedSearch.isLive">
          <label i18n for="isLiveTrue" class="radio">Live videos</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="isLive" id="isLiveFalse" value="false" [(ngModel)]="advancedSearch.isLive">
          <label i18n for="isLiveFalse" class="radio">VOD videos</label>
        </div>
      </div>

      <div class="form-group">
        <div class="radio-label label-container">
          <label for="sensitiveContent" i18n>Display sensitive content</label>
          <button i18n class="reset-button reset-button-small" (click)="resetField('nsfw')" *ngIf="advancedSearch.nsfw !== undefined">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="sensitiveContent" id="sensitiveContentYes" value="both" [(ngModel)]="advancedSearch.nsfw">
          <label i18n for="sensitiveContentYes" class="radio">Yes</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="sensitiveContent" id="sensitiveContentNo" value="false" [(ngModel)]="advancedSearch.nsfw">
          <label i18n for="sensitiveContentNo" class="radio">No</label>
        </div>
      </div>

      <div class="form-group">
        <div class="radio-label label-container">
          <label for="publishedDateRange" i18n>Published date</label>
          <button i18n class="reset-button reset-button-small" (click)="resetLocalField('publishedDateRange')" *ngIf="publishedDateRange !== undefined">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container" *ngFor="let date of publishedDateRanges">
          <input type="radio" (change)="onDurationOrPublishedUpdated()" name="publishedDateRange" [id]="date.id" [value]="date.id" [(ngModel)]="publishedDateRange">
          <label [for]="date.id" class="radio">{{ date.label }}</label>
        </div>
      </div>

      <div class="form-group">
        <div class="label-container">
          <label i18n for="original-publication-after">Original publication year</label>
          <button i18n class="reset-button reset-button-small" (click)="resetOriginalPublicationYears()" *ngIf="originallyPublishedStartYear || originallyPublishedEndYear">
            Reset
          </button>
        </div>

        <div class="row">
          <div class="ps-0 col-sm-6">
            <input
              (change)="onDurationOrPublishedUpdated()"
              (keydown.enter)="$event.preventDefault()"
              type="text" id="original-publication-after" name="original-publication-after"
              i18n-placeholder placeholder="After..."
              [(ngModel)]="originallyPublishedStartYear"
              class="form-control"
            >
          </div>
          <div class="pe-0 col-sm-6">
            <input
              (change)="onDurationOrPublishedUpdated()"
              (keydown.enter)="$event.preventDefault()"
              type="text" id="original-publication-before" name="original-publication-before"
              i18n-placeholder placeholder="Before..."
              [(ngModel)]="originallyPublishedEndYear"
              class="form-control"
            >
          </div>
        </div>
      </div>

    </div>

    <div class="col-lg-4 col-md-6 col-xs-12">
      <div class="form-group">
        <div class="radio-label label-container">
          <label for="durationRange" i18n>Duration</label>
          <button i18n class="reset-button reset-button-small" (click)="resetLocalField('durationRange')" *ngIf="durationRange !== undefined">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container" *ngFor="let duration of durationRanges">
          <input type="radio" (change)="onDurationOrPublishedUpdated()" name="durationRange" [id]="duration.id" [value]="duration.id" [(ngModel)]="durationRange">
          <label [for]="duration.id" class="radio">{{ duration.label }}</label>
        </div>
      </div>

      <div class="form-group">
        <label i18n for="category">Category</label>
        <button i18n class="reset-button reset-button-small" (click)="resetField('categoryOneOf')" *ngIf="advancedSearch.categoryOneOf !== undefined">
          Reset
        </button>
        <div class="peertube-select-container">
          <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf" class="form-control">
            <option [value]="undefined" i18n>Display all categories</option>
            <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
          </select>
        </div>
      </div>

      <div class="form-group">
        <label i18n for="licence">Licence</label>
        <button i18n class="reset-button reset-button-small" (click)="resetField('licenceOneOf')" *ngIf="advancedSearch.licenceOneOf !== undefined">
          Reset
        </button>
        <div class="peertube-select-container">
          <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf" class="form-control">
            <option [value]="undefined" i18n>Display all licenses</option>
            <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
          </select>
        </div>
      </div>

      <div class="form-group">
        <label i18n for="language">Language</label>
        <button i18n class="reset-button reset-button-small" (click)="resetField('languageOneOf')" *ngIf="advancedSearch.languageOneOf !== undefined">
          Reset
        </button>
        <div class="peertube-select-container">
          <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf" class="form-control">
            <option [value]="undefined" i18n>Display all languages</option>
            <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option>
          </select>
        </div>
      </div>
    </div>

    <div class="col-lg-4 col-md-6 col-xs-12">
      <div class="form-group">
        <label i18n for="tagsAllOf">All of these tags</label>
        <button i18n class="reset-button reset-button-small" (click)="resetField('tagsAllOf')" *ngIf="advancedSearch.tagsAllOf">
          Reset
        </button>
        <my-select-tags name="tagsAllOf" labelForId="tagsAllOf" id="tagsAllOf" [(ngModel)]="advancedSearch.tagsAllOf"></my-select-tags>
      </div>

      <div class="form-group">
        <label i18n for="tagsOneOf">One of these tags</label>
        <button i18n class="reset-button reset-button-small" (click)="resetField('tagsOneOf')" *ngIf="advancedSearch.tagsOneOf">
          Reset
        </button>
        <my-select-tags name="tagsOneOf" labelForId="tagsOneOf" id="tagsOneOf" [(ngModel)]="advancedSearch.tagsOneOf"></my-select-tags>
      </div>

      <div class="form-group">
        <label i18n for="host">PeerTube instance host</label>

        <input (change)="onDurationOrPublishedUpdated()" (keydown.enter)="$event.preventDefault()" type="text" id="host" name="host"
          placeholder="example.com" [(ngModel)]="advancedSearch.host" class="form-control"
        >
      </div>

      <div class="form-group">
        <div class="radio-label label-container">
          <label for="resultType" i18n>Result types</label>
          <button i18n class="reset-button reset-button-small" (click)="resetField('resultType')" *ngIf="advancedSearch.resultType !== undefined">
            Reset
          </button>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="resultType" id="resultTypeVideos" value="videos" [(ngModel)]="advancedSearch.resultType">
          <label i18n for="resultTypeVideos" class="radio">Videos</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="resultType" id="resultTypeChannels" value="channels" [(ngModel)]="advancedSearch.resultType">
          <label i18n for="resultTypeChannels" class="radio">Channels</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="resultType" id="resultTypePlaylists" value="playlists" [(ngModel)]="advancedSearch.resultType">
          <label i18n for="resultTypePlaylists" class="radio">Playlists</label>
        </div>

      </div>

      <div class="form-group" *ngIf="isSearchTargetEnabled()">
        <div class="radio-label label-container">
          <label for="searchTarget" i18n>Search target</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="searchTarget" id="searchTargetLocal" value="local" [(ngModel)]="advancedSearch.searchTarget">
          <label i18n for="searchTargetLocal" class="radio">Instance</label>
        </div>

        <div class="peertube-radio-container">
          <input type="radio" name="searchTarget" id="searchTargetSearchIndex" value="search-index" [(ngModel)]="advancedSearch.searchTarget">
          <label i18n for="searchTargetSearchIndex" class="radio">Vidiverse</label>
        </div>
      </div>
    </div>
  </div>

  <div class="submit-button">
    <button i18n class="reset-button" (click)="reset()" *ngIf="advancedSearch.size()">
      Reset
    </button>

    <input type="submit" i18n-value value="Filter">
  </div>
</form>