diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html index d17423c0..5fc417b6 100644 --- a/tubearchivist/home/templates/home/channel_id.html +++ b/tubearchivist/home/templates/home/channel_id.html @@ -38,20 +38,24 @@

- {% if videos %}
{% if channel_info.channel_views >= 1000000 %}

Channel views: {{ channel_info.channel_views|intword }}

- {% else %} + {% elif channel_info.channel_views > 0 %}

Channel views: {{ channel_info.channel_views|intcomma }}

{% endif %} -

Total Videos archived: {{ max_hits }}

-

Watched:

+ {% if max_hits %} +

Total Videos archived: {{ max_hits }}

+

Watched:

+ {% endif %}

Channel id: {{ channel_info.channel_id }}

+ +
+ Delete {{ channel_info.channel_name }} including all videos? +
- {% endif %} {% if channel_info.channel_description %}
diff --git a/tubearchivist/home/templates/home/video.html b/tubearchivist/home/templates/home/video.html index f4fa7c85..0a70ae21 100644 --- a/tubearchivist/home/templates/home/video.html +++ b/tubearchivist/home/templates/home/video.html @@ -47,7 +47,7 @@

Video ID: {{ video.youtube_id }}

- Are you sure? + Are you sure?
diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index 636de791..efeed9d6 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -178,18 +178,15 @@ function fsRescan() { // delete from file system function deleteConfirm() { - console.log("confirm delete"); to_show = document.getElementById("delete-button"); document.getElementById("delete-item").style.display = 'none'; to_show.style.display = "block"; } -function deleteItem(button) { +function deleteVideo(button) { var to_delete = button.getAttribute("data-id"); var to_redirect = button.getAttribute("data-redirect"); var payload = JSON.stringify({"delete-video": to_delete}); - console.log(payload); - console.log(to_redirect); sendPost(payload); setTimeout(function(){ var redirect = "/channel/" + to_redirect; @@ -198,8 +195,17 @@ function deleteItem(button) { }, 1000); } +function deleteChannel(button) { + var to_delete = button.getAttribute("data-id"); + var payload = JSON.stringify({"delete-channel": to_delete}); + sendPost(payload); + setTimeout(function(){ + window.location.replace("/channel/"); + return false; + }, 1000); +} + function cancelDelete() { - console.log("cancel delete"); document.getElementById("delete-button").style.display = 'none'; document.getElementById("delete-item").style.display = 'block'; }