From b9b88b18a67ba96db5db787feda7e5263103e970 Mon Sep 17 00:00:00 2001 From: tehspede Date: Wed, 29 Oct 2014 15:41:18 +0200 Subject: [PATCH] Combined 'Delete' and 'Remove' buttons in to one on the individual show pages. --- CHANGES.md | 1 + gui/slick/interfaces/default/inc_top.tmpl | 1 - gui/slick/js/confirmations.js | 29 ++++------------------- sickbeard/webserve.py | 3 --- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e439c254..eb34bc8c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,6 +36,7 @@ * Overhaul Config Search Settings in line with General Configuration * Fixes errors occurring when a show folder is deleted outside of SickRage * Added confirmation dialogs back in that were missed due to new UI changes +* Combined delete and remove buttons in to one on individual show pages ### 0.2.1 (2014-10-22 06:41:00 UTC) diff --git a/gui/slick/interfaces/default/inc_top.tmpl b/gui/slick/interfaces/default/inc_top.tmpl index 08d1a9c0..33357c2e 100644 --- a/gui/slick/interfaces/default/inc_top.tmpl +++ b/gui/slick/interfaces/default/inc_top.tmpl @@ -94,7 +94,6 @@ \$("#SubMenu a[href*='/home/shutdown/']").addClass('btn shutdown').html(' Shutdown'); \$("#SubMenu a[href*='/home/logout/']").addClass('btn').html(' Logout'); \$("#SubMenu a:contains('Edit')").addClass('btn').html(' Edit'); - \$("#SubMenu a:contains('Delete')").addClass('btn delete').html(' Delete'); \$("#SubMenu a:contains('Remove')").addClass('btn remove').html(' Remove'); \$("#SubMenu a:contains('Clear History')").addClass('btn clearhistory').html(' Clear History'); \$("#SubMenu a:contains('Trim History')").addClass('btn trimhistory').html(' Trim History'); diff --git a/gui/slick/js/confirmations.js b/gui/slick/js/confirmations.js index f195cd60..66f38c03 100644 --- a/gui/slick/js/confirmations.js +++ b/gui/slick/js/confirmations.js @@ -40,41 +40,20 @@ $(document).ready(function () { } }); }); - - $('a.delete').bind("click",function(e) { - e.preventDefault(); - var target = $( this ).attr('href'); - var showname = document.getElementById("showtitle").getAttribute('data-showname'); - $.confirm({ - 'title' : 'Delete Show', - 'message' : 'Are you sure you want to permanently delete ' + showname + ' ?

WARNING - This process will also delete all stored files.
This process cannot be un-done.
', - 'buttons' : { - 'Yes' : { - 'class' : 'green', - 'action': function(){ - location.href = target; - } - }, - 'No' : { - 'class' : 'red', - 'action': function(){} // Nothing to do in this case. You can as well omit the action property. - } - } - }); - }); - + $('a.remove').bind("click",function(e) { e.preventDefault(); var target = $( this ).attr('href'); var showname = document.getElementById("showtitle").getAttribute('data-showname'); $.confirm({ 'title' : 'Remove Show', - 'message' : 'Are you sure you want to remove ' + showname + ' from the database ?', + 'message' : 'Are you sure you want to remove ' + showname + ' from the database ?

Check to delete files as well. IRREVERSIBLE', 'buttons' : { 'Yes' : { 'class' : 'green', 'action': function(){ - location.href = target; + location.href = target + (document.getElementById('deleteFiles').checked ? '&full=1' : ''); + // If checkbox is ticked, remove show and delete files. Else just remove show. } }, 'No' : { diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index b93b90b3..45f8cd03 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3707,9 +3707,6 @@ class Home(MainHandler): if not sickbeard.showQueueScheduler.action.isBeingAdded(showObj): # @UndefinedVariable if not sickbeard.showQueueScheduler.action.isBeingUpdated(showObj): # @UndefinedVariable - t.submenu.append( - {'title': 'Delete', 'path': 'home/deleteShow?show=%d&full=1' % showObj.indexerid, - 'confirm': True}) t.submenu.append( {'title': 'Remove', 'path': 'home/deleteShow?show=%d' % showObj.indexerid, 'confirm': True}) t.submenu.append({'title': 'Re-scan files', 'path': 'home/refreshShow?show=%d' % showObj.indexerid})