aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/account/account-settings/account-details
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-23 16:16:05 +0200
committerChocobozzz <me@florianbigard.com>2018-04-23 16:16:05 +0200
commit4bb6886d28cc5333bbe1523674bf5db141af456f (patch)
tree86276bfa11afdd4357ac45df2ead26a41f181069 /client/src/app/account/account-settings/account-details
parent3186046d17cc09a3426d5ea67835f4c936cb18a3 (diff)
downloadPeerTube-4bb6886d28cc5333bbe1523674bf5db141af456f.tar.gz
PeerTube-4bb6886d28cc5333bbe1523674bf5db141af456f.tar.zst
PeerTube-4bb6886d28cc5333bbe1523674bf5db141af456f.zip
Rename account module to my-account
Diffstat (limited to 'client/src/app/account/account-settings/account-details')
-rw-r--r--client/src/app/account/account-settings/account-details/account-details.component.html25
-rw-r--r--client/src/app/account/account-settings/account-details/account-details.component.scss20
-rw-r--r--client/src/app/account/account-settings/account-details/account-details.component.ts61
-rw-r--r--client/src/app/account/account-settings/account-details/index.ts1
4 files changed, 0 insertions, 107 deletions
diff --git a/client/src/app/account/account-settings/account-details/account-details.component.html b/client/src/app/account/account-settings/account-details/account-details.component.html
deleted file mode 100644
index 0e8598e9e..000000000
--- a/client/src/app/account/account-settings/account-details/account-details.component.html
+++ /dev/null
@@ -1,25 +0,0 @@
1<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form">
2 <div class="form-group">
3 <label for="nsfwPolicy">Default policy on videos containing sensitive content</label>
4 <my-help helpType="custom" customHtml="With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video."></my-help>
5
6 <div class="peertube-select-container">
7 <select id="nsfwPolicy" formControlName="nsfwPolicy">
8 <option value="do_not_list">Do not list</option>
9 <option value="blur">Blur thumbnails</option>
10 <option value="display">Display</option>
11 </select>
12 </div>
13 </div>
14
15 <div class="form-group">
16 <input
17 type="checkbox" id="autoPlayVideo"
18 formControlName="autoPlayVideo"
19 >
20 <label for="autoPlayVideo"></label>
21 <label for="autoPlayVideo">Automatically plays video</label>
22 </div>
23
24 <input type="submit" value="Save" [disabled]="!form.valid">
25</form>
diff --git a/client/src/app/account/account-settings/account-details/account-details.component.scss b/client/src/app/account/account-settings/account-details/account-details.component.scss
deleted file mode 100644
index ed59e4689..000000000
--- a/client/src/app/account/account-settings/account-details/account-details.component.scss
+++ /dev/null
@@ -1,20 +0,0 @@
1@import '_variables';
2@import '_mixins';
3
4input[type=checkbox] {
5 @include peertube-checkbox(1px);
6}
7
8input[type=submit] {
9 @include peertube-button;
10 @include orange-button;
11
12 display: block;
13 margin-top: 15px;
14}
15
16.peertube-select-container {
17 @include peertube-select-container(340px);
18
19 margin-bottom: 30px;
20} \ No newline at end of file
diff --git a/client/src/app/account/account-settings/account-details/account-details.component.ts b/client/src/app/account/account-settings/account-details/account-details.component.ts
deleted file mode 100644
index de213717e..000000000
--- a/client/src/app/account/account-settings/account-details/account-details.component.ts
+++ /dev/null
@@ -1,61 +0,0 @@
1import { Component, Input, OnInit } from '@angular/core'
2import { FormBuilder, FormGroup } from '@angular/forms'
3import { NotificationsService } from 'angular2-notifications'
4import { UserUpdateMe } from '../../../../../../shared'
5import { AuthService } from '../../../core'
6import { FormReactive, User, UserService } from '../../../shared'
7
8@Component({
9 selector: 'my-account-details',
10 templateUrl: './account-details.component.html',
11 styleUrls: [ './account-details.component.scss' ]
12})
13
14export class AccountDetailsComponent extends FormReactive implements OnInit {
15 @Input() user: User = null
16
17 form: FormGroup
18 formErrors = {}
19 validationMessages = {}
20
21 constructor (
22 private authService: AuthService,
23 private formBuilder: FormBuilder,
24 private notificationsService: NotificationsService,
25 private userService: UserService
26 ) {
27 super()
28 }
29
30 buildForm () {
31 this.form = this.formBuilder.group({
32 nsfwPolicy: [ this.user.nsfwPolicy ],
33 autoPlayVideo: [ this.user.autoPlayVideo ]
34 })
35
36 this.form.valueChanges.subscribe(data => this.onValueChanged(data))
37 }
38
39 ngOnInit () {
40 this.buildForm()
41 }
42
43 updateDetails () {
44 const nsfwPolicy = this.form.value['nsfwPolicy']
45 const autoPlayVideo = this.form.value['autoPlayVideo']
46 const details: UserUpdateMe = {
47 nsfwPolicy,
48 autoPlayVideo
49 }
50
51 this.userService.updateMyDetails(details).subscribe(
52 () => {
53 this.notificationsService.success('Success', 'Information updated.')
54
55 this.authService.refreshUserInformation()
56 },
57
58 err => this.notificationsService.error('Error', err.message)
59 )
60 }
61}
diff --git a/client/src/app/account/account-settings/account-details/index.ts b/client/src/app/account/account-settings/account-details/index.ts
deleted file mode 100644
index 4829f608a..000000000
--- a/client/src/app/account/account-settings/account-details/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './account-details.component'