fixup! Merge branch 'details'

New: Edit added to Series/Details
pull/3113/head
Mark McDowall 13 years ago
commit 9c28e1b22d

@ -351,6 +351,7 @@
<Content Include="Scripts\NzbDrone\addSeries.js" /> <Content Include="Scripts\NzbDrone\addSeries.js" />
<Content Include="Scripts\NzbDrone\AutoComplete.js" /> <Content Include="Scripts\NzbDrone\AutoComplete.js" />
<Content Include="Scripts\jquery.dataTables.4button.pagination.js" /> <Content Include="Scripts\jquery.dataTables.4button.pagination.js" />
<Content Include="Scripts\NzbDrone\series.js" />
<Content Include="Scripts\NzbDrone\qualitySettings.js" /> <Content Include="Scripts\NzbDrone\qualitySettings.js" />
<Content Include="Scripts\NzbDrone\grid.js" /> <Content Include="Scripts\NzbDrone\grid.js" />
<Content Include="Scripts\NzbDrone\settings.js" /> <Content Include="Scripts\NzbDrone\settings.js" />

@ -0,0 +1,107 @@
var seriesEditorUrl = '../Series/SeriesEditor';
var saveSeriesEditorUrl = '../Series/SaveSeriesEditor';
var seriesDeleteUrl = '../Series/DeleteSeries';
$("#seriesEditor").dialog({
autoOpen: false,
height: 'auto',
width: 670,
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
afterDelete();
}
});
$(this).dialog("close");
}
}
},
"Save": function () {
//Save the form
$('#SeriesEditorForm').submit();
afterSave();
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$("#seriesDelete").dialog({
autoOpen: false,
resizable: false,
height: 'auto',
width: 450,
modal: true,
buttons: {
"Delete": function () {
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
afterDelete(seriesId);
}
});
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$(".editButton").live('click', function () {
//Get the SeriesId and Title
var seriesId = parseInt($(this).attr("value"));
var title = $(this).attr("rel");
//Set the title of the dialog
$("#seriesEditor").dialog("option", "title", title);
//Pre-populate the view with ajax
$('#seriesEditor').html('<div style="text-align: center; width: 100%; height: 100%;"><img src="../../Content/Images/ajax-loader.gif" style="padding-top: 120px;" /></div>');
//Get the view
$.ajax({
url: seriesEditorUrl,
data: { seriesId: seriesId },
success: function (data) {
$('#seriesEditor').html(data);
}
});
//Open the dialog
$("#seriesEditor").dialog("open");
});
$(".deleteButton").live('click', function () {
//Get the SeriesId and Title
var seriesId = parseInt($(this).attr("value"));
var title = $(this).attr("rel");
//Fill in the view
$('#seriesDelete').children('.seriesId').val(seriesId);
$('#seriesDelete').children('.seriesTitle').html(title);
//Open the dialog
$("#seriesDelete").dialog("open");
});

@ -5,57 +5,65 @@
@section HeaderContent @section HeaderContent
{ {
@Html.IncludeCss("Settings.css")
@Html.IncludeCss("Grid.css") @Html.IncludeCss("Grid.css")
}
@{ ViewBag.Title = Model.Title; }
<style>
.seasonToggleTopGroup
{
overflow: hidden;
}
.seasonToggleTop <style>
{ .seasonToggleTopGroup
background-color: #F1EDED; {
background-position: 5px center; overflow: hidden;
background-repeat: no-repeat; }
display: inline-block;
font-size: 15px;
margin: 2px;
padding: 2px 5px;
width: 100px;
}
.seasonToggleLabel .seasonToggleTop
{ {
margin-left: 5px; background-color: #F1EDED;
color: black; background-position: 5px center;
text-decoration: none; background-repeat: no-repeat;
} display: inline-block;
font-size: 15px;
margin: 2px;
padding: 2px 5px;
width: 100px;
}
.seasonToggleLabel
{
margin-left: 5px;
color: black;
text-decoration: none;
}
.seasonToggleTop .ignoredEpisodesMaster .seasonToggleTop .ignoredEpisodesMaster
{ {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
border-style: none; border-style: none;
} }
#banner-container #banner-container
{ {
width: 758px; width: 758px;
height: 140px; height: 140px;
padding: 0px; padding: 0px;
margin-top: 10px; margin-top: 10px;
margin-bottom: 15px; margin-bottom: 15px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.seasonSection .seasonSection
{ {
margin-top: 50px; margin-top: 50px;
} }
</style>
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-delete-button
{
margin-right: 445px;
}
</style>
}
@{ ViewBag.Title = Model.Title; }
@section ActionMenu @section ActionMenu
{ {
<ul class="sub-menu"> <ul class="sub-menu">
@ -63,6 +71,7 @@
<li>@Ajax.ActionLink("Update Info", "UpdateInfo", "Command", new { seriesId = Model.SeriesId }, null)</li> <li>@Ajax.ActionLink("Update Info", "UpdateInfo", "Command", new { seriesId = Model.SeriesId }, null)</li>
<li>@Ajax.ActionLink("Search for missing episodes", "BacklogSeries", "Episode", new { seriesId = Model.SeriesId }, null)</li> <li>@Ajax.ActionLink("Search for missing episodes", "BacklogSeries", "Episode", new { seriesId = Model.SeriesId }, null)</li>
<li>@Ajax.ActionLink("Rename Episodes", "RenameEpisodes", "Episode", new { seriesId = Model.SeriesId }, null)</li> <li>@Ajax.ActionLink("Rename Episodes", "RenameEpisodes", "Episode", new { seriesId = Model.SeriesId }, null)</li>
<li><a class="editButton" value="@Model.SeriesId" rel="@Model.Title">Edit</a></li>
</ul> </ul>
} }
@ -95,9 +104,27 @@
} }
</div> </div>
} }
<div style="visibility: hidden">
<div id="seriesEditor" title="Edit Series">
</div>
</div>
@section Scripts{ @section Scripts{
@Html.IncludeScript("NzbDrone/seriesDetails.js") @Html.IncludeScript("NzbDrone/seriesDetails.js")
@Html.IncludeScript("NzbDrone/series.js")
<script type="text/javascript"> <script type="text/javascript">
seriesId = @Model.SeriesId; seriesId = @Model.SeriesId;
//Used when we delete this series
function afterDelete(seriesId) {
window.location = "/";
}
//After we save do this...
function afterSave() {
//Do nothing
}
</script> </script>
} }

