Private GIT

Skip to content
Snippets Groups Projects
Commit 242bb96c authored by miigotu's avatar miigotu
Browse files

Switch from bootbox to jquery.confirm in massUpdate.js

Fixes deleting shows from mass update
Rework most of manage.mako and fix a few bugs
parent 3866a3cf
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
"topImageHtml": true, "topImageHtml": true,
"generateBlackWhiteList": true, "generateBlackWhiteList": true,
"_": true, "_": true,
"bootbox": true,
"PNotify": true, "PNotify": true,
"anonURL": true, "anonURL": true,
"window": true "window": true
......
...@@ -47,22 +47,26 @@ $(document).ready(function(){ ...@@ -47,22 +47,26 @@ $(document).ready(function(){
}); });
if(deleteCount >= 1) { 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) { $.confirm({
if(result) { 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() { $('.deleteCheck').each(function() {
if(this.checked === true) { if(this.checked === true) {
deleteArr.push($(this).attr('id').split('-')[1]); 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; } 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('|'); 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; } 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('|'); 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) { ['.editCheck', '.updateCheck', '.refreshCheck', '.renameCheck', '.deleteCheck', '.removeCheck'].forEach(function(name) {
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
<th width="1%">Remove<br><input type="checkbox" class="bulkCheck" id="removeCheck" /></th> <th width="1%">Remove<br><input type="checkbox" class="bulkCheck" id="removeCheck" /></th>
</tr> </tr>
</thead> </thead>
<tfoot> <tfoot>
<tr> <tr>
<td rowspan="1" colspan="2" class="align-center alt"><input class="btn pull-left submitMassEdit" type="button" value="Edit Selected" /></td> <td rowspan="1" colspan="2" class="align-center alt"><input class="btn pull-left submitMassEdit" type="button" value="Edit Selected" /></td>
...@@ -69,53 +68,32 @@ ...@@ -69,53 +68,32 @@
</tfoot> </tfoot>
<tbody> <tbody>
<% myShowList = sickbeard.showList %> <%
<% myShowList.sort(lambda x, y: cmp(x.name, y.name)) %> myShowList = sickbeard.showList
myShowList.sort(lambda x, y: cmp(x.name, y.name))
%>
% for curShow in myShowList: % for curShow in myShowList:
<% curEp = curShow.nextaired %> <%
<% curUpdate_disabled = "" %> curEp = curShow.nextaired
<% curRefresh_disabled = "" %>
<% curRename_disabled = "" %>
<% curSubtitle_disabled = "" %>
<% curDelete_disabled = "" %>
<% curRemove_disabled = "" %>
% if sickbeard.showQueueScheduler.action.isBeingUpdated(curShow) or sickbeard.showQueueScheduler.action.isInUpdateQueue(curShow): disabled = sickbeard.showQueueScheduler.action.isBeingUpdated(curShow) or sickbeard.showQueueScheduler.action.isInUpdateQueue(curShow)
<% curUpdate_disabled = "disabled=\"disabled\" " %> curUpdate = "<input type=\"checkbox\" class=\"updateCheck\" id=\"update-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>"
% endif
<% curUpdate = "<input type=\"checkbox\" class=\"updateCheck\" id=\"update-"+str(curShow.indexerid)+"\" "+curUpdate_disabled+"/>" %> 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] + "/>"
% if sickbeard.showQueueScheduler.action.isBeingRefreshed(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow): disabled = sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow)
<% curRefresh_disabled = "disabled=\"disabled\" " %> curRename = "<input type=\"checkbox\" class=\"renameCheck\" id=\"rename-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>"
% endif
<% curRefresh = "<input type=\"checkbox\" class=\"refreshCheck\" id=\"refresh-"+str(curShow.indexerid)+"\" "+curRefresh_disabled+"/>" %> 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] + "/>"
% if sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow): disabled = sickbeard.showQueueScheduler.action.isBeingRenamed(curShow) or sickbeard.showQueueScheduler.action.isInRenameQueue(curShow) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow)
<% curRename = "disabled=\"disabled\" " %> curDelete = "<input type=\"checkbox\" class=\"confirm deleteCheck\" id=\"delete-" + str(curShow.indexerid) + "\" " + ("", "disabled=\"disabled\" ")[disabled] + "/>"
% endif
<% curRename = "<input type=\"checkbox\" class=\"renameCheck\" id=\"rename-"+str(curShow.indexerid)+"\" "+curRename_disabled+"/>" %>
% if not curShow.subtitles or sickbeard.showQueueScheduler.action.isBeingSubtitled(curShow) or sickbeard.showQueueScheduler.action.isInSubtitleQueue(curShow):
<% curSubtitle_disabled = "disabled=\"disabled\" " %>
% endif
<% 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) or sickbeard.showQueueScheduler.action.isInRefreshQueue(curShow)
curRemove = "<input type=\"checkbox\" class=\"removeCheck\" id=\"remove-" + 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
<% 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
<% curRemove = "<input type=\"checkbox\" class=\"removeCheck\" id=\"remove-"+str(curShow.indexerid)+"\" "+curRemove_disabled+"/>" %>
<tr> <tr>
<td align="center"><input type="checkbox" class="editCheck" id="edit-${curShow.indexerid}" /></td> <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 class="tvShow"><a href="${srRoot}/home/displayShow?show=${curShow.indexerid}">${curShow.name}</a></td>
...@@ -137,7 +115,6 @@ ...@@ -137,7 +115,6 @@
<td align="center">${curDelete}</td> <td align="center">${curDelete}</td>
<td align="center">${curRemove}</td> <td align="center">${curRemove}</td>
</tr> </tr>
% endfor % endfor
</tbody> </tbody>
</table> </table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment