109 lines
3.7 KiB
HTML
109 lines
3.7 KiB
HTML
{% extends "default.html" %}
|
|
|
|
{% block title %}
|
|
<title>{{SITE_NAME}} - Live</title>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<style>
|
|
tr:hover {
|
|
border: 2.5px solid var(--primary);
|
|
}
|
|
img.thumb {
|
|
border-radius: 4px;
|
|
}
|
|
.remove-streamer {
|
|
width: 130px;
|
|
}
|
|
</style>
|
|
<script>
|
|
function go_to(e, link) {
|
|
if (!e.target.classList.contains('remove-streamer'))
|
|
window.open(link, '_blank');
|
|
}
|
|
</script>
|
|
|
|
{% if error %}
|
|
<div class="alert alert-danger alert-dismissible fade show my-3" role="alert">
|
|
<i class="fas fa-exclamation-circle my-auto"></i>
|
|
<span>
|
|
{{error}}
|
|
</span>
|
|
<button type="button" class="close" data-bs-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
{% if msg %}
|
|
<div class="alert alert-success alert-dismissible fade show my-3" role="alert">
|
|
<i class="fas fa-check-circle my-auto" aria-hidden="true"></i>
|
|
<span>
|
|
{{msg}}
|
|
</span>
|
|
<button type="button" class="close" data-bs-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="px-2 mb-4">
|
|
<h1 class="py-3"><i class="fas fa-circle mr-3" style="color:red"></i>Live</h1>
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-striped mb-5">
|
|
<tbody>
|
|
{% for id, link, thumb, name, title, viewers in live %}
|
|
<tr onclick="go_to(event,'{{link}}')">
|
|
<td width="48"><img loading="lazy" class="thumb" src="{{thumb}}" alt="{{name}} thumbnail" referrerpolicy="no-referrer" width="48"></td>
|
|
<td>{{name}}</td>
|
|
<td>{{title}}</td>
|
|
<td>{{viewers}} watching</td>
|
|
{% if v and v.admin_level >= PERMS['STREAMERS_MODERATION'] %}
|
|
<td>
|
|
<form action="/live/remove" method="post">
|
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
|
<input type="hidden" name="id" value="{{id}}">
|
|
<input autocomplete="off" class="btn btn-primary ml-auto remove-streamer" data-click="disable(this);this.parentElement.submit()" onclick="areyousure(this)" value="Remove">
|
|
</form>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h1 class="py-3"><i class="fas fa-circle mr-3" style="color:gray"></i>Offline</h1>
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-striped mb-5">
|
|
<tbody>
|
|
{% for id, link, thumb, name, minutes, actual, views in offline %}
|
|
<tr onclick="go_to(event,'{{link}}')">
|
|
<td width="48"><img loading="lazy" class="thumb" src="{{thumb}}" alt="{{name}} thumbnail" referrerpolicy="no-referrer" width="48"></td>
|
|
<td>{{name}}</td>
|
|
<td>{{actual}} ago</td>
|
|
<td>{{views}} views</td>
|
|
{% if v and v.admin_level >= PERMS['STREAMERS_MODERATION'] %}
|
|
<td>
|
|
<form action="/live/remove" method="post">
|
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
|
<input type="hidden" name="id" value="{{id}}">
|
|
<input autocomplete="off" class="btn btn-primary ml-auto remove-streamer" data-click="disable(this);this.parentElement.submit()" onclick="areyousure(this)" value="Remove">
|
|
</form>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{% if v and v.admin_level >= PERMS['STREAMERS_MODERATION'] %}
|
|
<form action="/live/add" method="post">
|
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
|
<input class="form-control" autocomplete="off" type="text" name="link" class="form-control" placeholder="Enter channel link.." required>
|
|
<input autocomplete="off" class="btn btn-primary mt-3" type="submit" onclick="disable(this)" value="Add Youtube Channel" style="float:right">
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|