videoDetail.pug 1.31 KB
extends layouts/main
include mixins/videoPlayer

block content
    .video-detail__container
        +videoPlayer({
            src:video.fileUrl
        })
        .video__info
            if loggedUser && video.creator.id === loggedUser.id
                a(href=routes.editVideo(video.id))
                    button Edit video
            h5.video__title=video.title
            p.video__description=video.description
            if video.views === 1
                span.video__views 1 view
            else 
                span.video__views #{video.views} views
            .video__author
                |Uploaded by 
                a(href=routes.userDetail(video.creator.id))=video.creator.name
        .video__comments
            if video.comments.length === 1
                span.video__comment-number
                    span#jsCommentNumber 1 
                    |  comment
            else
                span.video__comment-number
                    span#jsCommentNumber=video.comments.length 
                    |  comments
            form.add__comment#jsAddComment
                input(type="text", placeholder="Add a comment", name="comment")
            ul.video__comments-list#jsCommentList
                each comment in video.comments.reverse()
                    li
                        span=comment.text