diff options
Diffstat (limited to 'client/src/app/shared/shared-user-settings')
-rw-r--r-- | client/src/app/shared/shared-user-settings/user-interface-settings.component.html | 6 | ||||
-rw-r--r-- | client/src/app/shared/shared-user-settings/user-interface-settings.component.ts | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html index 0d0ddc0f2..b739e881b 100644 --- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html +++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html | |||
@@ -5,10 +5,10 @@ | |||
5 | 5 | ||
6 | <div class="peertube-select-container"> | 6 | <div class="peertube-select-container"> |
7 | <select formControlName="theme" id="theme" class="form-control"> | 7 | <select formControlName="theme" id="theme" class="form-control"> |
8 | <option i18n value="instance-default">instance default</option> | 8 | <option i18n value="instance-default">Instance default theme ({{ getDefaultThemeLabel() }})</option> |
9 | <option i18n value="default">peertube default</option> | 9 | <option i18n value="default">{{ defaultThemeLabel }}</option> |
10 | 10 | ||
11 | <option *ngFor="let theme of availableThemes" [value]="theme">{{ theme }}</option> | 11 | <option *ngFor="let theme of availableThemes" [value]="theme">{{ capitalizeFirstLetter(theme) }}</option> |
12 | </select> | 12 | </select> |
13 | </div> | 13 | </div> |
14 | </div> | 14 | </div> |
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts index d04a2c348..932db498a 100644 --- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts +++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts | |||
@@ -2,6 +2,7 @@ import { Subject, Subscription } from 'rxjs' | |||
2 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' |
3 | import { AuthService, Notifier, ServerService, UserService } from '@app/core' | 3 | import { AuthService, Notifier, ServerService, UserService } from '@app/core' |
4 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 4 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
5 | import { capitalizeFirstLetter } from '@root-helpers/string' | ||
5 | import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models' | 6 | import { HTMLServerConfig, User, UserUpdateMe } from '@shared/models' |
6 | 7 | ||
7 | @Component({ | 8 | @Component({ |
@@ -17,6 +18,8 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn | |||
17 | 18 | ||
18 | formValuesWatcher: Subscription | 19 | formValuesWatcher: Subscription |
19 | 20 | ||
21 | defaultThemeLabel = $localize`Light/Orange` | ||
22 | |||
20 | private serverConfig: HTMLServerConfig | 23 | private serverConfig: HTMLServerConfig |
21 | 24 | ||
22 | constructor ( | 25 | constructor ( |
@@ -57,6 +60,18 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn | |||
57 | this.formValuesWatcher?.unsubscribe() | 60 | this.formValuesWatcher?.unsubscribe() |
58 | } | 61 | } |
59 | 62 | ||
63 | getDefaultThemeLabel () { | ||
64 | const theme = this.serverConfig.theme.default | ||
65 | |||
66 | if (theme === 'default') return this.defaultThemeLabel | ||
67 | |||
68 | return theme | ||
69 | } | ||
70 | |||
71 | capitalizeFirstLetter (str: string) { | ||
72 | return capitalizeFirstLetter(str) | ||
73 | } | ||
74 | |||
60 | updateInterfaceSettings () { | 75 | updateInterfaceSettings () { |
61 | const theme = this.form.value['theme'] | 76 | const theme = this.form.value['theme'] |
62 | 77 | ||