bashtube/templates/themes/default/watch.t

50 lines
1.7 KiB
Perl

<div><br>
<h2>{{.title}}</h2>
<div>
<div>
Uploaded by <b><a href='/channel/{{.channel_id}}'>{{.uploader}}</a></b> on <b>{{.upload_date}}</b>
</div>
<div>
<b>{{.view_count}}</b> views<br>
<b>{{.like_count}}</b> likes<br>
{{start ?fav}}<a href='fav.shs?v={{.id}}' target='_blank'>Add to favourites</a><br>{{end ?fav}}
{{start ?unfav}}<a href='unfav.shs?v={{.id}}' target='_blank'>Remove from favourites</a><br>{{end ?unfav}}
{{start ?sub}}<a href='subscribe.shs?id={{.channel_id}}' target='_blank'>Subscribe to {{.uploader}}!</a><br>{{end ?sub}}
{{start ?unsub}}<a href='unsubscribe.shs?id={{.channel_id}}' target='_blank'>Unsubscribe from {{.uploader}}!</a><br>{{end ?unsub}}
{{start ?login}}<b><a href='/login.shs?r={{.r}}'>Log in</a> to add this video to your favourites and/or subscribe to this channel!</b><br>{{end ?login}}
<br><br>
</div>
</div>
<pre><i>Description</i>:<br>{{.description}}</pre>
</div>
<h1>Recommended</h1>
<div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));'>
{{start _recommended}}
<div><a href='/watch?v={{.id}}'><img src='https://i.ytimg.com/vi/{{.id}}/mqdefault.jpg'>{{.title}}</a></div>
{{end _recommended}}
</div><h1>Comments</h1>
<div class='comments'></div>
<script src='/js/watch.js'></script>
{{start ?playlist}}
<h1>Playlist</h1>
<script type='text/javascript'>
window.addEventListener('DOMContentLoaded', (event) => {
var video = document.querySelector('video');
video.addEventListener('ended', function() {
window.location = 'watch?v={{.next}}&playlist={{.playlist_id}}';
});
});
</script>
{{start _playlist}}
<a href='watch?v={{.id}}&playlist={{.playlist_id}}'><img src='//i.ytimg.com/vi/{{.id}}/mqdefault.jpg'><br>{{.title}}</a><br>
{{end _playlist}}
{{end ?playlist}}