|
|
@ -1,7 +1,7 @@
|
|
|
|
@using NzbDrone.Common
|
|
|
|
@using NzbDrone.Common
|
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@model List<NzbDrone.Web.Models.SeriesModel>
|
|
|
|
@model string
|
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
|
|
|
|
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
@section HeaderContent
|
|
|
@ -79,48 +79,24 @@
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<table class="seriesTable">
|
|
|
|
<table id="seriesGrid" class="dataTablesGrid seriesTable">
|
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
|
|
|
|
<col style="width: 10px"/>
|
|
|
|
|
|
|
|
<col style="width:auto" />
|
|
|
|
|
|
|
|
<col style="width:100px" />
|
|
|
|
|
|
|
|
<col style="width:100px" />
|
|
|
|
|
|
|
|
<col style="width:140px" />
|
|
|
|
|
|
|
|
<col style="width:100px" />
|
|
|
|
|
|
|
|
<col style="width:80px"/>
|
|
|
|
|
|
|
|
</colgroup>
|
|
|
|
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>Status</th>
|
|
|
|
<th style="width: 10px">Status</th>
|
|
|
|
<th>Title</th>
|
|
|
|
<th style="width: auto">Title</th>
|
|
|
|
<th>Seasons</th>
|
|
|
|
<th style="width: 100px">Seasons</th>
|
|
|
|
<th>Quality</th>
|
|
|
|
<th style="width: 100px">Quality</th>
|
|
|
|
<th>Next Airing</th>
|
|
|
|
<th style="width: 140px">Next Airing</th>
|
|
|
|
<th>Episodes</th>
|
|
|
|
<th style="width: 100px">Episodes</th>
|
|
|
|
|
|
|
|
|
|
|
|
@*Commands Column*@
|
|
|
|
@*Commands Column*@
|
|
|
|
<th>
|
|
|
|
<th style="width: 80px">
|
|
|
|
|
|
|
|
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tbody>
|
|
|
|
@for (int i = 0; i < Model.Count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var series = Model[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Html.RenderPartial("Series", series);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Html.RenderPartial("Series", series, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
@ -134,8 +110,97 @@
|
|
|
|
var seriesEditorUrl = './Series/SeriesEditor';
|
|
|
|
var seriesEditorUrl = './Series/SeriesEditor';
|
|
|
|
var saveSeriesEditorUrl = './Series/SaveSeriesEditor';
|
|
|
|
var saveSeriesEditorUrl = './Series/SaveSeriesEditor';
|
|
|
|
var seriesDeleteUrl = './Series/DeleteSeries';
|
|
|
|
var seriesDeleteUrl = './Series/DeleteSeries';
|
|
|
|
|
|
|
|
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 playImage = '<img src="../../Content/Images/play.png" width="24" height="24" alt="Active" title="Continuing" />';
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
$('#seriesGrid').removeClass('hidden-grid');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
oTable = $('.dataTablesGrid').dataTable({
|
|
|
|
|
|
|
|
"bShowAll": false,
|
|
|
|
|
|
|
|
"aaData": @Html.Raw(Model),
|
|
|
|
|
|
|
|
"bPaginate": false,
|
|
|
|
|
|
|
|
"bLengthChange": false,
|
|
|
|
|
|
|
|
"bFilter": false,
|
|
|
|
|
|
|
|
"bSort": true,
|
|
|
|
|
|
|
|
"bInfo": false,
|
|
|
|
|
|
|
|
"bAutoWidth": false,
|
|
|
|
|
|
|
|
"aoColumns": [
|
|
|
|
|
|
|
|
{ sWidth: '70px',
|
|
|
|
|
|
|
|
"sClass": "statusColumn",
|
|
|
|
|
|
|
|
"mDataProp": function (source, type, val) {
|
|
|
|
|
|
|
|
// 'display' and 'filter' use our fancy naming
|
|
|
|
|
|
|
|
if (type === 'display' || type === 'filter') {
|
|
|
|
|
|
|
|
var monitored = source["Monitored"];
|
|
|
|
|
|
|
|
var status = source["Status"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!monitored) {
|
|
|
|
|
|
|
|
return pauseImage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (status === "Ended"){
|
|
|
|
|
|
|
|
return stopImage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return playImage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 'sort' and 'type' both just use the raw data
|
|
|
|
|
|
|
|
return source["Status"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, //Status
|
|
|
|
|
|
|
|
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
|
|
|
|
|
|
|
// 'display' and 'filter' use our fancy naming
|
|
|
|
|
|
|
|
if (type === 'display' || type === 'filter') {
|
|
|
|
|
|
|
|
return source["Title"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 'sort' and 'type' both just use the raw data
|
|
|
|
|
|
|
|
return source["TitleSorter"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, //Title
|
|
|
|
|
|
|
|
{ sWidth: '100px', "mDataProp": "SeasonsCount", "bSortable": false }, //Seasons
|
|
|
|
|
|
|
|
{ sWidth: '100px', "mDataProp": "QualityProfileName" }, //Quality
|
|
|
|
|
|
|
|
{ sWidth: '120px', "mDataProp": function (source, type, val) {
|
|
|
|
|
|
|
|
// 'display' and 'filter' use our fancy naming
|
|
|
|
|
|
|
|
if (type === 'display' || type === 'filter') {
|
|
|
|
|
|
|
|
return source["NextAiring"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 'sort' and 'type' both just use the raw data
|
|
|
|
|
|
|
|
return source["NextAiringSorter"];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, //Next Airing
|
|
|
|
|
|
|
|
{ sWidth: '140px', "mDataProp": "Episodes", "bSortable": false, "fnRender": function (row) {
|
|
|
|
|
|
|
|
var progress = row.aData["EpisodeFileCount"] / row.aData["EpisodeCount"] * 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = "<div class='progressBar' rel='" + progress + "'>" +
|
|
|
|
|
|
|
|
"<span class='progressBarText'>" + row.aData["EpisodeFileCount"] + " / " + row.aData["EpisodeCount"] +"</span>" +
|
|
|
|
|
|
|
|
"</div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, //Episodes
|
|
|
|
|
|
|
|
{ sWidth: '50px', "mDataProp": "HasBanner", "bSortable": false, "fnRender": function (row) {
|
|
|
|
|
|
|
|
return "<img src='../../Content/Images/settings.png' class='editButton' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "' />" +
|
|
|
|
|
|
|
|
"<img src='../../Content/Images/close.png' class='deleteButton' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "'/>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, //Commands
|
|
|
|
|
|
|
|
{ sWidth: '60px', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) {
|
|
|
|
|
|
|
|
var result = "<b>Airs Day of Week: </b>" + row.aData["AirsDayOfWeek"] + "<br/>" +
|
|
|
|
|
|
|
|
"<b>Overview: </b>" + row.aData["Overview"] + "<br/>";
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} //Details
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"aaSorting": [[1, 'asc']],
|
|
|
|
|
|
|
|
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
|
|
|
|
|
|
|
$(nRow).addClass(aData["SeriesId"].toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".progressBar").each(function () {
|
|
|
|
$(".progressBar").each(function () {
|
|
|
|
var element = this;
|
|
|
|
var element = this;
|
|
|
|
|
|
|
|
|
|
|
@ -197,11 +262,8 @@
|
|
|
|
width: 450,
|
|
|
|
width: 450,
|
|
|
|
modal: true,
|
|
|
|
modal: true,
|
|
|
|
buttons: {
|
|
|
|
buttons: {
|
|
|
|
|
|
|
|
|
|
|
|
"Delete": function () {
|
|
|
|
"Delete": function () {
|
|
|
|
|
|
|
|
|
|
|
|
var seriesId = $('.seriesId').val();
|
|
|
|
var seriesId = $('.seriesId').val();
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
type: "POST",
|
|
|
|
url: seriesDeleteUrl,
|
|
|
|
url: seriesDeleteUrl,
|
|
|
@ -221,7 +283,6 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".editButton")
|
|
|
|
$(".editButton")
|
|
|
|
//.button()
|
|
|
|
|
|
|
|
.live('click', function () {
|
|
|
|
.live('click', function () {
|
|
|
|
//Get the SeriesId and Title
|
|
|
|
//Get the SeriesId and Title
|
|
|
|
var seriesId = parseInt($(this).attr("value"));
|
|
|
|
var seriesId = parseInt($(this).attr("value"));
|
|
|
@ -247,7 +308,6 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".deleteButton")
|
|
|
|
$(".deleteButton")
|
|
|
|
//.button()
|
|
|
|
|
|
|
|
.live('click', function () {
|
|
|
|
.live('click', function () {
|
|
|
|
//Get the SeriesId and Title
|
|
|
|
//Get the SeriesId and Title
|
|
|
|
var seriesId = parseInt($(this).attr("value"));
|
|
|
|
var seriesId = parseInt($(this).attr("value"));
|
|
|
@ -267,25 +327,20 @@
|
|
|
|
function updateStatus() {
|
|
|
|
function updateStatus() {
|
|
|
|
var monitored = $('#Monitored').attr('checked');
|
|
|
|
var monitored = $('#Monitored').attr('checked');
|
|
|
|
var seriesId = $('#SeriesId').val();
|
|
|
|
var seriesId = $('#SeriesId').val();
|
|
|
|
var img = $('.' + seriesId).children('.statusColumn').children('img');
|
|
|
|
var status = $('#Status').val();
|
|
|
|
var state = img.attr('alt');
|
|
|
|
var imgContainer = $('.' + seriesId).children('.statusColumn');
|
|
|
|
|
|
|
|
|
|
|
|
if (state == "Ended")
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (state == "Active") {
|
|
|
|
|
|
|
|
if (!monitored) {
|
|
|
|
if (!monitored) {
|
|
|
|
img.attr('title', 'Not monitored');
|
|
|
|
imgContainer.html(pauseImage);
|
|
|
|
img.attr('alt', 'Paused');
|
|
|
|
|
|
|
|
img.attr('src', '../../Content/Images/pause.png');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (status === "Ended"){
|
|
|
|
|
|
|
|
imgContainer.html(stopImage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (state == "Paused") {
|
|
|
|
else {
|
|
|
|
if (monitored) {
|
|
|
|
imgContainer.html(playImage);
|
|
|
|
img.attr('title', 'Continuing');
|
|
|
|
|
|
|
|
img.attr('alt', 'Active');
|
|
|
|
|
|
|
|
img.attr('src', '../../Content/Images/play.png');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|