WIP: Display image icon and comment count on video miniature component
This commit is contained in:
parent
c8804274fe
commit
19a35e6060
|
@ -116,6 +116,8 @@ export class Video implements VideoServerModel {
|
|||
|
||||
automaticTags?: string[]
|
||||
|
||||
commentCount: number
|
||||
|
||||
static buildWatchUrl (video: Partial<Pick<Video, 'uuid' | 'shortUUID'>>) {
|
||||
return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid })
|
||||
}
|
||||
|
@ -209,6 +211,8 @@ export class Video implements VideoServerModel {
|
|||
this.aspectRatio = hash.aspectRatio
|
||||
|
||||
this.automaticTags = hash.automaticTags
|
||||
|
||||
this.commentCount = hash.commentCount
|
||||
}
|
||||
|
||||
isVideoNSFWForUser (user: User, serverConfig: HTMLServerConfig) {
|
||||
|
|
|
@ -41,6 +41,11 @@
|
|||
|
||||
<my-video-views-counter *ngIf="displayOptions.views" [video]="video"></my-video-views-counter>
|
||||
</span>
|
||||
|
||||
<span class="comment-count" *ngIf="displayOptions.commentCount">
|
||||
<my-global-icon iconName="message-circle"></my-global-icon>
|
||||
<span>{{ video.commentCount }}</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<a *ngIf="displayOptions.by" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
|
||||
|
|
|
@ -109,6 +109,15 @@ my-actor-avatar {
|
|||
|
||||
.video-miniature-created-at-views {
|
||||
display: block;
|
||||
|
||||
.comment-count {
|
||||
float: right;
|
||||
text-align: right;
|
||||
|
||||
span {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.video-actions {
|
||||
|
|
|
@ -25,6 +25,7 @@ import { NgClass, NgIf, NgFor } from '@angular/common'
|
|||
import { Video } from '../shared-main/video/video.model'
|
||||
import { VideoService } from '../shared-main/video/video.service'
|
||||
import { VideoPlaylistService } from '../shared-video-playlist/video-playlist.service'
|
||||
import { GlobalIconComponent } from '../shared-icons/global-icon.component'
|
||||
|
||||
export type MiniatureDisplayOptions = {
|
||||
date?: boolean
|
||||
|
@ -37,7 +38,8 @@ export type MiniatureDisplayOptions = {
|
|||
nsfw?: boolean
|
||||
|
||||
by?: boolean
|
||||
forceChannelInBy?: boolean
|
||||
forceChannelInBy?: boolean,
|
||||
commentCount?: boolean
|
||||
}
|
||||
@Component({
|
||||
selector: 'my-video-miniature',
|
||||
|
@ -55,7 +57,8 @@ export type MiniatureDisplayOptions = {
|
|||
VideoViewsCounterComponent,
|
||||
RouterLink,
|
||||
NgFor,
|
||||
VideoActionsDropdownComponent
|
||||
VideoActionsDropdownComponent,
|
||||
GlobalIconComponent
|
||||
]
|
||||
})
|
||||
export class VideoMiniatureComponent implements OnInit {
|
||||
|
@ -67,6 +70,7 @@ export class VideoMiniatureComponent implements OnInit {
|
|||
date: true,
|
||||
views: true,
|
||||
by: true,
|
||||
commentCount: true,
|
||||
avatar: false,
|
||||
privacyLabel: false,
|
||||
privacyText: false,
|
||||
|
|
Loading…
Reference in New Issue