2016-11-29 04:16:16 +00:00
|
|
|
<!DOCTYPE html5>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
{% import "header.html" as header %}
|
|
|
|
<title>Channels</title>
|
|
|
|
<meta charset="UTF-8">
|
2020-01-07 05:55:01 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
2016-11-29 04:16:16 +00:00
|
|
|
<link rel="stylesheet" href="/static/common.css">
|
|
|
|
<script src="/static/common.js"></script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#content_body
|
|
|
|
{
|
|
|
|
display: flex;
|
2016-12-07 06:11:09 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
flex-shrink: 0;
|
|
|
|
flex-basis: auto;
|
2016-11-29 04:16:16 +00:00
|
|
|
flex-direction: column;
|
2016-12-07 06:11:09 +00:00
|
|
|
width: 1440px;
|
|
|
|
margin: auto;
|
|
|
|
max-width: 100%;
|
2016-11-29 04:16:16 +00:00
|
|
|
}
|
|
|
|
#new_channel_textbox,
|
|
|
|
#new_channel_button
|
|
|
|
{
|
|
|
|
width: 200px;
|
|
|
|
}
|
2020-05-22 00:22:07 +00:00
|
|
|
.channel_card_no_pending,
|
2016-11-29 04:16:16 +00:00
|
|
|
.channel_card_pending
|
|
|
|
{
|
|
|
|
margin: 8px;
|
|
|
|
padding: 10px;
|
|
|
|
border-radius: 4px;
|
|
|
|
border: 1px solid #000;
|
|
|
|
}
|
|
|
|
.channel_card_pending
|
|
|
|
{
|
|
|
|
background-color: #ffffaa;
|
|
|
|
}
|
2020-05-22 00:22:07 +00:00
|
|
|
.channel_card_no_pending
|
2016-11-29 04:16:16 +00:00
|
|
|
{
|
|
|
|
background-color: #aaffaa;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
{{header.make_header()}}
|
|
|
|
<div id="content_body">
|
2020-01-07 05:56:45 +00:00
|
|
|
<span><button class="refresh_button" onclick="refresh_all_channels(false, function(){location.reload()})">Refresh new videos</button></span>
|
|
|
|
<span><button class="refresh_button" onclick="refresh_all_channels(true, function(){location.reload()})">Refresh everything</button></span>
|
2016-11-29 04:16:16 +00:00
|
|
|
<div>
|
|
|
|
<input type="text" id="new_channel_textbox">
|
|
|
|
<button id="new_channel_button" onclick="_new_channel_submit()">Add new channel</button>
|
|
|
|
</div>
|
|
|
|
{% for channel in channels %}
|
2020-04-04 22:13:01 +00:00
|
|
|
{% if channel.has_pending() %}
|
2016-11-29 04:16:16 +00:00
|
|
|
<div class="channel_card_pending">
|
|
|
|
{% else %}
|
2020-05-22 00:22:07 +00:00
|
|
|
<div class="channel_card_no_pending">
|
2016-11-29 04:16:16 +00:00
|
|
|
{% endif %}
|
2020-04-04 22:13:01 +00:00
|
|
|
<a href="/channel/{{channel.id}}">{{channel.name}}</a> <a href="/channel/{{channel.id}}/pending">(p)</a>
|
2020-05-22 00:26:12 +00:00
|
|
|
{% if channel.automark not in [none, "pending"] %}
|
|
|
|
<span>automark: {{channel.automark}}</span>
|
|
|
|
{% endif %}
|
2016-11-29 04:16:16 +00:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var box = document.getElementById('new_channel_textbox');
|
|
|
|
var button = document.getElementById('new_channel_button');
|
2020-04-04 22:13:01 +00:00
|
|
|
common.bind_box_to_button(box, button);
|
2016-11-29 04:16:16 +00:00
|
|
|
|
|
|
|
function _new_channel_submit()
|
|
|
|
{
|
|
|
|
if (box.value !== "")
|
|
|
|
{
|
2019-01-24 05:22:09 +00:00
|
|
|
refresh_channel(box.value, true, function(){location.reload()});
|
2016-11-29 04:16:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function refresh_channel(channel_id, force, callback)
|
|
|
|
{
|
|
|
|
var url = "/refresh_channel";
|
|
|
|
data = new FormData();
|
|
|
|
data.append("channel_id", channel_id);
|
|
|
|
data.append("force", force)
|
2020-04-04 22:13:01 +00:00
|
|
|
return common.post(url, data, callback);
|
2016-11-29 04:16:16 +00:00
|
|
|
}
|
2016-12-07 06:11:09 +00:00
|
|
|
|
2016-11-29 04:16:16 +00:00
|
|
|
function refresh_all_channels(force, callback)
|
|
|
|
{
|
|
|
|
var url = "/refresh_all_channels";
|
|
|
|
data = new FormData();
|
|
|
|
data.append("force", force)
|
2020-04-04 22:13:01 +00:00
|
|
|
return common.post(url, data, callback);
|
2016-11-29 04:16:16 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</html>
|