Combined 'Delete' and 'Remove' buttons in to one on the individual show pages.

This commit is contained in:
tehspede 2014-10-29 15:41:18 +02:00
parent 91c004c990
commit b9b88b18a6
4 changed files with 5 additions and 29 deletions

View File

@ -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)

View File

@ -94,7 +94,6 @@
\$("#SubMenu a[href*='/home/shutdown/']").addClass('btn shutdown').html('<span class="submenu-icon-shutdown pull-left"></span> Shutdown');
\$("#SubMenu a[href*='/home/logout/']").addClass('btn').html('<span class="ui-icon ui-icon-power pull-left"></span> Logout');
\$("#SubMenu a:contains('Edit')").addClass('btn').html('<span class="ui-icon ui-icon-pencil pull-left"></span> Edit');
\$("#SubMenu a:contains('Delete')").addClass('btn delete').html('<span class="ui-icon ui-icon-trash pull-left"></span> Delete');
\$("#SubMenu a:contains('Remove')").addClass('btn remove').html('<span class="ui-icon ui-icon-trash pull-left"></span> Remove');
\$("#SubMenu a:contains('Clear History')").addClass('btn clearhistory').html('<span class="ui-icon ui-icon-trash pull-left"></span> Clear History');
\$("#SubMenu a:contains('Trim History')").addClass('btn trimhistory').html('<span class="ui-icon ui-icon-trash pull-left"></span> Trim History');

View File

@ -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 <span class="footerhighlight">' + showname + '</span> ? <br /><br /> <font color="red">WARNING - This process will also delete all stored files. <br /> This process cannot be un-done.</font>',
'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 <span class="footerhighlight">' + showname + '</span> from the database ?',
'message' : 'Are you sure you want to remove <span class="footerhighlight">' + showname + '</span> from the database ?<br /><br /><input type="checkbox" id="deleteFiles"> <span class="red-text">Check to delete files as well. IRREVERSIBLE</span></input>',
'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' : {

View File

@ -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&amp;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})