diff options
11 files changed, 163 insertions, 55 deletions
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.html b/client/src/app/+my-account/my-account-history/my-account-history.component.html index 653b33f89..d42af37d4 100644 --- a/client/src/app/+my-account/my-account-history/my-account-history.component.html +++ b/client/src/app/+my-account/my-account-history/my-account-history.component.html | |||
@@ -1,4 +1,16 @@ | |||
1 | <div i18n *ngIf="pagination.totalItems === 0">You don't have history yet.</div> | 1 | <div class="top-buttons"> |
2 | <div class="history-switch"> | ||
3 | <p-inputSwitch [(ngModel)]="videosHistoryEnabled" (ngModelChange)="onVideosHistoryChange()"></p-inputSwitch> | ||
4 | <label i18n>History enabled</label> | ||
5 | </div> | ||
6 | |||
7 | <div class="delete-history"> | ||
8 | <button (click)="deleteHistory()" i18n>Delete history</button> | ||
9 | </div> | ||
10 | </div> | ||
11 | |||
12 | |||
13 | <div class="no-history" i18n *ngIf="pagination.totalItems === 0">You don't have videos history yet.</div> | ||
2 | 14 | ||
3 | <div myInfiniteScroller (nearOfBottom)="onNearOfBottom()" class="videos" #videosElement> | 15 | <div myInfiniteScroller (nearOfBottom)="onNearOfBottom()" class="videos" #videosElement> |
4 | <div *ngFor="let videos of videoPages;" class="videos-page"> | 16 | <div *ngFor="let videos of videoPages;" class="videos-page"> |
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.scss b/client/src/app/+my-account/my-account-history/my-account-history.component.scss index 115bb0e5c..82150cbe3 100644 --- a/client/src/app/+my-account/my-account-history/my-account-history.component.scss +++ b/client/src/app/+my-account/my-account-history/my-account-history.component.scss | |||
@@ -1,6 +1,37 @@ | |||
1 | @import '_variables'; | 1 | @import '_variables'; |
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | .no-history { | ||
5 | display: flex; | ||
6 | justify-content: center; | ||
7 | margin-top: 50px; | ||
8 | font-weight: $font-semibold; | ||
9 | font-size: 16px; | ||
10 | } | ||
11 | |||
12 | .top-buttons { | ||
13 | margin-bottom: 20px; | ||
14 | display: flex; | ||
15 | |||
16 | .history-switch { | ||
17 | display: flex; | ||
18 | flex-grow: 1; | ||
19 | |||
20 | label { | ||
21 | margin: 0 0 0 5px; | ||
22 | } | ||
23 | } | ||
24 | |||
25 | .delete-history { | ||
26 | font-size: 15px; | ||
27 | |||
28 | button { | ||
29 | @include peertube-button; | ||
30 | @include grey-button; | ||
31 | } | ||
32 | } | ||
33 | } | ||
34 | |||
4 | .video { | 35 | .video { |
5 | @include row-blocks; | 36 | @include row-blocks; |
6 | 37 | ||
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.ts b/client/src/app/+my-account/my-account-history/my-account-history.component.ts index 508552167..6ec4fefe8 100644 --- a/client/src/app/+my-account/my-account-history/my-account-history.component.ts +++ b/client/src/app/+my-account/my-account-history/my-account-history.component.ts | |||
@@ -11,6 +11,7 @@ import { VideoService } from '../../shared/video/video.service' | |||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 11 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { ScreenService } from '@app/shared/misc/screen.service' | 12 | import { ScreenService } from '@app/shared/misc/screen.service' |
13 | import { UserHistoryService } from '@app/shared/users/user-history.service' | 13 | import { UserHistoryService } from '@app/shared/users/user-history.service' |
14 | import { UserService } from '@app/shared' | ||
14 | 15 | ||
15 | @Component({ | 16 | @Component({ |
16 | selector: 'my-account-history', | 17 | selector: 'my-account-history', |
@@ -25,6 +26,7 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn | |||
25 | itemsPerPage: 5, | 26 | itemsPerPage: 5, |
26 | totalItems: null | 27 | totalItems: null |
27 | } | 28 | } |
29 | videosHistoryEnabled: boolean | ||
28 | 30 | ||
29 | protected baseVideoWidth = -1 | 31 | protected baseVideoWidth = -1 |
30 | protected baseVideoHeight = 155 | 32 | protected baseVideoHeight = 155 |
@@ -33,6 +35,7 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn | |||
33 | protected router: Router, | 35 | protected router: Router, |
34 | protected route: ActivatedRoute, | 36 | protected route: ActivatedRoute, |
35 | protected authService: AuthService, | 37 | protected authService: AuthService, |
38 | protected userService: UserService, | ||
36 | protected notificationsService: NotificationsService, | 39 | protected notificationsService: NotificationsService, |
37 | protected location: Location, | 40 | protected location: Location, |
38 | protected screenService: ScreenService, | 41 | protected screenService: ScreenService, |
@@ -48,6 +51,8 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn | |||
48 | 51 | ||
49 | ngOnInit () { | 52 | ngOnInit () { |
50 | super.ngOnInit() | 53 | super.ngOnInit() |
54 | |||
55 | this.videosHistoryEnabled = this.authService.getUser().videosHistoryEnabled | ||
51 | } | 56 | } |
52 | 57 | ||
53 | ngOnDestroy () { | 58 | ngOnDestroy () { |
@@ -63,4 +68,40 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn | |||
63 | generateSyndicationList () { | 68 | generateSyndicationList () { |
64 | throw new Error('Method not implemented.') | 69 | throw new Error('Method not implemented.') |
65 | } | 70 | } |
71 | |||
72 | onVideosHistoryChange () { | ||
73 | this.userService.updateMyProfile({ videosHistoryEnabled: this.videosHistoryEnabled }) | ||
74 | .subscribe( | ||
75 | () => { | ||
76 | const message = this.videosHistoryEnabled === true ? | ||
77 | this.i18n('Videos history is enabled') : | ||
78 | this.i18n('Videos history is disabled') | ||
79 | |||
80 | this.notificationsService.success(this.i18n('Success'), message) | ||
81 | |||
82 | this.authService.refreshUserInformation() | ||
83 | }, | ||
84 | |||
85 | err => this.notificationsService.error(this.i18n('Error'), err.message) | ||
86 | ) | ||
87 | } | ||
88 | |||
89 | async deleteHistory () { | ||
90 | const title = this.i18n('Delete videos history') | ||
91 | const message = this.i18n('Are you sure you want to delete all your videos history?') | ||
92 | |||
93 | const res = await this.confirmService.confirm(message, title) | ||
94 | if (res !== true) return | ||
95 | |||
96 | this.userHistoryService.deleteUserVideosHistory() | ||
97 | .subscribe( | ||
98 | () => { | ||
99 | this.notificationsService.success(this.i18n('Success'), this.i18n('Videos history deleted')) | ||
100 | |||
101 | this.reloadVideos() | ||
102 | }, | ||
103 | |||
104 | err => this.notificationsService.error(this.i18n('Error'), err.message) | ||
105 | ) | ||
106 | } | ||
66 | } | 107 | } |
diff --git a/client/src/app/+my-account/my-account.module.ts b/client/src/app/+my-account/my-account.module.ts index c05406438..80d9f0cf7 100644 --- a/client/src/app/+my-account/my-account.module.ts +++ b/client/src/app/+my-account/my-account.module.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { TableModule } from 'primeng/table' | 1 | import { TableModule } from 'primeng/table' |
2 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
3 | import { AutoCompleteModule } from 'primeng/autocomplete' | 3 | import { AutoCompleteModule } from 'primeng/autocomplete' |
4 | import { InputSwitchModule } from 'primeng/inputswitch' | ||
4 | import { SharedModule } from '../shared' | 5 | import { SharedModule } from '../shared' |
5 | import { MyAccountRoutingModule } from './my-account-routing.module' | 6 | import { MyAccountRoutingModule } from './my-account-routing.module' |
6 | import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component' | 7 | import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component' |
@@ -29,7 +30,8 @@ import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/m | |||
29 | MyAccountRoutingModule, | 30 | MyAccountRoutingModule, |
30 | AutoCompleteModule, | 31 | AutoCompleteModule, |
31 | SharedModule, | 32 | SharedModule, |
32 | TableModule | 33 | TableModule, |
34 | InputSwitchModule | ||
33 | ], | 35 | ], |
34 | 36 | ||
35 | declarations: [ | 37 | declarations: [ |
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index acd13d9c5..abb11fdc2 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | 1 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' |
2 | import { UserRight } from '../../../../../shared/models/users/user-right.enum' | 2 | import { UserRight } from '../../../../../shared/models/users/user-right.enum' |
3 | import { User as ServerUserModel } from '../../../../../shared/models/users/user.model' | ||
3 | // Do not use the barrel (dependency loop) | 4 | // Do not use the barrel (dependency loop) |
4 | import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' | 5 | import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' |
5 | import { User, UserConstructorHash } from '../../shared/users/user.model' | 6 | import { User } from '../../shared/users/user.model' |
6 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 7 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' |
7 | 8 | ||
8 | export type TokenOptions = { | 9 | export type TokenOptions = { |
@@ -70,6 +71,7 @@ export class AuthUser extends User { | |||
70 | ID: 'id', | 71 | ID: 'id', |
71 | ROLE: 'role', | 72 | ROLE: 'role', |
72 | EMAIL: 'email', | 73 | EMAIL: 'email', |
74 | VIDEOS_HISTORY_ENABLED: 'videos-history-enabled', | ||
73 | USERNAME: 'username', | 75 | USERNAME: 'username', |
74 | NSFW_POLICY: 'nsfw_policy', | 76 | NSFW_POLICY: 'nsfw_policy', |
75 | WEBTORRENT_ENABLED: 'peertube-videojs-' + 'webtorrent_enabled', | 77 | WEBTORRENT_ENABLED: 'peertube-videojs-' + 'webtorrent_enabled', |
@@ -89,7 +91,8 @@ export class AuthUser extends User { | |||
89 | role: parseInt(peertubeLocalStorage.getItem(this.KEYS.ROLE), 10) as UserRole, | 91 | role: parseInt(peertubeLocalStorage.getItem(this.KEYS.ROLE), 10) as UserRole, |
90 | nsfwPolicy: peertubeLocalStorage.getItem(this.KEYS.NSFW_POLICY) as NSFWPolicyType, | 92 | nsfwPolicy: peertubeLocalStorage.getItem(this.KEYS.NSFW_POLICY) as NSFWPolicyType, |
91 | webTorrentEnabled: peertubeLocalStorage.getItem(this.KEYS.WEBTORRENT_ENABLED) === 'true', | 93 | webTorrentEnabled: peertubeLocalStorage.getItem(this.KEYS.WEBTORRENT_ENABLED) === 'true', |
92 | autoPlayVideo: peertubeLocalStorage.getItem(this.KEYS.AUTO_PLAY_VIDEO) === 'true' | 94 | autoPlayVideo: peertubeLocalStorage.getItem(this.KEYS.AUTO_PLAY_VIDEO) === 'true', |
95 | videosHistoryEnabled: peertubeLocalStorage.getItem(this.KEYS.VIDEOS_HISTORY_ENABLED) === 'true' | ||
93 | }, | 96 | }, |
94 | Tokens.load() | 97 | Tokens.load() |
95 | ) | 98 | ) |
@@ -104,12 +107,13 @@ export class AuthUser extends User { | |||
104 | peertubeLocalStorage.removeItem(this.KEYS.ROLE) | 107 | peertubeLocalStorage.removeItem(this.KEYS.ROLE) |
105 | peertubeLocalStorage.removeItem(this.KEYS.NSFW_POLICY) | 108 | peertubeLocalStorage.removeItem(this.KEYS.NSFW_POLICY) |
106 | peertubeLocalStorage.removeItem(this.KEYS.WEBTORRENT_ENABLED) | 109 | peertubeLocalStorage.removeItem(this.KEYS.WEBTORRENT_ENABLED) |
110 | peertubeLocalStorage.removeItem(this.KEYS.VIDEOS_HISTORY_ENABLED) | ||
107 | peertubeLocalStorage.removeItem(this.KEYS.AUTO_PLAY_VIDEO) | 111 | peertubeLocalStorage.removeItem(this.KEYS.AUTO_PLAY_VIDEO) |
108 | peertubeLocalStorage.removeItem(this.KEYS.EMAIL) | 112 | peertubeLocalStorage.removeItem(this.KEYS.EMAIL) |
109 | Tokens.flush() | 113 | Tokens.flush() |
110 | } | 114 | } |
111 | 115 | ||
112 | constructor (userHash: UserConstructorHash, hashTokens: TokenOptions) { | 116 | constructor (userHash: Partial<ServerUserModel>, hashTokens: TokenOptions) { |
113 | super(userHash) | 117 | super(userHash) |
114 | this.tokens = new Tokens(hashTokens) | 118 | this.tokens = new Tokens(hashTokens) |
115 | } | 119 | } |
diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts index 18bc41ca6..7b1c37ee8 100644 --- a/client/src/app/core/routing/login-guard.service.ts +++ b/client/src/app/core/routing/login-guard.service.ts | |||
@@ -1,11 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { | 2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' |
3 | ActivatedRouteSnapshot, | ||
4 | CanActivateChild, | ||
5 | RouterStateSnapshot, | ||
6 | CanActivate, | ||
7 | Router | ||
8 | } from '@angular/router' | ||
9 | 3 | ||
10 | import { AuthService } from '../auth/auth.service' | 4 | import { AuthService } from '../auth/auth.service' |
11 | 5 | ||
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 9819829fd..3663a7b61 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts | |||
@@ -1,33 +1,8 @@ | |||
1 | import { | 1 | import { hasUserRight, User as UserServerModel, UserRight, UserRole, VideoChannel } from '../../../../../shared' |
2 | Account as AccountServerModel, | ||
3 | hasUserRight, | ||
4 | User as UserServerModel, | ||
5 | UserRight, | ||
6 | UserRole, | ||
7 | VideoChannel | ||
8 | } from '../../../../../shared' | ||
9 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 2 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' |
10 | import { Account } from '@app/shared/account/account.model' | 3 | import { Account } from '@app/shared/account/account.model' |
11 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 4 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' |
12 | 5 | ||
13 | export type UserConstructorHash = { | ||
14 | id: number, | ||
15 | username: string, | ||
16 | email: string, | ||
17 | role: UserRole, | ||
18 | emailVerified?: boolean, | ||
19 | videoQuota?: number, | ||
20 | videoQuotaDaily?: number, | ||
21 | nsfwPolicy?: NSFWPolicyType, | ||
22 | webTorrentEnabled?: boolean, | ||
23 | autoPlayVideo?: boolean, | ||
24 | createdAt?: Date, | ||
25 | account?: AccountServerModel, | ||
26 | videoChannels?: VideoChannel[] | ||
27 | |||
28 | blocked?: boolean | ||
29 | blockedReason?: string | ||
30 | } | ||
31 | export class User implements UserServerModel { | 6 | export class User implements UserServerModel { |
32 | id: number | 7 | id: number |
33 | username: string | 8 | username: string |
@@ -35,8 +10,11 @@ export class User implements UserServerModel { | |||
35 | emailVerified: boolean | 10 | emailVerified: boolean |
36 | role: UserRole | 11 | role: UserRole |
37 | nsfwPolicy: NSFWPolicyType | 12 | nsfwPolicy: NSFWPolicyType |
13 | |||
38 | webTorrentEnabled: boolean | 14 | webTorrentEnabled: boolean |
39 | autoPlayVideo: boolean | 15 | autoPlayVideo: boolean |
16 | videosHistoryEnabled: boolean | ||
17 | |||
40 | videoQuota: number | 18 | videoQuota: number |
41 | videoQuotaDaily: number | 19 | videoQuotaDaily: number |
42 | account: Account | 20 | account: Account |
@@ -46,7 +24,7 @@ export class User implements UserServerModel { | |||
46 | blocked: boolean | 24 | blocked: boolean |
47 | blockedReason?: string | 25 | blockedReason?: string |
48 | 26 | ||
49 | constructor (hash: UserConstructorHash) { | 27 | constructor (hash: Partial<UserServerModel>) { |
50 | this.id = hash.id | 28 | this.id = hash.id |
51 | this.username = hash.username | 29 | this.username = hash.username |
52 | this.email = hash.email | 30 | this.email = hash.email |
@@ -57,6 +35,7 @@ export class User implements UserServerModel { | |||
57 | this.videoQuotaDaily = hash.videoQuotaDaily | 35 | this.videoQuotaDaily = hash.videoQuotaDaily |
58 | this.nsfwPolicy = hash.nsfwPolicy | 36 | this.nsfwPolicy = hash.nsfwPolicy |
59 | this.webTorrentEnabled = hash.webTorrentEnabled | 37 | this.webTorrentEnabled = hash.webTorrentEnabled |
38 | this.videosHistoryEnabled = hash.videosHistoryEnabled | ||
60 | this.autoPlayVideo = hash.autoPlayVideo | 39 | this.autoPlayVideo = hash.autoPlayVideo |
61 | this.createdAt = hash.createdAt | 40 | this.createdAt = hash.createdAt |
62 | this.blocked = hash.blocked | 41 | this.blocked = hash.blocked |
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss index cf1725ef9..4b2c86ae9 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss | |||
@@ -54,9 +54,7 @@ | |||
54 | 54 | ||
55 | /deep/ .ui-progressbar { | 55 | /deep/ .ui-progressbar { |
56 | font-size: 15px !important; | 56 | font-size: 15px !important; |
57 | color: #fff !important; | ||
58 | height: 30px !important; | 57 | height: 30px !important; |
59 | line-height: 30px !important; | ||
60 | border-radius: 3px !important; | 58 | border-radius: 3px !important; |
61 | background-color: rgba(11, 204, 41, 0.16) !important; | 59 | background-color: rgba(11, 204, 41, 0.16) !important; |
62 | 60 | ||
@@ -68,6 +66,8 @@ | |||
68 | text-align: left; | 66 | text-align: left; |
69 | padding-left: 18px; | 67 | padding-left: 18px; |
70 | margin-top: 0 !important; | 68 | margin-top: 0 !important; |
69 | color: #fff !important; | ||
70 | line-height: 30px !important; | ||
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
diff --git a/client/src/sass/primeng-custom.scss b/client/src/sass/primeng-custom.scss index 0568de4e2..1d6eebcfa 100644 --- a/client/src/sass/primeng-custom.scss +++ b/client/src/sass/primeng-custom.scss | |||
@@ -2,7 +2,7 @@ | |||
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | @import '~primeng/resources/primeng.css'; | 4 | @import '~primeng/resources/primeng.css'; |
5 | @import '~primeng/resources/themes/bootstrap/theme.css'; | 5 | @import '~primeng/resources/themes/nova-light/theme.css'; |
6 | 6 | ||
7 | @mixin glyphicon-light { | 7 | @mixin glyphicon-light { |
8 | font-family: 'Glyphicons Halflings'; | 8 | font-family: 'Glyphicons Halflings'; |
@@ -12,10 +12,9 @@ | |||
12 | 12 | ||
13 | // data table customizations | 13 | // data table customizations |
14 | p-table { | 14 | p-table { |
15 | font-size: 15px !important; | ||
16 | |||
17 | .ui-table-caption { | 15 | .ui-table-caption { |
18 | border: none; | 16 | border: none !important; |
17 | background-color: #fff !important; | ||
19 | 18 | ||
20 | .caption { | 19 | .caption { |
21 | height: 40px; | 20 | height: 40px; |
@@ -24,6 +23,17 @@ p-table { | |||
24 | } | 23 | } |
25 | } | 24 | } |
26 | 25 | ||
26 | th { | ||
27 | background-color: #fff !important; | ||
28 | outline: 0; | ||
29 | } | ||
30 | |||
31 | td, th { | ||
32 | font-family: $main-fonts; | ||
33 | font-size: 15px !important; | ||
34 | color: var(--mainForegroundColor) !important; | ||
35 | } | ||
36 | |||
27 | td { | 37 | td { |
28 | padding-left: 15px !important; | 38 | padding-left: 15px !important; |
29 | 39 | ||
@@ -35,12 +45,16 @@ p-table { | |||
35 | } | 45 | } |
36 | 46 | ||
37 | tr { | 47 | tr { |
48 | outline: 0; | ||
38 | background-color: var(--mainBackgroundColor) !important; | 49 | background-color: var(--mainBackgroundColor) !important; |
39 | height: 46px; | 50 | height: 46px; |
40 | 51 | ||
41 | &.ui-state-highlight { | 52 | &.ui-state-highlight { |
42 | background-color:var(--submenuColor) !important; | 53 | background-color: var(--submenuColor) !important; |
43 | color:var(--mainForegroundColor) !important; | 54 | |
55 | td, td > a { | ||
56 | color: var(--mainForegroundColor) !important; | ||
57 | } | ||
44 | } | 58 | } |
45 | } | 59 | } |
46 | 60 | ||
@@ -56,6 +70,10 @@ p-table { | |||
56 | } | 70 | } |
57 | } | 71 | } |
58 | 72 | ||
73 | td { | ||
74 | border: none !important; | ||
75 | } | ||
76 | |||
59 | &:first-child td { | 77 | &:first-child td { |
60 | border-top: none !important; | 78 | border-top: none !important; |
61 | } | 79 | } |
@@ -93,14 +111,14 @@ p-table { | |||
93 | } | 111 | } |
94 | 112 | ||
95 | &.ui-state-highlight { | 113 | &.ui-state-highlight { |
96 | background-color:var(--submenuColor) !important; | 114 | background-color: var(--submenuColor) !important; |
97 | 115 | ||
98 | .pi { | 116 | .pi { |
99 | @extend .glyphicon; | 117 | @extend .glyphicon; |
100 | 118 | ||
101 | color: #000; | 119 | color: #000 !important; |
102 | font-size: 11px; | 120 | font-size: 11px !important; |
103 | top: 0; | 121 | top: 0 !important; |
104 | 122 | ||
105 | &.pi-sort-up { | 123 | &.pi-sort-up { |
106 | @extend .glyphicon-triangle-top; | 124 | @extend .glyphicon-triangle-top; |
@@ -177,11 +195,12 @@ p-table { | |||
177 | a { | 195 | a { |
178 | color: #000 !important; | 196 | color: #000 !important; |
179 | font-weight: $font-semibold !important; | 197 | font-weight: $font-semibold !important; |
180 | margin: 0 10px !important; | 198 | margin: 0 5px !important; |
181 | outline: 0 !important; | 199 | outline: 0 !important; |
182 | border-radius: 3px !important; | 200 | border-radius: 3px !important; |
183 | padding: 5px 2px !important; | 201 | padding: 5px 2px !important; |
184 | height: auto !important; | 202 | height: auto !important; |
203 | line-height: initial !important; | ||
185 | 204 | ||
186 | &.ui-state-active { | 205 | &.ui-state-active { |
187 | &, &:hover, &:active, &:focus { | 206 | &, &:hover, &:active, &:focus { |
@@ -210,11 +229,23 @@ p-calendar .ui-datepicker { | |||
210 | .ui-datepicker-next { | 229 | .ui-datepicker-next { |
211 | @extend .glyphicon-chevron-right; | 230 | @extend .glyphicon-chevron-right; |
212 | @include glyphicon-light; | 231 | @include glyphicon-light; |
232 | |||
233 | text-align: right; | ||
234 | |||
235 | .pi.pi-chevron-right { | ||
236 | display: none !important; | ||
237 | } | ||
213 | } | 238 | } |
214 | 239 | ||
215 | .ui-datepicker-prev { | 240 | .ui-datepicker-prev { |
216 | @extend .glyphicon-chevron-left; | 241 | @extend .glyphicon-chevron-left; |
217 | @include glyphicon-light; | 242 | @include glyphicon-light; |
243 | |||
244 | text-align: left; | ||
245 | |||
246 | .pi.pi-chevron-left { | ||
247 | display: none !important; | ||
248 | } | ||
218 | } | 249 | } |
219 | } | 250 | } |
220 | 251 | ||
@@ -232,6 +263,7 @@ p-calendar .ui-datepicker { | |||
232 | } | 263 | } |
233 | } | 264 | } |
234 | 265 | ||
266 | |||
235 | .ui-chkbox-box { | 267 | .ui-chkbox-box { |
236 | &.ui-state-active { | 268 | &.ui-state-active { |
237 | border-color: var(--mainColor) !important; | 269 | border-color: var(--mainColor) !important; |
@@ -240,13 +272,15 @@ p-calendar .ui-datepicker { | |||
240 | 272 | ||
241 | .ui-chkbox-icon { | 273 | .ui-chkbox-icon { |
242 | position: relative; | 274 | position: relative; |
275 | overflow: visible !important; | ||
243 | 276 | ||
244 | &:after { | 277 | &:after { |
245 | content: ''; | 278 | content: ''; |
246 | position: absolute; | 279 | position: absolute; |
247 | left: 5px; | 280 | top: 1px; |
281 | left: 7px; | ||
248 | width: 5px; | 282 | width: 5px; |
249 | height: 12px; | 283 | height: 13px; |
250 | opacity: 0; | 284 | opacity: 0; |
251 | transform: rotate(45deg) scale(0); | 285 | transform: rotate(45deg) scale(0); |
252 | border-right: 2px solid var(--mainBackgroundColor); | 286 | border-right: 2px solid var(--mainBackgroundColor); |
@@ -258,4 +292,10 @@ p-calendar .ui-datepicker { | |||
258 | transform: rotate(45deg) scale(1); | 292 | transform: rotate(45deg) scale(1); |
259 | } | 293 | } |
260 | } | 294 | } |
261 | } \ No newline at end of file | 295 | } |
296 | |||
297 | p-inputswitch { | ||
298 | .ui-inputswitch-checked .ui-inputswitch-slider { | ||
299 | background-color: var(--mainColor) !important; | ||
300 | } | ||
301 | } | ||
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index ea017c338..180ced810 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -370,6 +370,7 @@ export class UserModel extends Model<UserModel> { | |||
370 | emailVerified: this.emailVerified, | 370 | emailVerified: this.emailVerified, |
371 | nsfwPolicy: this.nsfwPolicy, | 371 | nsfwPolicy: this.nsfwPolicy, |
372 | webTorrentEnabled: this.webTorrentEnabled, | 372 | webTorrentEnabled: this.webTorrentEnabled, |
373 | videosHistoryEnabled: this.videosHistoryEnabled, | ||
373 | autoPlayVideo: this.autoPlayVideo, | 374 | autoPlayVideo: this.autoPlayVideo, |
374 | role: this.role, | 375 | role: this.role, |
375 | roleLabel: USER_ROLE_LABELS[ this.role ], | 376 | roleLabel: USER_ROLE_LABELS[ this.role ], |
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts index 82af17516..2aabff494 100644 --- a/shared/models/users/user.model.ts +++ b/shared/models/users/user.model.ts | |||
@@ -9,7 +9,11 @@ export interface User { | |||
9 | email: string | 9 | email: string |
10 | emailVerified: boolean | 10 | emailVerified: boolean |
11 | nsfwPolicy: NSFWPolicyType | 11 | nsfwPolicy: NSFWPolicyType |
12 | |||
12 | autoPlayVideo: boolean | 13 | autoPlayVideo: boolean |
14 | webTorrentEnabled: boolean | ||
15 | videosHistoryEnabled: boolean | ||
16 | |||
13 | role: UserRole | 17 | role: UserRole |
14 | videoQuota: number | 18 | videoQuota: number |
15 | videoQuotaDaily: number | 19 | videoQuotaDaily: number |