mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-14 12:27:28 +00:00
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
mixin video_list_item(className, video, instanceOrigin, options = {})
|
|
div(class={[className]: true, "video-list-item--watched": video.watched})
|
|
- let link = `/watch?v=${video.videoId}`
|
|
if options.continuous
|
|
- link += `&continuous=1&session-watched=${sessionWatchedNext}`
|
|
div.thumbnail
|
|
a(href=link tabindex="-1").thumbnail__link
|
|
img(src=`/vi/${video.videoId}/mqdefault.jpg` width=320 height=180 alt="").image
|
|
if video.second__lengthText != undefined
|
|
span.duration= video.second__lengthText
|
|
.info
|
|
div.title: a(href=link).title-link= video.title
|
|
div.author-line
|
|
a(href=`/channel/${video.authorId}`).author= video.author
|
|
- const views = video.viewCountText || video.second__viewCountText
|
|
if views
|
|
= ` • `
|
|
span.views= views
|
|
if video.publishedText
|
|
= ` • `
|
|
span.published= video.publishedText
|
|
if options.showMarkWatched
|
|
form(method="post" action=`/formapi/markwatched/${video.videoId}`).mark-watched
|
|
= ` • `
|
|
button.mark-watched__button Mark watched
|
|
if video.descriptionHtml
|
|
div.description!= video.descriptionHtml
|