Replace NSFW with "mature or explicit content"
Blur their thumbnail and name
This commit is contained in:
parent
c296250511
commit
d6e32a2e91
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form">
|
<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="displayNSFW">Display NSFW videos</label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox" id="displayNSFW"
|
type="checkbox" id="displayNSFW"
|
||||||
formControlName="displayNSFW"
|
formControlName="displayNSFW"
|
||||||
>
|
>
|
||||||
|
<label for="displayNSFW">Display videos that contain mature or explicit content</label>
|
||||||
<div *ngIf="formErrors['displayNSFW']" class="alert alert-danger">
|
<div *ngIf="formErrors['displayNSFW']" class="alert alert-danger">
|
||||||
{{ formErrors['displayNSFW'] }}
|
{{ formErrors['displayNSFW'] }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="nsfw">NSFW</label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox" id="nsfw"
|
type="checkbox" id="nsfw"
|
||||||
formControlName="nsfw"
|
formControlName="nsfw"
|
||||||
>
|
>
|
||||||
|
<label for="nsfw">This video contains mature or explicit content</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="nsfw">NSFW</label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox" id="nsfw"
|
type="checkbox" id="nsfw"
|
||||||
formControlName="nsfw"
|
formControlName="nsfw"
|
||||||
>
|
>
|
||||||
|
<label for="nsfw">This video contains mature or explicit content</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div>
|
<div id="torrent-info-peers" class="col-md-4 col-sm-4 col-xs-4">Number of peers: {{ numPeers }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Video informations -->
|
<!-- Video information -->
|
||||||
<div *ngIf="video !== null" id="video-info">
|
<div *ngIf="video !== null" id="video-info">
|
||||||
<div class="row video-name-views">
|
<div class="row video-name-views">
|
||||||
<div class="col-xs-8 col-md-8 video-name">
|
<div class="col-xs-8 col-md-8 video-name">
|
||||||
|
|
|
@ -218,7 +218,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
let observable
|
let observable
|
||||||
if (this.video.isVideoNSFWForUser(this.authService.getUser())) {
|
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 {
|
} else {
|
||||||
observable = Observable.of(true)
|
observable = Observable.of(true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,14 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject'
|
||||||
|
|
||||||
import { NotificationsService } from 'angular2-notifications'
|
import { NotificationsService } from 'angular2-notifications'
|
||||||
|
|
||||||
|
import { AuthService } from '../../core'
|
||||||
import {
|
import {
|
||||||
SortField,
|
SortField,
|
||||||
Video,
|
Video,
|
||||||
VideoService,
|
VideoService,
|
||||||
VideoPagination
|
VideoPagination
|
||||||
} from '../shared'
|
} from '../shared'
|
||||||
import { Search, SearchField, SearchService } from '../../shared'
|
import { Search, SearchField, SearchService, User} from '../../shared'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-videos-list',
|
selector: 'my-videos-list',
|
||||||
|
@ -26,6 +27,7 @@ export class VideoListComponent implements OnInit, OnDestroy {
|
||||||
totalItems: null
|
totalItems: null
|
||||||
}
|
}
|
||||||
sort: SortField
|
sort: SortField
|
||||||
|
user: User
|
||||||
videos: Video[] = []
|
videos: Video[] = []
|
||||||
|
|
||||||
private search: Search
|
private search: Search
|
||||||
|
@ -33,6 +35,7 @@ export class VideoListComponent implements OnInit, OnDestroy {
|
||||||
private subSearch: Subscription
|
private subSearch: Subscription
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
private authService: AuthService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
@ -41,6 +44,8 @@ export class VideoListComponent implements OnInit, OnDestroy {
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
this.user = this.authService.getUser()
|
||||||
|
|
||||||
// Subscribe to route changes
|
// Subscribe to route changes
|
||||||
this.subActivatedRoute = this.route.params.subscribe(routeParams => {
|
this.subActivatedRoute = this.route.params.subscribe(routeParams => {
|
||||||
this.loadRouteParams(routeParams)
|
this.loadRouteParams(routeParams)
|
||||||
|
|
|
@ -3,10 +3,7 @@
|
||||||
[routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.description"
|
[routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.description"
|
||||||
class="video-miniature-thumbnail"
|
class="video-miniature-thumbnail"
|
||||||
>
|
>
|
||||||
<img *ngIf="isVideoNSFWForThisUser() === false" [attr.src]="video.thumbnailUrl" alt="video thumbnail" />
|
<img [attr.src]="video.thumbnailUrl" alt="video thumbnail" [ngClass]="{ 'blur-filter': isVideoNSFWForThisUser() }" />
|
||||||
<div *ngIf="isVideoNSFWForThisUser()" class="thumbnail-nsfw">
|
|
||||||
NSFW
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="video-miniature-thumbnail-overlay">
|
<div class="video-miniature-thumbnail-overlay">
|
||||||
<span class="video-miniature-thumbnail-overlay-views">{{ video.views }} views</span>
|
<span class="video-miniature-thumbnail-overlay-views">{{ video.views }} views</span>
|
||||||
|
@ -14,9 +11,14 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="video-miniature-informations">
|
<div class="video-miniature-information">
|
||||||
<span class="video-miniature-name">
|
<span class="video-miniature-name">
|
||||||
<a [routerLink]="['/videos/watch', video.uuid]" [attr.title]="getVideoName()" class="video-miniature-name">{{ getVideoName() }}</a>
|
<a
|
||||||
|
class="video-miniature-name"
|
||||||
|
[routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoNSFWForThisUser() }"
|
||||||
|
>
|
||||||
|
{{ video.name }}
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="video-miniature-tags">
|
<div class="video-miniature-tags">
|
||||||
|
|
|
@ -9,24 +9,16 @@
|
||||||
.video-miniature-thumbnail {
|
.video-miniature-thumbnail {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumbnail-nsfw {
|
img.blur-filter {
|
||||||
background-color: #000;
|
filter: blur(5px);
|
||||||
color: #fff;
|
transform : scale(1.03);
|
||||||
text-align: center;
|
|
||||||
font-size: 30px;
|
|
||||||
line-height: 110px;
|
|
||||||
|
|
||||||
width: 200px;
|
|
||||||
height: 110px;
|
|
||||||
}
|
|
||||||
|
|
||||||
img, .thumbnail-nsfw {
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-miniature-thumbnail-overlay {
|
.video-miniature-thumbnail-overlay {
|
||||||
|
@ -51,7 +43,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-miniature-informations {
|
.video-miniature-information {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
.video-miniature-name {
|
.video-miniature-name {
|
||||||
|
@ -68,6 +60,11 @@
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.blur-filter {
|
||||||
|
filter: blur(3px);
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.video-miniature-tags {
|
.video-miniature-tags {
|
||||||
// Fix for chrome when tags are long
|
// Fix for chrome when tags are long
|
||||||
width: 201px;
|
width: 201px;
|
||||||
|
|
|
@ -13,14 +13,6 @@ export class VideoMiniatureComponent {
|
||||||
@Input() user: User
|
@Input() user: User
|
||||||
@Input() video: Video
|
@Input() video: Video
|
||||||
|
|
||||||
getVideoName () {
|
|
||||||
if (this.isVideoNSFWForThisUser()) {
|
|
||||||
return 'NSFW'
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.video.name
|
|
||||||
}
|
|
||||||
|
|
||||||
isVideoNSFWForThisUser () {
|
isVideoNSFWForThisUser () {
|
||||||
return this.video.isVideoNSFWForUser(this.user)
|
return this.video.isVideoNSFWForUser(this.user)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue