2011-12-12 21:52:29 +00:00
|
|
|
@using NzbDrone.Web.Helpers
|
2012-02-16 05:53:00 +00:00
|
|
|
@model string
|
2011-12-10 05:05:17 +00:00
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
2011-12-12 21:52:29 +00:00
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
@Html.IncludeCss("Settings.css")
|
|
|
|
}
|
2012-02-05 20:17:23 +00:00
|
|
|
<style>
|
|
|
|
.ui-progressbar
|
2011-06-25 01:20:52 +00:00
|
|
|
{
|
2012-02-05 20:17:23 +00:00
|
|
|
position:relative;
|
|
|
|
width: 125px;
|
2011-06-25 01:20:52 +00:00
|
|
|
height: 20px;
|
2012-02-05 20:17:23 +00:00
|
|
|
background-color: transparent;
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
margin: 2px;
|
2011-06-25 01:20:52 +00:00
|
|
|
}
|
2011-06-02 04:40:06 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
.progressBarText
|
2011-06-25 01:20:52 +00:00
|
|
|
{
|
|
|
|
position: absolute;
|
2012-02-05 20:17:23 +00:00
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-value
|
|
|
|
{
|
2011-06-25 01:20:52 +00:00
|
|
|
overflow: hidden;
|
2012-02-05 20:17:23 +00:00
|
|
|
border: 1px solid #065EFE;
|
2011-06-25 01:20:52 +00:00
|
|
|
}
|
2012-02-05 20:17:23 +00:00
|
|
|
|
|
|
|
.ui-progressbar-value .progressBarText
|
2011-06-25 01:20:52 +00:00
|
|
|
{
|
2012-02-05 20:17:23 +00:00
|
|
|
position: relative;
|
|
|
|
font-weight: normal;
|
2011-06-25 01:20:52 +00:00
|
|
|
color: white;
|
|
|
|
}
|
2012-02-05 20:17:23 +00:00
|
|
|
|
|
|
|
/* Set the row height so it won't resize when the progress bar is created */
|
|
|
|
.seriesTable tr
|
2011-06-25 01:20:52 +00:00
|
|
|
{
|
2012-02-05 20:17:23 +00:00
|
|
|
height: 28px;
|
|
|
|
}
|
2012-02-29 08:25:41 +00:00
|
|
|
|
2012-02-07 08:24:44 +00:00
|
|
|
.commandsColumn, .statusColumn
|
2012-02-05 20:23:37 +00:00
|
|
|
{
|
|
|
|
text-align: center;
|
|
|
|
}
|
2012-02-05 21:36:57 +00:00
|
|
|
|
|
|
|
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-delete-button
|
|
|
|
{
|
|
|
|
margin-right: 445px;
|
|
|
|
}
|
|
|
|
|
2011-06-02 03:36:30 +00:00
|
|
|
</style>
|
2011-04-21 07:14:47 +00:00
|
|
|
@section ActionMenu{
|
2011-08-22 02:56:04 +00:00
|
|
|
<ul class="sub-menu">
|
2012-03-16 07:02:33 +00:00
|
|
|
<li>@Html.ActionLink("Add Series", "Index", "AddSeries", null, new { Title = "Add a new or existing series" })</li>
|
2012-03-13 21:04:42 +00:00
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null, new { Title = "Check for newly released downloads" })</li>
|
2012-03-16 07:02:33 +00:00
|
|
|
<li>@Html.ActionLink("Series Editor", "Editor", "Series", null, new { Title = "Edit multiple series" })</li>
|
2011-08-06 02:04:35 +00:00
|
|
|
</ul>
|
2011-04-21 07:14:47 +00:00
|
|
|
}
|
2012-02-05 20:17:23 +00:00
|
|
|
|
2012-02-18 19:41:29 +00:00
|
|
|
<table id="seriesGrid" class="dataTablesGrid hidden-grid">
|
2012-02-07 22:28:53 +00:00
|
|
|
<thead>
|
2012-02-05 20:17:23 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
<tr>
|
2012-02-16 05:53:00 +00:00
|
|
|
<th style="width: 10px">Status</th>
|
|
|
|
<th style="width: auto">Title</th>
|
|
|
|
<th style="width: 100px">Seasons</th>
|
|
|
|
<th style="width: 100px">Quality</th>
|
2012-02-29 07:20:40 +00:00
|
|
|
<th style="width: 100px">Network</th>
|
2012-02-16 05:53:00 +00:00
|
|
|
<th style="width: 140px">Next Airing</th>
|
|
|
|
<th style="width: 100px">Episodes</th>
|
2012-02-07 03:48:26 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
@*Commands Column*@
|
2012-02-16 05:53:00 +00:00
|
|
|
<th style="width: 80px">
|
2012-02-07 22:28:53 +00:00
|
|
|
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
2012-02-05 20:17:23 +00:00
|
|
|
</table>
|
|
|
|
|
2012-02-18 00:43:16 +00:00
|
|
|
<div style="visibility: hidden">
|
|
|
|
<div id="seriesEditor" title="Edit Series">
|
|
|
|
</div>
|
|
|
|
<div id="seriesDelete" title="Delete Series">
|
|
|
|
<input class="seriesId" type="hidden" value="" />
|
|
|
|
Are you sure you want to delete '<span class="seriesTitle"></span>'?
|
|
|
|
</div>
|
2012-02-05 20:17:23 +00:00
|
|
|
</div>
|
2011-06-28 01:23:22 +00:00
|
|
|
@section Scripts{
|
2012-02-22 21:41:47 +00:00
|
|
|
@Html.IncludeScript("NzbDrone/series.js")
|
|
|
|
|
2011-06-28 01:23:22 +00:00
|
|
|
<script type="text/javascript">
|
2012-02-22 21:41:47 +00:00
|
|
|
|
2012-02-16 05:53:00 +00:00
|
|
|
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" />';
|
2012-02-05 20:17:23 +00:00
|
|
|
|
|
|
|
$(document).ready(function () {
|
2012-02-16 05:53:00 +00:00
|
|
|
$('#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,
|
2012-02-16 07:17:01 +00:00
|
|
|
"bStateSave": true,
|
2012-02-16 07:27:03 +00:00
|
|
|
"iCookieDuration": 60 * 60 *24 * 365, //1 year
|
2012-02-16 05:53:00 +00:00
|
|
|
"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') {
|
2012-02-18 00:24:49 +00:00
|
|
|
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["Title"] + "</a>";
|
2012-02-16 05:53:00 +00:00
|
|
|
}
|
|
|
|
// 'sort' and 'type' both just use the raw data
|
|
|
|
return source["TitleSorter"];
|
|
|
|
}
|
|
|
|
}, //Title
|
2012-03-02 07:59:12 +00:00
|
|
|
{ sWidth: '100px', "mDataProp": "SeasonsCount" }, //Seasons
|
2012-03-13 20:01:30 +00:00
|
|
|
{ sWidth: '100px', "mDataProp": "QualityProfileName", sClass: "qualityColumn" }, //Quality
|
2012-02-29 17:22:58 +00:00
|
|
|
{ sWidth: '120px', "mDataProp": "Network" }, //Network
|
2012-02-16 05:53:00 +00:00
|
|
|
{ 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) {
|
2012-08-09 16:12:40 +00:00
|
|
|
var progress = 100;
|
|
|
|
if (row.aData["EpisodeCount"] > 0)
|
|
|
|
progress = row.aData["EpisodeFileCount"] / row.aData["EpisodeCount"] * 100;
|
2012-02-16 05:53:00 +00:00
|
|
|
|
|
|
|
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) {
|
2012-03-13 20:01:30 +00:00
|
|
|
return "<img src='../../Content/Images/settings.png' class='editButton gridAction' title = 'Edit Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "' />" +
|
|
|
|
"<img src='../../Content/Images/close.png' class='deleteButton gridAction' title = 'Delete Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "'/>";
|
2012-02-16 05:53:00 +00:00
|
|
|
}
|
|
|
|
}, //Commands
|
|
|
|
{ sWidth: '60px', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) {
|
2012-04-15 00:55:17 +00:00
|
|
|
var result = "<b>Airs Day of Week: </b>" + row.aData["AirsDayOfWeek"] + "<br/>" +
|
|
|
|
"<b>Air Time: </b>" + row.aData["AirTime"] + "<br/>" +
|
2012-02-16 05:53:00 +00:00
|
|
|
"<b>Overview: </b>" + row.aData["Overview"] + "<br/>";
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} //Details
|
|
|
|
],
|
|
|
|
"aaSorting": [[1, 'asc']],
|
|
|
|
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
|
|
|
$(nRow).addClass(aData["SeriesId"].toString());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
$(".progressBar").each(function () {
|
|
|
|
var element = this;
|
|
|
|
|
|
|
|
var progressbar = $(element).progressbar({
|
2012-02-07 07:38:31 +00:00
|
|
|
value: parseInt($(element).attr("rel"))
|
2011-06-23 06:56:17 +00:00
|
|
|
});
|
2012-02-07 07:09:02 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
var label = progressbar.find('.progressBarText').clone().width(progressbar.width());
|
|
|
|
progressbar.find('.ui-progressbar-value').append(label);
|
|
|
|
});
|
|
|
|
});
|
2012-02-22 21:41:47 +00:00
|
|
|
|
|
|
|
//After we delete a series do this...
|
|
|
|
function afterDelete(seriesId) {
|
2012-04-25 22:33:20 +00:00
|
|
|
var row = $('.' + seriesId);
|
|
|
|
|
|
|
|
if ($(row).hasClass('details-opened')) {
|
|
|
|
var nextRow = $(row).next('tr');
|
|
|
|
if($(nextRow).children('.Details').length > 0) {
|
|
|
|
$(nextRow).hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(row).hide();
|
2012-02-22 21:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//After we save do this...
|
|
|
|
function afterSave() {
|
|
|
|
updateStatus();
|
2012-03-13 20:01:30 +00:00
|
|
|
|
|
|
|
//Update Quality
|
|
|
|
var seriesId = $('#SeriesId').val();
|
|
|
|
var quality = $('#QualityProfileId :selected').text();
|
|
|
|
$('.' + seriesId).children('.qualityColumn').text(quality);
|
2012-02-22 21:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2012-02-05 20:17:23 +00:00
|
|
|
}
|
|
|
|
|
2012-02-22 21:41:47 +00:00
|
|
|
else {
|
|
|
|
if (status === "Ended") {
|
|
|
|
imgContainer.html(stopImage);
|
2012-02-05 20:17:23 +00:00
|
|
|
}
|
|
|
|
|
2012-02-16 05:53:00 +00:00
|
|
|
else {
|
2012-02-22 21:41:47 +00:00
|
|
|
imgContainer.html(playImage);
|
2012-02-10 08:16:14 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-22 21:41:47 +00:00
|
|
|
}
|
2011-06-28 01:23:22 +00:00
|
|
|
</script>
|
|
|
|
}
|