2018-07-06 06:18:55 +05:30
|
|
|
<% content_for "header" do %>
|
|
|
|
<title>Subscription manager - Invidious</title>
|
|
|
|
<% end %>
|
|
|
|
|
2018-07-30 23:04:57 +05:30
|
|
|
<div class="pure-g h-box">
|
|
|
|
<div class="pure-u-2-3">
|
2018-11-22 01:05:37 +05:30
|
|
|
<h3 id="count"><%= subscriptions.size %> subscriptions</h3>
|
2018-07-30 23:04:57 +05:30
|
|
|
</div>
|
|
|
|
<div class="pure-u-1-3" style="text-align:right;">
|
|
|
|
<h3>
|
2018-08-26 08:18:20 +05:30
|
|
|
<a href="/data_control?referer=<%= referer %>">Import/Export</a>
|
2018-07-30 23:04:57 +05:30
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-06 06:18:55 +05:30
|
|
|
|
|
|
|
<% subscriptions.each do |channel| %>
|
2018-08-06 06:29:45 +05:30
|
|
|
<div class="h-box">
|
2018-07-06 06:18:55 +05:30
|
|
|
<div class="pure-g">
|
|
|
|
<div class="pure-u-2-5">
|
2018-08-06 06:29:45 +05:30
|
|
|
<h3>
|
|
|
|
<a href="/channel/<%= channel.id %>"><%= channel.author %></a>
|
|
|
|
</h3>
|
2018-07-06 06:18:55 +05:30
|
|
|
</div>
|
|
|
|
<div class="pure-u-2-5"></div>
|
2018-07-17 01:00:15 +05:30
|
|
|
<div class="pure-u-1-5" style="text-align: right;">
|
2018-08-06 06:29:45 +05:30
|
|
|
<h3>
|
2018-11-22 01:05:37 +05:30
|
|
|
<a onclick="remove_subscription(this)"
|
|
|
|
data-id="<%= channel.id %>"
|
|
|
|
onmouseenter='this["href"]="javascript:void(0)"'
|
|
|
|
href="/subscription_ajax?action_remove_subscriptions=1&c=<%= channel.id %>">
|
|
|
|
unsubscribe
|
|
|
|
</a>
|
2018-08-06 06:29:45 +05:30
|
|
|
</h3>
|
2018-07-06 06:18:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-17 01:00:15 +05:30
|
|
|
|
2018-08-06 06:29:45 +05:30
|
|
|
<% if subscriptions[-1].author != channel.author %>
|
|
|
|
<hr>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2018-08-17 21:34:38 +05:30
|
|
|
<% end %>
|
2018-11-22 01:05:37 +05:30
|
|
|
|
|
|
|
<script>
|
|
|
|
function remove_subscription(target) {
|
|
|
|
var row = target.parentNode.parentNode.parentNode.parentNode;
|
|
|
|
row.style.display = "none";
|
|
|
|
|
|
|
|
var url = "/subscription_ajax?action_remove_subscriptions=1&redirect=false&c=" + target.getAttribute("data-id");
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.responseType = "json";
|
|
|
|
xhr.timeout = 20000;
|
|
|
|
xhr.open("GET", url, true);
|
|
|
|
xhr.send();
|
|
|
|
|
|
|
|
xhr.onreadystatechange = function() {
|
|
|
|
if (xhr.readyState == 4) {
|
|
|
|
if (xhr.status == 200) {
|
|
|
|
document.getElementById("count").innerHTML = xhr.response.countText;
|
|
|
|
} else {
|
|
|
|
row.style.display = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|