@ -110,10 +110,10 @@
</div> </div>
</div> </div>
@section Scripts{ @section Scripts{
@Html.IncludeScript("NzbDrone/series.js")
<script type="text/javascript"> <script type="text/javascript">
var seriesEditorUrl = './Series/SeriesEditor';
var saveSeriesEditorUrl = './Series/SaveSeriesEditor';
var seriesDeleteUrl = './Series/DeleteSeries';
var pauseImage = '<img src="../../Content/Images/pause.png" width="24" height="24" alt="Paused" title="Not monitored" />'; var pauseImage = '<img src="../../Content/Images/pause.png" width="24" height="24" alt="Paused" title="Not monitored" />';
var stopImage = '<img src="../../Content/Images/stop.png" width="24" height="24" alt="Ended" title="Ended" />'; var stopImage = '<img src="../../Content/Images/stop.png" width="24" height="24" alt="Ended" title="Ended" />';
var playImage = '<img src="../../Content/Images/play.png" width="24" height="24" alt="Active" title="Continuing" />'; var playImage = '<img src="../../Content/Images/play.png" width="24" height="24" alt="Active" title="Continuing" />';
@ -218,137 +218,37 @@
progressbar.find('.ui-progressbar-value').append(label); progressbar.find('.ui-progressbar-value').append(label);
}); });
}); });
$("#seriesEditor").dialog({ //After we delete a series do this...
autoOpen: false, function afterDelete(seriesId) {
height: 'auto', $('.' + seriesId).hide();
width: 670, $('.details_' + seriesId).hide();
resizable: false, }
modal: true,
buttons: { //After we save do this...
"Delete": { function afterSave() {
text: "Delete", updateStatus();
class: "ui-delete-button", }
click: function () {
var answer = confirm("Are you sure you want to delete this series?"); function updateStatus() {
if (answer) { var monitored = $('#Monitored').attr('checked');
var seriesId = $('#SeriesId').val(); var seriesId = $('#SeriesId').val();
var status = $('#Status').val();
$.ajax({ var imgContainer = $('.' + seriesId).children('.statusColumn');
type: "POST",
url: seriesDeleteUrl, if (!monitored) {
data: { seriesId: seriesId }, imgContainer.html(pauseImage);
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();
updateStatus();
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
} }
});
$("#seriesDelete").dialog({ else {
autoOpen: false, if (status === "Ended") {
resizable: false, imgContainer.html(stopImage);
height: 'auto',
width: 450,
modal: true,
buttons: {
"Delete": function () {
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");
},
Cancel: function () {
$(this).dialog("close");
} }
}
});
$(".editButton")
.live('click', function () {
//Get the SeriesId and Title
var seriesId = parseInt($(this).attr("value"));
var title = $(this).attr("rel");
//Set the title of the dialog
$("#seriesEditor").dialog("option", "title", title);
//Pre-populate the view with ajax
$('#seriesEditor').html('<div style="text-align: center; width: 100%; height: 100%;"><img src="../../Content/Images/ajax-loader.gif" style="padding-top: 120px;" /></div>');
//Get the view
$.ajax({
url: seriesEditorUrl,
data: { seriesId: seriesId },
success: function (data) {
$('#seriesEditor').html(data);
}
});
//Open the dialog
$("#seriesEditor").dialog("open");
});
$(".deleteButton")
.live('click', function () {
//Get the SeriesId and Title
var seriesId = parseInt($(this).attr("value"));
var title = $(this).attr("rel");
//Set the title of the dialog
//$("#seriesDelete").dialog("option", "title", "Delete Series: " + title);
//Fill in the view
$('#seriesDelete').children('.seriesId').val(seriesId);
$('#seriesDelete').children('.seriesTitle').html(title);
//Open the dialog
$("#seriesDelete").dialog("open");
});
function updateStatus() {
var monitored = $('#Monitored').attr('checked');
var seriesId = $('#SeriesId').val();
var status = $('#Status').val();
var imgContainer = $('.' + seriesId).children('.statusColumn');
if (!monitored) {
imgContainer.html(pauseImage);
}
else { else {
if (status === "Ended"){ imgContainer.html(playImage);
imgContainer.html(stopImage);
}
else {
imgContainer.html(playImage);
}
} }
} }
}
</script> </script>
} }

Loading…
Cancel
Save