mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
#221 delete requests per category
This commit is contained in:
parent
96352e14ee
commit
217ce391e0
10 changed files with 169 additions and 8 deletions
|
@ -25,6 +25,10 @@ hr {
|
|||
.btn {
|
||||
border-radius: 0.25rem !important; }
|
||||
|
||||
.btn-group-separated .btn,
|
||||
.btn-group-separated .btn + .btn {
|
||||
margin-left: 3px; }
|
||||
|
||||
.multiSelect {
|
||||
background-color: #4e5d6c; }
|
||||
|
||||
|
|
2
PlexRequests.UI/Content/base.min.css
vendored
2
PlexRequests.UI/Content/base.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -46,6 +46,11 @@ hr {
|
|||
border-radius: .25rem $i;
|
||||
}
|
||||
|
||||
.btn-group-separated .btn,
|
||||
.btn-group-separated .btn + .btn {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.multiSelect {
|
||||
background-color: $form-color;
|
||||
}
|
||||
|
|
|
@ -40,9 +40,9 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|||
var $tvl = $('#tvList');
|
||||
var $musicL = $('#musicList');
|
||||
|
||||
$('.approve-category').hide();
|
||||
$('.approve-category,.delete-category').hide();
|
||||
if (target === "#TvShowTab") {
|
||||
$('#approveTVShows').show();
|
||||
$('#approveTVShows,#deleteTVShows').show();
|
||||
if ($ml.mixItUp('isLoaded')) {
|
||||
activeState = $ml.mixItUp('getState');
|
||||
$ml.mixItUp('destroy');
|
||||
|
@ -55,7 +55,7 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|||
$tvl.mixItUp(mixItUpConfig(activeState)); // init or reinit
|
||||
}
|
||||
if (target === "#MoviesTab") {
|
||||
$('#approveMovies').show();
|
||||
$('#approveMovies,#deleteMovies').show();
|
||||
if ($tvl.mixItUp('isLoaded')) {
|
||||
activeState = $tvl.mixItUp('getState');
|
||||
$tvl.mixItUp('destroy');
|
||||
|
@ -69,7 +69,7 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|||
}
|
||||
|
||||
if (target === "#MusicTab") {
|
||||
$('#approveMusic').show();
|
||||
$('#approveMusic,#deleteMusic').show();
|
||||
if ($tvl.mixItUp('isLoaded')) {
|
||||
activeState = $tvl.mixItUp('getState');
|
||||
$tvl.mixItUp('destroy');
|
||||
|
@ -124,7 +124,7 @@ $('#approveTVShows').click(function (e) {
|
|||
return;
|
||||
}
|
||||
|
||||
loadingButton(buttonId, "success");
|
||||
loadingButton(buttonId, "warning");
|
||||
var url = createBaseUrl(base, '/approval/approvealltvshows');
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
|
@ -140,6 +140,72 @@ $('#approveTVShows').click(function (e) {
|
|||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
},
|
||||
complete: function (e) {
|
||||
finishLoading(buttonId, "warning", origHtml);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#deleteMovies').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!confirm("Are you sure you want to delete all TV show requests?")) return;
|
||||
|
||||
var buttonId = e.target.id;
|
||||
var origHtml = $(this).html();
|
||||
|
||||
if ($('#' + buttonId).text() === " Loading...") {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingButton(buttonId, "warning");
|
||||
|
||||
var url = createBaseUrl(base, '/approval/deleteallmovies');
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (checkJsonResponse(response)) {
|
||||
generateNotify("Success! All Movie requests deleted!", "success");
|
||||
movieLoad();
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
},
|
||||
complete: function (e) {
|
||||
finishLoading(buttonId, "warning", origHtml);
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#deleteTVShows').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!confirm("Are you sure you want to delete all TV show requests?")) return;
|
||||
|
||||
var buttonId = e.target.id;
|
||||
var origHtml = $(this).html();
|
||||
|
||||
if ($('#' + buttonId).text() === " Loading...") {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingButton(buttonId, "success");
|
||||
var url = createBaseUrl(base, '/approval/deletealltvshows');
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (checkJsonResponse(response)) {
|
||||
generateNotify("Success! All TV Show requests deleted!", "success");
|
||||
tvLoad();
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
},
|
||||
complete: function (e) {
|
||||
finishLoading(buttonId, "success", origHtml);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue