add checkbox for adding video on watch page to playlist

This commit is contained in:
James Taylor 2018-07-09 03:42:26 -07:00
parent cdb7dbab55
commit 4b716415e1
3 changed files with 29 additions and 17 deletions

View File

@ -159,6 +159,12 @@ address{
grid-row: 4; grid-row: 4;
justify-self:end; justify-self:end;
} }
.full-item .checkbox{
justify-self:end;
grid-row: 5;
grid-column: 2;
}
.full-item .description{ .full-item .description{
background-color:#d0d0d0; background-color:#d0d0d0;
margin-top:8px; margin-top:8px;
@ -166,7 +172,7 @@ address{
min-width: 0; min-width: 0;
grid-column: 1 / span 2; grid-column: 1 / span 2;
grid-row: 5; grid-row: 6;
} }
.medium-item-box{ .medium-item-box{

View File

@ -266,7 +266,12 @@ def get_watch_page(query_string):
#chosen_format = choose_format(info) #chosen_format = choose_format(info)
sort_formats(info) sort_formats(info)
video_info = {
"duration": common.seconds_to_timestamp(info["duration"]),
"id": info['id'],
"title": info['title'],
"author": info['uploader'],
}
upload_year = info["upload_date"][0:4] upload_year = info["upload_date"][0:4]
upload_month = info["upload_date"][4:6] upload_month = info["upload_date"][4:6]
@ -281,11 +286,11 @@ def get_watch_page(query_string):
header = common.get_header(), header = common.get_header(),
uploader = html.escape(info["uploader"]), uploader = html.escape(info["uploader"]),
uploader_channel_url = '/' + info["uploader_url"], uploader_channel_url = '/' + info["uploader_url"],
#upload_date=datetime.datetime.fromtimestamp(info["timestamp"]).strftime("%d %b %Y %H:%M:%S"),
upload_date = upload_date, upload_date = upload_date,
views = '{:,}'.format(info["view_count"]), views = '{:,}'.format(info["view_count"]),
likes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["like_count"]), likes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["like_count"]),
dislikes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["dislike_count"]), dislikes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["dislike_count"]),
video_info = html.escape(json.dumps(video_info)),
description = html.escape(info["description"]), description = html.escape(info["description"]),
video_sources = formats_html(info), video_sources = formats_html(info),
related = related_videos_html, related = related_videos_html,

View File

@ -67,6 +67,7 @@ $video_sources
<time datetime="$upload_date">Published on $upload_date</time> <time datetime="$upload_date">Published on $upload_date</time>
<span class="likes-dislikes">$likes likes $dislikes dislikes</span> <span class="likes-dislikes">$likes likes $dislikes dislikes</span>
<input class="checkbox" name="video_info_list" value="$video_info" form="playlist-add" type="checkbox">
<span class="description">$description</span> <span class="description">$description</span>