summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-12-05 17:02:00 -0600
committerOmar Roth <omarroth@hotmail.com>2018-12-05 17:07:51 -0600
commit89439e1775039eb823ddc4a9acf01a996a05cc80 (patch)
treeeaf4b8a71df52be46ce542c397fa7b8f6c1a43a0
parent65cc51766fab07aea9c184c934d1515ee601c509 (diff)
downloadinvidious-0.12.0.tar.gz
invidious-0.12.0.tar.bz2
invidious-0.12.0.zip
Add link to '/clear_watch_history' in '/feed/history'0.12.0
-rw-r--r--src/invidious/views/history.ecr14
-rw-r--r--src/invidious/views/subscription_manager.ecr1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/invidious/views/history.ecr b/src/invidious/views/history.ecr
index 691201cd..3830e9c4 100644
--- a/src/invidious/views/history.ecr
+++ b/src/invidious/views/history.ecr
@@ -2,6 +2,17 @@
<title>History - Invidious</title>
<% end %>
+<div class="pure-g h-box">
+ <div class="pure-u-2-3">
+ <h3><span id="count"><%= user.watched.size %></span> videos</h3>
+ </div>
+ <div class="pure-u-1-3" style="text-align:right;">
+ <h3>
+ <a href="/clear_watch_history">Clear watch history</a>
+ </h3>
+ </div>
+</div>
+
<div class="pure-g">
<% watched.each_slice(4) do |slice| %>
<% slice.each do |item| %>
@@ -34,6 +45,8 @@
function mark_unwatched(target) {
var tile = target.parentNode.parentNode.parentNode.parentNode;
tile.style.display = "none";
+ var count = document.getElementById("count")
+ count.innerText = count.innerText - 1;
var url = "/mark_unwatched?redirect=false&id=" + target.getAttribute("data-id");
var xhr = new XMLHttpRequest();
@@ -45,6 +58,7 @@ function mark_unwatched(target) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status != 200) {
+ count.innerText = count.innerText - 1 + 2;
tile.style.display = "";
}
}
diff --git a/src/invidious/views/subscription_manager.ecr b/src/invidious/views/subscription_manager.ecr
index ac1c0cdd..b838a24d 100644
--- a/src/invidious/views/subscription_manager.ecr
+++ b/src/invidious/views/subscription_manager.ecr
@@ -57,6 +57,7 @@ function remove_subscription(target) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status != 200) {
+ count.innerText = count.innerText - 1 + 2;
row.style.display = "";
}
}