Delete added to edit dialog for series.

pull/6/head
Mark McDowall 13 years ago
parent e8ad13937a
commit aba44fb121

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

@ -61,7 +61,7 @@ namespace NzbDrone.Web.Controllers
}
[HttpPost]
public JsonResult SaveSeriesEditor(SeriesModel seriesModel)
public EmptyResult SaveSeriesEditor(SeriesModel seriesModel)
{
var series = _seriesProvider.GetSeries(seriesModel.SeriesId);
series.Monitored = seriesModel.Monitored;
@ -72,15 +72,15 @@ namespace NzbDrone.Web.Controllers
_seriesProvider.UpdateSeries(series);
return JsonNotificationResult.Info("Series Saved");
return new EmptyResult();
}
[HttpPost]
public JsonResult DeleteSeries(int seriesId)
public EmptyResult DeleteSeries(int seriesId)
{
_jobProvider.QueueJob(typeof(DeleteSeriesJob), seriesId);
return JsonNotificationResult.Info("Series Deleted");
return new EmptyResult();
}
public JsonResult LocalSearch(string term)

@ -64,6 +64,27 @@
{
text-align: center;
}
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-delete-button
{
margin-right: 445px;
}
.ui-dialog-buttonset .ui-delete-button
{
background: url("images/ui-bg_flat_30_b40404_40x100.png") repeat-x scroll 50% 50% #B40404;
border: 1px solid #FFFFFF;
color: #FFFFFF;
font-weight: normal;
}
.ui-dialog-buttonset .ui-delete-button:active
{
background: url("images/ui-bg_flat_30_616161_40x100.png") repeat-x scroll 50% 50% #616161;
border: 1px solid #FFFFFF;
color: #FFFFFF;
font-weight: normal;
}
</style>
@section ActionMenu{
<ul class="sub-menu">
@ -131,6 +152,28 @@
resizable: false,
modal: true,
buttons: {
"Delete": {
text: "Delete",
class: "ui-delete-button",
click: function () {
var answer = confirm("Are you sure you want to delete this series?");
if (answer) {
var seriesId = $('#SeriesId').val();
$.ajax({
type: "POST",
url: seriesDeleteUrl,
data: { seriesId: seriesId },
success: function (data) {
//Remove the row from the grid... along with the details row
$('.' + seriesId).hide();
$('.details_' + seriesId).hide();
}
});
$(this).dialog("close");
}
}
},
"Save": function () {
//Save the form
$('#SeriesEditorForm').submit();

@ -18,8 +18,6 @@
<td class="commandsColumn">
<img src="../../Content/Images/Rename.png" class="editButton" value="@Model.SeriesId" rel="@Model.Title" />
<img src="../../Content/Images/Delete.png" class="deleteButton" value="@Model.SeriesId" rel="@Model.Title" />
@*<div class="editButton" value="@Model.SeriesId" rel="@Model.Title">Edit</div>
<div class="deleteButton" value="@Model.SeriesId" rel="@Model.Title">Delete</div>*@
</td>
</tr>
<tr class="detail-view details_@(Model.SeriesId)">

Loading…
Cancel
Save