2018-07-06 00:48:55 +00:00
|
|
|
<% content_for "header" do %>
|
2018-12-20 21:32:09 +00:00
|
|
|
<title><%= translate(locale, "Subscription manager") %> - Invidious</title>
|
2018-07-06 00:48:55 +00:00
|
|
|
<% end %>
|
|
|
|
|
2018-07-30 17:34:57 +00:00
|
|
|
<div class="pure-g h-box">
|
2018-12-20 17:05:54 +00:00
|
|
|
<div class="pure-u-1-3">
|
2019-03-06 15:54:56 +00:00
|
|
|
<h3>
|
|
|
|
<a href="/feed/subscriptions"><%= translate(locale, "`x` subscriptions", %(<span id="count">#{subscriptions.size}</span>)) %></a>
|
|
|
|
</h3>
|
2018-07-30 17:34:57 +00:00
|
|
|
</div>
|
2018-12-20 17:05:54 +00:00
|
|
|
<div class="pure-u-1-3" style="text-align:center;">
|
|
|
|
<h3>
|
2018-12-20 21:32:09 +00:00
|
|
|
<a href="/feed/history"><%= translate(locale, "Watch history") %></a>
|
2018-12-20 17:05:54 +00:00
|
|
|
</h3>
|
|
|
|
</div>
|
2018-07-30 17:34:57 +00:00
|
|
|
<div class="pure-u-1-3" style="text-align:right;">
|
|
|
|
<h3>
|
2018-12-20 21:32:09 +00:00
|
|
|
<a href="/data_control?referer=<%= referer %>"><%= translate(locale, "Import/Export") %></a>
|
2018-07-30 17:34:57 +00:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-06 00:48:55 +00:00
|
|
|
|
|
|
|
<% subscriptions.each do |channel| %>
|
2018-08-06 00:59:45 +00:00
|
|
|
<div class="h-box">
|
2019-03-06 15:54:56 +00:00
|
|
|
<div class="pure-g<% if channel.deleted %> deleted <% end%>">
|
2018-07-06 00:48:55 +00:00
|
|
|
<div class="pure-u-2-5">
|
2019-03-06 15:54:56 +00:00
|
|
|
<h3 style="padding-left: 0.5em">
|
2018-08-06 00:59:45 +00:00
|
|
|
<a href="/channel/<%= channel.id %>"><%= channel.author %></a>
|
|
|
|
</h3>
|
2018-07-06 00:48:55 +00:00
|
|
|
</div>
|
|
|
|
<div class="pure-u-2-5"></div>
|
2018-07-16 19:30:15 +00:00
|
|
|
<div class="pure-u-1-5" style="text-align: right;">
|
2019-03-06 15:54:56 +00:00
|
|
|
<h3 style="padding-right: 0.5em">
|
2018-11-21 19:35:37 +00:00
|
|
|
<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 %>">
|
2018-12-20 21:32:09 +00:00
|
|
|
<%= translate(locale, "unsubscribe") %>
|
2018-11-21 19:35:37 +00:00
|
|
|
</a>
|
2018-08-06 00:59:45 +00:00
|
|
|
</h3>
|
2018-07-06 00:48:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-16 19:30:15 +00:00
|
|
|
|
2018-08-06 00:59:45 +00:00
|
|
|
<% if subscriptions[-1].author != channel.author %>
|
|
|
|
<hr>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2018-08-17 16:04:38 +00:00
|
|
|
<% end %>
|
2018-11-21 19:35:37 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function remove_subscription(target) {
|
|
|
|
var row = target.parentNode.parentNode.parentNode.parentNode;
|
|
|
|
row.style.display = "none";
|
2018-11-22 01:26:55 +00:00
|
|
|
var count = document.getElementById("count")
|
|
|
|
count.innerText = count.innerText - 1;
|
2018-11-21 19:35:37 +00:00
|
|
|
|
|
|
|
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) {
|
2018-11-22 01:26:55 +00:00
|
|
|
if (xhr.status != 200) {
|
2018-12-05 23:02:00 +00:00
|
|
|
count.innerText = count.innerText - 1 + 2;
|
2018-11-21 19:35:37 +00:00
|
|
|
row.style.display = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|