Browse Source

Display date of upload

master
PrivateGER 3 years ago
parent
commit
e4eb54dda2
Signed by: PrivateGER GPG Key ID: CAE625C962F94C67
  1. 2
      PageHandlers/templates/base.html
  2. 20
      PageHandlers/templates/view.html

2
PageHandlers/templates/base.html

@ -14,7 +14,7 @@
{{template "head" .}} {{template "head" .}}
</head> </head>
<body style="background-color: #212121"> <body style="background-color: #212121">
<div style="background-color: #424242; padding: 8px; border-radius: 15px;"> <div style="background-color: #424242; padding: 16px !important; border-radius: 15px;">
<a href="/" style="text-decoration: none"><h1 style="float: left">yt-dlp Archive Viewer</h1></a> <a href="/" style="text-decoration: none"><h1 style="float: left">yt-dlp Archive Viewer</h1></a>
<form action="/search" method="get" style="float: right; margin: auto"> <form action="/search" method="get" style="float: right; margin: auto">
<label> <label>

20
PageHandlers/templates/view.html

@ -20,6 +20,7 @@
<p>{{ .Metadata.ViewCount }} views</p> <p>{{ .Metadata.ViewCount }} views</p>
<p>Uploaded by: <a href="{{ .Metadata.UploaderURL }}">{{ .Metadata.Channel }}</a></p> <p>Uploaded by: <a href="{{ .Metadata.UploaderURL }}">{{ .Metadata.Channel }}</a></p>
<p>Uploaded at: <span id="uploadDate"></span></p>
<hr /> <hr />
<div style="clear: both"></div> <div style="clear: both"></div>
@ -30,7 +31,9 @@
{{ .Metadata.Description }} {{ .Metadata.Description }}
</div> </div>
<p>Comments: ({{ .Metadata.CommentCount }}</p> <hr />
<h3>Comments ({{ .Metadata.CommentCount }}):</h3>
<hr /> <hr />
<div> <div>
{{range .Metadata.Comments}} {{range .Metadata.Comments}}
@ -66,4 +69,19 @@
back: 10 back: 10
}); });
</script> </script>
{{ if .Metadata.ChannelID }}
<script>
String.prototype.insert = function(index, string) {
if (index > 0) {
return this.substring(0, index) + string + this.substr(index);
}
return string + this;
};
let datestring = "{{ .Metadata.UploadDate }}".insert(4, "-").insert(7, "-")
let date = new Date(datestring)
document.getElementById("uploadDate").innerText = `${date.getDay()+1}.${date.getMonth()+1}.${date.getFullYear()}`
</script>
{{end}}
{{end}} {{end}}
Loading…
Cancel
Save