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
index 4e8dfde1d..ed59e4689 100644
--- 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
@@ -12,3 +12,9 @@ input[type=submit] {
display: block;
margin-top: 15px;
}
+
+.peertube-select-container {
+ @include peertube-select-container(340px);
+
+ margin-bottom: 30px;
+}
\ 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
index 917f31651..de213717e 100644
--- 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
@@ -29,7 +29,7 @@ export class AccountDetailsComponent extends FormReactive implements OnInit {
buildForm () {
this.form = this.formBuilder.group({
- displayNSFW: [ this.user.displayNSFW ],
+ nsfwPolicy: [ this.user.nsfwPolicy ],
autoPlayVideo: [ this.user.autoPlayVideo ]
})
@@ -41,10 +41,10 @@ export class AccountDetailsComponent extends FormReactive implements OnInit {
}
updateDetails () {
- const displayNSFW = this.form.value['displayNSFW']
+ const nsfwPolicy = this.form.value['nsfwPolicy']
const autoPlayVideo = this.form.value['autoPlayVideo']
const details: UserUpdateMe = {
- displayNSFW,
+ nsfwPolicy,
autoPlayVideo
}
diff --git a/client/src/app/account/account-videos/account-videos.component.html b/client/src/app/account/account-videos/account-videos.component.html
index d7e2230b0..66ce3a77b 100644
--- a/client/src/app/account/account-videos/account-videos.component.html
+++ b/client/src/app/account/account-videos/account-videos.component.html
@@ -18,6 +18,7 @@
{{ video.name }}
{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views
+
{{ video.privacy.label }}
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss
index 449cc6af4..f276ea389 100644
--- a/client/src/app/account/account-videos/account-videos.component.scss
+++ b/client/src/app/account/account-videos/account-videos.component.scss
@@ -79,8 +79,12 @@
font-weight: $font-semibold;
}
- .video-info-date-views {
+ .video-info-date-views, .video-info-private {
font-size: 13px;
+
+ &.video-info-private {
+ font-weight: $font-semibold;
+ }
}
}
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts
index 366eea110..74ed1c580 100644
--- a/client/src/app/core/auth/auth-user.model.ts
+++ b/client/src/app/core/auth/auth-user.model.ts
@@ -3,6 +3,7 @@ import { UserRight } from '../../../../../shared/models/users/user-right.enum'
// Do not use the barrel (dependency loop)
import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role'
import { User, UserConstructorHash } from '../../shared/users/user.model'
+import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type'
export type TokenOptions = {
accessToken: string
@@ -70,7 +71,7 @@ export class AuthUser extends User {
ROLE: 'role',
EMAIL: 'email',
USERNAME: 'username',
- DISPLAY_NSFW: 'display_nsfw',
+ NSFW_POLICY: 'nsfw_policy',
AUTO_PLAY_VIDEO: 'auto_play_video'
}
@@ -85,7 +86,7 @@ export class AuthUser extends User {
username: peertubeLocalStorage.getItem(this.KEYS.USERNAME),
email: peertubeLocalStorage.getItem(this.KEYS.EMAIL),
role: parseInt(peertubeLocalStorage.getItem(this.KEYS.ROLE), 10) as UserRole,
- displayNSFW: peertubeLocalStorage.getItem(this.KEYS.DISPLAY_NSFW) === 'true',
+ nsfwPolicy: peertubeLocalStorage.getItem(this.KEYS.NSFW_POLICY) as NSFWPolicyType,
autoPlayVideo: peertubeLocalStorage.getItem(this.KEYS.AUTO_PLAY_VIDEO) === 'true'
},
Tokens.load()
@@ -99,7 +100,7 @@ export class AuthUser extends User {
peertubeLocalStorage.removeItem(this.KEYS.USERNAME)
peertubeLocalStorage.removeItem(this.KEYS.ID)
peertubeLocalStorage.removeItem(this.KEYS.ROLE)
- peertubeLocalStorage.removeItem(this.KEYS.DISPLAY_NSFW)
+ peertubeLocalStorage.removeItem(this.KEYS.NSFW_POLICY)
peertubeLocalStorage.removeItem(this.KEYS.AUTO_PLAY_VIDEO)
peertubeLocalStorage.removeItem(this.KEYS.EMAIL)
Tokens.flush()
@@ -136,7 +137,7 @@ export class AuthUser extends User {
peertubeLocalStorage.setItem(AuthUser.KEYS.USERNAME, this.username)
peertubeLocalStorage.setItem(AuthUser.KEYS.EMAIL, this.email)
peertubeLocalStorage.setItem(AuthUser.KEYS.ROLE, this.role.toString())
- peertubeLocalStorage.setItem(AuthUser.KEYS.DISPLAY_NSFW, JSON.stringify(this.displayNSFW))
+ peertubeLocalStorage.setItem(AuthUser.KEYS.NSFW_POLICY, this.nsfwPolicy.toString())
peertubeLocalStorage.setItem(AuthUser.KEYS.AUTO_PLAY_VIDEO, JSON.stringify(this.autoPlayVideo))
this.tokens.save()
}
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index 987d64d2a..a8beb242d 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -5,7 +5,6 @@ import 'rxjs/add/operator/do'
import { ReplaySubject } from 'rxjs/ReplaySubject'
import { ServerConfig } from '../../../../../shared'
import { About } from '../../../../../shared/models/server/about.model'
-import { ServerStats } from '../../../../../shared/models/server/server-stats.model'
import { environment } from '../../../environments/environment'
@Injectable()
@@ -26,6 +25,7 @@ export class ServerService {
shortDescription: 'PeerTube, a federated (ActivityPub) video streaming platform ' +
'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.',
defaultClientRoute: '',
+ defaultNSFWPolicy: 'do_not_list' as 'do_not_list',
customizations: {
javascript: '',
css: ''
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html
index e37d93b62..3da5701a0 100644
--- a/client/src/app/shared/misc/help.component.html
+++ b/client/src/app/shared/misc/help.component.html
@@ -13,6 +13,9 @@
diff --git a/client/src/app/shared/misc/help.component.scss b/client/src/app/shared/misc/help.component.scss
index b8bf3a7a5..0df8b86fa 100644
--- a/client/src/app/shared/misc/help.component.scss
+++ b/client/src/app/shared/misc/help.component.scss
@@ -12,20 +12,16 @@
}
/deep/ {
- .help-tooltip {
- opacity: 1 !important;
+ .popover-body {
+ text-align: left;
+ padding: 10px;
+ max-width: 300px;
- .tooltip-inner {
- text-align: left;
- padding: 10px;
- max-width: 300px;
-
- font-size: 13px;
- font-family: $main-fonts;
- background-color: #fff;
- color: #000;
- box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
- }
+ font-size: 13px;
+ font-family: $main-fonts;
+ background-color: #fff;
+ color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
ul {
padding-left: 20px;
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.ts
index 89dd1dae5..0373a63de 100644
--- a/client/src/app/shared/misc/help.component.ts
+++ b/client/src/app/shared/misc/help.component.ts
@@ -1,6 +1,5 @@
-import { Component, ElementRef, HostListener, Input, OnInit, ViewChild, OnChanges } from '@angular/core'
+import { Component, Input, OnChanges, OnInit } from '@angular/core'
import { MarkdownService } from '@app/videos/shared'
-import { TooltipDirective } from 'ngx-bootstrap/tooltip'
@Component({
selector: 'my-help',
@@ -9,16 +8,14 @@ import { TooltipDirective } from 'ngx-bootstrap/tooltip'
})
export class HelpComponent implements OnInit, OnChanges {
- @ViewChild('tooltipDirective') tooltipDirective: TooltipDirective
@Input() preHtml = ''
@Input() postHtml = ''
@Input() customHtml = ''
@Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom'
+ @Input() tooltipPlacement = 'right'
mainHtml = ''
- constructor (private elementRef: ElementRef) { }
-
ngOnInit () {
this.init()
}
@@ -27,15 +24,6 @@ export class HelpComponent implements OnInit, OnChanges {
this.init()
}
- @HostListener('document:click', ['$event.target'])
- public onClick (targetElement) {
- const clickedInside = this.elementRef.nativeElement.contains(targetElement)
-
- if (this.tooltipDirective.isOpen && !clickedInside) {
- this.tooltipDirective.hide()
- }
- }
-
private init () {
if (this.helpType === 'custom') {
this.mainHtml = this.customHtml
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 4a94b032d..2bdc48a1d 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -1,5 +1,6 @@
import { hasUserRight, User as UserServerModel, UserRight, UserRole, VideoChannel } from '../../../../../shared'
import { Account } from '../account/account.model'
+import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type'
export type UserConstructorHash = {
id: number,
@@ -7,7 +8,7 @@ export type UserConstructorHash = {
email: string,
role: UserRole,
videoQuota?: number,
- displayNSFW?: boolean,
+ nsfwPolicy?: NSFWPolicyType,
autoPlayVideo?: boolean,
createdAt?: Date,
account?: Account,
@@ -18,7 +19,7 @@ export class User implements UserServerModel {
username: string
email: string
role: UserRole
- displayNSFW: boolean
+ nsfwPolicy: NSFWPolicyType
autoPlayVideo: boolean
videoQuota: number
account: Account
@@ -40,8 +41,8 @@ export class User implements UserServerModel {
this.videoQuota = hash.videoQuota
}
- if (hash.displayNSFW !== undefined) {
- this.displayNSFW = hash.displayNSFW
+ if (hash.nsfwPolicy !== undefined) {
+ this.nsfwPolicy = hash.nsfwPolicy
}
if (hash.autoPlayVideo !== undefined) {
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts
index a1f7207a2..5397aa37f 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/video/video-details.model.ts
@@ -1,17 +1,9 @@
-import {
- UserRight,
- VideoChannel,
- VideoDetails as VideoDetailsServerModel,
- VideoFile,
- VideoPrivacy
-} from '../../../../../shared'
+import { UserRight, VideoChannel, VideoDetails as VideoDetailsServerModel, VideoFile } from '../../../../../shared'
import { Account } from '../../../../../shared/models/actors'
-import { VideoConstant } from '../../../../../shared/models/videos/video.model'
import { AuthUser } from '../../core'
import { Video } from '../../shared/video/video.model'
export class VideoDetails extends Video implements VideoDetailsServerModel {
- privacy: VideoConstant
descriptionPath: string
support: string
channel: VideoChannel
@@ -26,7 +18,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
constructor (hash: VideoDetailsServerModel) {
super(hash)
- this.privacy = hash.privacy
this.descriptionPath = hash.descriptionPath
this.files = hash.files
this.channel = hash.channel
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html
index f28e9b8d9..233432142 100644
--- a/client/src/app/shared/video/video-miniature.component.html
+++ b/client/src/app/shared/video/video-miniature.component.html
@@ -1,11 +1,11 @@