From d6e32a2e91c090ed342eaf0709caac2630a67ff3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Oct 2017 08:51:40 +0200 Subject: [PATCH] Replace NSFW with "mature or explicit content" Blur their thumbnail and name --- .../account-details.component.html | 2 +- .../+video-edit/video-add.component.html | 2 +- .../+video-edit/video-update.component.html | 2 +- .../+video-watch/video-watch.component.html | 2 +- .../+video-watch/video-watch.component.ts | 5 +++- .../videos/video-list/video-list.component.ts | 7 +++++- .../video-list/video-miniature.component.html | 14 ++++++----- .../video-list/video-miniature.component.scss | 25 ++++++++----------- .../video-list/video-miniature.component.ts | 8 ------ 9 files changed, 33 insertions(+), 34 deletions(-) diff --git a/client/src/app/account/account-details/account-details.component.html b/client/src/app/account/account-details/account-details.component.html index 24b0750d2..8f4f176af 100644 --- a/client/src/app/account/account-details/account-details.component.html +++ b/client/src/app/account/account-details/account-details.component.html @@ -2,11 +2,11 @@
- +
{{ formErrors['displayNSFW'] }}
diff --git a/client/src/app/videos/+video-edit/video-add.component.html b/client/src/app/videos/+video-edit/video-add.component.html index 136c82a7c..3bf4101f4 100644 --- a/client/src/app/videos/+video-edit/video-add.component.html +++ b/client/src/app/videos/+video-edit/video-add.component.html @@ -18,11 +18,11 @@
- +
diff --git a/client/src/app/videos/+video-edit/video-update.component.html b/client/src/app/videos/+video-edit/video-update.component.html index 4ade5a671..4dcb3ea56 100644 --- a/client/src/app/videos/+video-edit/video-update.component.html +++ b/client/src/app/videos/+video-edit/video-update.component.html @@ -18,11 +18,11 @@
- +
diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html index 6e502aae2..4b594e7ed 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.html +++ b/client/src/app/videos/+video-watch/video-watch.component.html @@ -29,7 +29,7 @@
Number of peers: {{ numPeers }}
- +
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 2e1adb043..199666bdc 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -218,7 +218,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { let observable if (this.video.isVideoNSFWForUser(this.authService.getUser())) { - observable = this.confirmService.confirm('This video is not safe for work. Are you sure you want to watch it?', 'NSFW') + observable = this.confirmService.confirm( + 'This video contains mature or explicit content. Are you sure you want to watch it?', + 'Mature or explicit content' + ) } else { observable = Observable.of(true) } diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index d2f0ae045..35a7b6521 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts @@ -5,13 +5,14 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject' import { NotificationsService } from 'angular2-notifications' +import { AuthService } from '../../core' import { SortField, Video, VideoService, VideoPagination } from '../shared' -import { Search, SearchField, SearchService } from '../../shared' +import { Search, SearchField, SearchService, User} from '../../shared' @Component({ selector: 'my-videos-list', @@ -26,6 +27,7 @@ export class VideoListComponent implements OnInit, OnDestroy { totalItems: null } sort: SortField + user: User videos: Video[] = [] private search: Search @@ -33,6 +35,7 @@ export class VideoListComponent implements OnInit, OnDestroy { private subSearch: Subscription constructor ( + private authService: AuthService, private notificationsService: NotificationsService, private router: Router, private route: ActivatedRoute, @@ -41,6 +44,8 @@ export class VideoListComponent implements OnInit, OnDestroy { ) {} ngOnInit () { + this.user = this.authService.getUser() + // Subscribe to route changes this.subActivatedRoute = this.route.params.subscribe(routeParams => { this.loadRouteParams(routeParams) diff --git a/client/src/app/videos/video-list/video-miniature.component.html b/client/src/app/videos/video-list/video-miniature.component.html index 6525b67bf..abe87025f 100644 --- a/client/src/app/videos/video-list/video-miniature.component.html +++ b/client/src/app/videos/video-list/video-miniature.component.html @@ -3,10 +3,7 @@ [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.description" class="video-miniature-thumbnail" > - video thumbnail -
- NSFW -
+ video thumbnail
{{ video.views }} views @@ -14,9 +11,14 @@
-
+
- {{ getVideoName() }} + + {{ video.name }} +
diff --git a/client/src/app/videos/video-list/video-miniature.component.scss b/client/src/app/videos/video-list/video-miniature.component.scss index c2743c3be..066792d10 100644 --- a/client/src/app/videos/video-list/video-miniature.component.scss +++ b/client/src/app/videos/video-list/video-miniature.component.scss @@ -9,24 +9,16 @@ .video-miniature-thumbnail { display: inline-block; position: relative; + border-radius: 3px; + overflow: hidden; &:hover { text-decoration: none !important; } - .thumbnail-nsfw { - background-color: #000; - color: #fff; - text-align: center; - font-size: 30px; - line-height: 110px; - - width: 200px; - height: 110px; - } - - img, .thumbnail-nsfw { - border-radius: 3px; + img.blur-filter { + filter: blur(5px); + transform : scale(1.03); } .video-miniature-thumbnail-overlay { @@ -51,7 +43,7 @@ } } - .video-miniature-informations { + .video-miniature-information { width: 200px; .video-miniature-name { @@ -68,6 +60,11 @@ text-decoration: none; } + &.blur-filter { + filter: blur(3px); + padding-left: 4px; + } + .video-miniature-tags { // Fix for chrome when tags are long width: 201px; diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts index 8d8b817ee..18434dad2 100644 --- a/client/src/app/videos/video-list/video-miniature.component.ts +++ b/client/src/app/videos/video-list/video-miniature.component.ts @@ -13,14 +13,6 @@ export class VideoMiniatureComponent { @Input() user: User @Input() video: Video - getVideoName () { - if (this.isVideoNSFWForThisUser()) { - return 'NSFW' - } - - return this.video.name - } - isVideoNSFWForThisUser () { return this.video.isVideoNSFWForUser(this.user) } -- 2.25.1