aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html23
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts10
2 files changed, 30 insertions, 3 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
index 9e4691670..83b1c6a31 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
@@ -269,9 +269,13 @@
269 <div class="peertube-select-container"> 269 <div class="peertube-select-container">
270 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control"> 270 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control">
271 <option i18n value="/videos/overview">Discover videos</option> 271 <option i18n value="/videos/overview">Discover videos</option>
272 <option i18n value="/videos/trending">Trending videos</option> 272 <optgroup i18n-label label="Trending pages">
273 <option i18n value="/videos/hot">Hot videos</option> 273 <option i18n value="/videos/trending">Default trending page</option>
274 <option i18n value="/videos/most-liked">Most liked videos</option> 274 <option i18n value="/videos/hot" *ngIf="isTrendingHotEnabled()">Hot videos</option>
275 <option i18n value="/videos/hot" *ngIf="!isTrendingHotEnabled()" disabled>Hot videos</option>
276 <option i18n value="/videos/most-viewed">Most viewed videos</option>
277 <option i18n value="/videos/most-liked">Most liked videos</option>
278 </optgroup>
275 <option i18n value="/videos/recently-added">Recently added videos</option> 279 <option i18n value="/videos/recently-added">Recently added videos</option>
276 <option i18n value="/videos/local">Local videos</option> 280 <option i18n value="/videos/local">Local videos</option>
277 </select> 281 </select>
@@ -279,6 +283,19 @@
279 <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div> 283 <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div>
280 </div> 284 </div>
281 285
286 <div class="form-group" formGroupName="instance">
287 <label i18n for="instanceDefaultTrendingRoute">Default trending page</label>
288 <div class="peertube-select-container">
289 <select id="instanceDefaultTrendingRoute" formControlName="defaultTrendingRoute" class="form-control">
290 <option i18n value="/videos/hot" *ngIf="isTrendingHotEnabled()">Hot videos</option>
291 <option i18n value="/videos/hot" *ngIf="!isTrendingHotEnabled()" disabled>Hot videos</option>
292 <option i18n value="/videos/trending">Most viewed videos</option>
293 <option i18n value="/videos/most-liked">Most liked videos</option>
294 </select>
295 </div>
296 <div *ngIf="formErrors.instance.defaultTrendingRoute" class="form-error">{{ formErrors.instance.defaultTrendingRoute }}</div>
297 </div>
298
282 </div> 299 </div>
283 </div> 300 </div>
284 301
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 330ab075a..e6fc4582b 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -186,6 +186,12 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
186 languages: null, 186 languages: null,
187 187
188 defaultClientRoute: null, 188 defaultClientRoute: null,
189 defaultTrendingRoute: null,
190 pages: {
191 hot: {
192 enabled: null
193 }
194 },
189 195
190 customizations: { 196 customizations: {
191 javascript: null, 197 javascript: null,
@@ -364,6 +370,10 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
364 return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true 370 return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true
365 } 371 }
366 372
373 isTrendingHotEnabled () {
374 return this.form.value['instance']['pages']['hot']['enabled'] === true
375 }
376
367 async formValidated () { 377 async formValidated () {
368 const value: CustomConfig = this.form.getRawValue() 378 const value: CustomConfig = this.form.getRawValue()
369 379