mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-03-02 02:31:35 +00:00
Add "mark watched" button to subscriptions page
This commit is contained in:
parent
27435cc3b5
commit
ac28332ac0
7 changed files with 83 additions and 18 deletions
|
|
@ -1,4 +1,4 @@
|
|||
mixin video_list_item(className, video, instanceOrigin)
|
||||
mixin video_list_item(className, video, instanceOrigin, options = {})
|
||||
div(class={[className]: true, "video-list-item--watched": video.watched})
|
||||
- let link = `/watch?v=${video.videoId}`
|
||||
a(href=link tabindex="-1").thumbnail
|
||||
|
|
@ -16,5 +16,9 @@ mixin video_list_item(className, video, instanceOrigin)
|
|||
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
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ include includes/video-list-item.pug
|
|||
|
||||
block head
|
||||
title Subscriptions - CloudTube
|
||||
script(type="module" src=getStaticURL("html", "/static/js/subscriptions.js"))
|
||||
|
||||
block content
|
||||
main.subscriptions-page
|
||||
|
|
@ -34,7 +35,7 @@ block content
|
|||
label(for="watched-videos-display").watched-videos-display-label Hide watched videos
|
||||
|
||||
each video in videos
|
||||
+video_list_item("subscriptions-video", video, instanceOrigin)
|
||||
+video_list_item("subscriptions-video", video, instanceOrigin, {showMarkWatched: settings.save_history && !video.watched})
|
||||
else
|
||||
.no-subscriptions
|
||||
h2 You have no subscriptions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue