diff --git a/.jshintrc b/.jshintrc index 189830acc77e451853115739a34afeef0b15636a..054c5c9176fa54af36d624d0d89fd444ad0f73a0 100644 --- a/.jshintrc +++ b/.jshintrc @@ -30,7 +30,6 @@ "topImageHtml": true, "generateBlackWhiteList": true, "_": true, - "bootbox": true, "PNotify": true, "anonURL": true, "window": true diff --git a/gui/slick/js/massUpdate.js b/gui/slick/js/massUpdate.js index 4ecc8f639bcc07a2695047757297a5e01a9f5cc6..3d50184b64579be61bcd8038cddb7cde8da4f90d 100644 --- a/gui/slick/js/massUpdate.js +++ b/gui/slick/js/massUpdate.js @@ -47,22 +47,26 @@ $(document).ready(function(){ }); if(deleteCount >= 1) { - bootbox.confirm("You have selected to delete " + deleteCount + " show(s). Are you sure you wish to continue? All files will be removed from your system.", function(result) { - if(result) { + $.confirm({ + title: "Delete Shows", + text: "You have selected to delete " + deleteCount + " show(s). Are you sure you wish to continue? All files will be removed from your system.", + confirmButton: "Yes", + cancelButton: "Cancel", + dialogClass: "modal-dialog", + post: false, + confirm: function() { $('.deleteCheck').each(function() { if(this.checked === true) { deleteArr.push($(this).attr('id').split('-')[1]); } }); + if(updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+removeArr.length+metadataArr.length === 0) { return false; } + window.location.href = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toRemove='+removeArr.join('|')+'&toMetadata='+metadataArr.join('|'); } - if(updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+removeArr.length+metadataArr.length === 0) { return false; } - - window.location.href = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toRemove='+removeArr.join('|')+'&toMetadata='+metadataArr.join('|'); }); - } else { - if(updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+removeArr.length+metadataArr.length === 0) { return false; } - window.location.href = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toRemove='+removeArr.join('|')+'&toMetadata='+metadataArr.join('|'); } + if(updateArr.length+refreshArr.length+renameArr.length+subtitleArr.length+deleteArr.length+removeArr.length+metadataArr.length === 0) { return false; } + window.location.href = 'massUpdate?toUpdate='+updateArr.join('|')+'&toRefresh='+refreshArr.join('|')+'&toRename='+renameArr.join('|')+'&toSubtitle='+subtitleArr.join('|')+'&toDelete='+deleteArr.join('|')+'&toRemove='+removeArr.join('|')+'&toMetadata='+metadataArr.join('|'); }); ['.editCheck', '.updateCheck', '.refreshCheck', '.renameCheck', '.deleteCheck', '.removeCheck'].forEach(function(name) { diff --git a/gui/slick/views/manage.mako b/gui/slick/views/manage.mako index 775434e83f136288aed0dcd8591e457636a18688..12c52542d3326c0263ccb4cf280b6086d0bfa573 100644 --- a/gui/slick/views/manage.mako +++ b/gui/slick/views/manage.mako @@ -15,9 +15,9 @@ <tr> <td nowrap> % if not header is UNDEFINED: - <h1 class="header" style="margin: 0;">${header}</h1> + <h1 class="header" style="margin: 0;">${header}</h1> % else: - <h1 class="title" style="margin: 0;">${title}</h1> + <h1 class="title" style="margin: 0;">${title}</h1> % endif </td> <td align="right"> @@ -60,7 +60,6 @@ <th width="1%">Remove<br><input type="checkbox" class="bulkCheck" id="removeCheck" /></th> </tr> </thead> - <tfoot> <tr> <td rowspan="1" colspan="2" class="align-center alt"><input class="btn pull-left submitMassEdit" type="button" value="Edit Selected" /></td> @@ -69,77 +68,55 @@ </tfoot> <tbody> - <% myShowList = sickbeard.showList %> - <% myShowList.sort(lambda x, y: cmp(x.name, y.name)) %> - - % for curShow in myShowList: - <% curEp = curShow.nextaired %> - <% curUpdate_disabled = "" %> - <% curRefresh_disabled = "" %> - <% curRename_disabled = "" %> - <% curSubtitle_disabled = "" %> - <% curDelete_disabled = "" %> - <% curRemove_disabled = "" %> - - % if sickbeard.showQueueScheduler.action.isBeingUpdated(curShow) or sickbeard.showQueueScheduler.action.isInUpdateQueue(curShow): - <% curUpdate_disabled = "disabled=\"disabled\" " %> - % endif - - <% curUpdate = "<input type=\"checkbox\" class=\"updateCheck\" id=\"update-"+str(curShow.indexerid)+"\" "+curUpdate_disabled+"/>" %> - - % if sickbeard.showQueueScheduler.action.isBeingRefreshed(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow): - <% curRefresh_disabled = "disabled=\"disabled\" " %> - % endif - - <% curRefresh = "<input type=\"checkbox\" class=\"refreshCheck\" id=\"refresh-"+str(curShow.indexerid)+"\" "+curRefresh_disabled+"/>" %> - - % if sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow): - <% curRename = "disabled=\"disabled\" " %> - % endif +<% + myShowList = sickbeard.showList + myShowList.sort(lambda x, y: cmp(x.name, y.name)) +%> + % for curShow in myShowList: + <% + curEp = curShow.nextaired - <% curRename = "<input type=\"checkbox\" class=\"renameCheck\" id=\"rename-"+str(curShow.indexerid)+"\" "+curRename_disabled+"/>" %> + disabled = sickbeard.showQueueScheduler.action.isBeingUpdated(curShow) or sickbeard.showQueueScheduler.action.isInUpdateQueue(curShow) + curUpdate = "<input type=\"checkbox\" class=\"updateCheck\" id=\"update-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" - % if not curShow.subtitles or sickbeard.showQueueScheduler.action.isBeingSubtitled(curShow) or sickbeard.showQueueScheduler.action.isInSubtitleQueue(curShow): - <% curSubtitle_disabled = "disabled=\"disabled\" " %> - % endif + disabled = sickbeard.showQueueScheduler.action.isBeingRefreshed(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow) + curRefresh = "<input type=\"checkbox\" class=\"refreshCheck\" id=\"refresh-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" - <% curSubtitle = "<input type=\"checkbox\" class=\"subtitleCheck\" id=\"subtitle-"+str(curShow.indexerid)+"\" "+curSubtitle_disabled+"/>" %> + disabled = sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) + curRename = "<input type=\"checkbox\" class=\"renameCheck\" id=\"rename-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" - % if sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow): - <% curDelete = "disabled=\"disabled\" " %> - % endif + disabled = not curShow.subtitles or sickbeard.showQueueScheduler.action.isBeingSubtitled(curShow) or sickbeard.showQueueScheduler.action.isInSubtitleQueue(curShow) + curSubtitle = "<input type=\"checkbox\" class=\"subtitleCheck\" id=\"subtitle-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" - <% curDelete = "<input type=\"checkbox\" class=\"deleteCheck\" id=\"delete-"+str(curShow.indexerid)+"\" "+curDelete_disabled+"/>" %> - - % if sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow): - <% curRemove = "disabled=\"disabled\" " %> - % endif + disabled = sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow) + curDelete = "<input type=\"checkbox\" class=\"confirm deleteCheck\" id=\"delete-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" - <% curRemove = "<input type=\"checkbox\" class=\"removeCheck\" id=\"remove-"+str(curShow.indexerid)+"\" "+curRemove_disabled+"/>" %> - <tr> - <td align="center"><input type="checkbox" class="editCheck" id="edit-${curShow.indexerid}" /></td> - <td class="tvShow"><a href="${srRoot}/home/displayShow?show=${curShow.indexerid}">${curShow.name}</a></td> - <td align="center">${renderQualityPill(curShow.quality, showTitle=True)}</td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_sports) == 1]} width="16" height="16" /></td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_scene) == 1]} width="16" height="16" /></td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_anime) == 1]} width="16" height="16" /></td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[not int(curShow.flatten_folders) == 1]} width="16" height="16" /></td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.paused) == 1]} width="16" height="16" /></td> - <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.subtitles) == 1]} width="16" height="16" /></td> - <td align="center">${statusStrings[curShow.default_ep_status]}</td> - <td align="center">${curShow.status}</td> - <td align="center">${curUpdate}</td> - <td align="center">${curRefresh}</td> - <td align="center">${curRename}</td> + disabled = sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow) + curRemove = "<input type=\"checkbox\" class=\"removeCheck\" id=\"remove-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>" + %> + <tr> + <td align="center"><input type="checkbox" class="editCheck" id="edit-${curShow.indexerid}" /></td> + <td class="tvShow"><a href="${srRoot}/home/displayShow?show=${curShow.indexerid}">${curShow.name}</a></td> + <td align="center">${renderQualityPill(curShow.quality, showTitle=True)}</td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_sports) == 1]} width="16" height="16" /></td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_scene) == 1]} width="16" height="16" /></td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.is_anime) == 1]} width="16" height="16" /></td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[not int(curShow.flatten_folders) == 1]} width="16" height="16" /></td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.paused) == 1]} width="16" height="16" /></td> + <td align="center"><img src="${srRoot}/images/${('no16.png" alt="N"', 'yes16.png" alt="Y"')[int(curShow.subtitles) == 1]} width="16" height="16" /></td> + <td align="center">${statusStrings[curShow.default_ep_status]}</td> + <td align="center">${curShow.status}</td> + <td align="center">${curUpdate}</td> + <td align="center">${curRefresh}</td> + <td align="center">${curRename}</td> % if sickbeard.USE_SUBTITLES: - <td align="center">${curSubtitle}</td> + <td align="center">${curSubtitle}</td> % endif - <td align="center">${curDelete}</td> - <td align="center">${curRemove}</td> - </tr> - - % endfor - </tbody> + <td align="center">${curDelete}</td> + <td align="center">${curRemove}</td> + </tr> +% endfor +</tbody> </table> </form> </%block>