2011-12-13 00:52:29 +03:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-12-10 08:05:17 +03:00
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
2011-12-13 00:52:29 +03:00
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
@Html.IncludeCss("Settings.css")
|
|
|
|
}
|
2012-02-05 23:17:23 +03:00
|
|
|
<style>
|
2012-10-12 04:26:06 +03:00
|
|
|
.progressbar {
|
2012-02-05 23:17:23 +03:00
|
|
|
position:relative;
|
|
|
|
width: 125px;
|
2011-06-25 04:20:52 +03:00
|
|
|
height: 20px;
|
2012-02-05 23:17:23 +03:00
|
|
|
background-color: transparent;
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
margin: 2px;
|
2011-06-25 04:20:52 +03:00
|
|
|
}
|
2011-06-02 07:40:06 +03:00
|
|
|
|
2012-10-12 04:26:06 +03:00
|
|
|
.progressbar-text {
|
2011-06-25 04:20:52 +03:00
|
|
|
position: absolute;
|
2012-02-05 23:17:23 +03:00
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
2012-10-12 03:19:20 +03:00
|
|
|
.ui-progressbar-value {
|
2011-06-25 04:20:52 +03:00
|
|
|
overflow: hidden;
|
2012-02-05 23:17:23 +03:00
|
|
|
border: 1px solid #065EFE;
|
2011-06-25 04:20:52 +03:00
|
|
|
}
|
2012-02-05 23:17:23 +03:00
|
|
|
|
2012-10-12 04:26:06 +03:00
|
|
|
.ui-progressbar-value .progressbar-text {
|
|
|
|
position: relative;
|
2012-02-05 23:17:23 +03:00
|
|
|
font-weight: normal;
|
2011-06-25 04:20:52 +03:00
|
|
|
color: white;
|
|
|
|
}
|
2012-02-05 23:17:23 +03:00
|
|
|
|
|
|
|
/* Set the row height so it won't resize when the progress bar is created */
|
|
|
|
.seriesTable tr
|
2011-06-25 04:20:52 +03:00
|
|
|
{
|
2012-02-05 23:17:23 +03:00
|
|
|
height: 28px;
|
|
|
|
}
|
2012-02-29 11:25:41 +03:00
|
|
|
|
2012-02-07 11:24:44 +03:00
|
|
|
.commandsColumn, .statusColumn
|
2012-02-05 23:23:37 +03:00
|
|
|
{
|
|
|
|
text-align: center;
|
2012-10-12 00:21:00 +03:00
|
|
|
white-space: nowrap;
|
2012-02-05 23:23:37 +03:00
|
|
|
}
|
2012-02-06 00:36:57 +03:00
|
|
|
|
|
|
|
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-delete-button
|
|
|
|
{
|
|
|
|
margin-right: 445px;
|
|
|
|
}
|
|
|
|
|
2011-06-02 06:36:30 +03:00
|
|
|
</style>
|
2011-04-21 10:14:47 +03:00
|
|
|
@section ActionMenu{
|
2011-08-22 05:56:04 +03:00
|
|
|
<ul class="sub-menu">
|
2012-03-16 10:02:33 +03:00
|
|
|
<li>@Html.ActionLink("Add Series", "Index", "AddSeries", null, new { Title = "Add a new or existing series" })</li>
|
2012-03-14 00:04:42 +03:00
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null, new { Title = "Check for newly released downloads" })</li>
|
2012-03-16 10:02:33 +03:00
|
|
|
<li>@Html.ActionLink("Series Editor", "Editor", "Series", null, new { Title = "Edit multiple series" })</li>
|
2011-08-06 05:04:35 +03:00
|
|
|
</ul>
|
2011-04-21 10:14:47 +03:00
|
|
|
}
|
2012-02-05 23:17:23 +03:00
|
|
|
|
2012-02-18 22:41:29 +03:00
|
|
|
<table id="seriesGrid" class="dataTablesGrid hidden-grid">
|
2012-02-08 01:28:53 +03:00
|
|
|
<thead>
|
2012-02-05 23:17:23 +03:00
|
|
|
|
2012-02-08 01:28:53 +03:00
|
|
|
<tr>
|
2012-02-16 08:53:00 +03: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 10:20:40 +03:00
|
|
|
<th style="width: 100px">Network</th>
|
2012-02-16 08:53:00 +03:00
|
|
|
<th style="width: 140px">Next Airing</th>
|
|
|
|
<th style="width: 100px">Episodes</th>
|
2012-02-07 06:48:26 +03:00
|
|
|
|
2012-02-08 01:28:53 +03:00
|
|
|
@*Commands Column*@
|
2012-10-12 00:21:00 +03:00
|
|
|
<th style="width: 80px"></th>
|
2012-02-08 01:28:53 +03:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
2012-02-05 23:17:23 +03:00
|
|
|
</table>
|
|
|
|
|
2012-02-18 03:43:16 +03:00
|
|
|
<div style="visibility: hidden">
|
|
|
|
<div id="seriesEditor" title="Edit Series">
|
|
|
|
</div>
|
2012-09-04 03:51:07 +03:00
|
|
|
|
2012-02-18 03:43:16 +03:00
|
|
|
<div id="seriesDelete" title="Delete Series">
|
|
|
|
<input class="seriesId" type="hidden" value="" />
|
|
|
|
Are you sure you want to delete '<span class="seriesTitle"></span>'?
|
2012-09-04 03:51:07 +03:00
|
|
|
<div class="series-delete-files">
|
|
|
|
@Html.CheckBox("DeleteFromDisk")
|
|
|
|
<label for="DeleteFromDisk">Delete all files from disk?</label>
|
|
|
|
</div>
|
2012-02-18 03:43:16 +03:00
|
|
|
</div>
|
2012-02-05 23:17:23 +03:00
|
|
|
</div>
|
2011-06-28 04:23:22 +03:00
|
|
|
@section Scripts{
|
2012-02-23 00:41:47 +03:00
|
|
|
@Html.IncludeScript("NzbDrone/series.js")
|
|
|
|
|
2011-06-28 04:23:22 +03:00
|
|
|
<script type="text/javascript">
|
2012-02-23 00:41:47 +03:00
|
|
|
|
2012-10-11 05:02:17 +03:00
|
|
|
var pauseImage = '<i class="icon-pause grid-icon" title="Not Monitored"></i>';
|
|
|
|
var stopImage = '<i class="icon-stop grid-icon" title="Ended"></i>';
|
|
|
|
var playImage = '<i class="icon-play grid-icon" title="Continuing"></i>';
|
2012-02-05 23:17:23 +03:00
|
|
|
|
|
|
|
$(document).ready(function () {
|
2012-02-16 08:53:00 +03:00
|
|
|
$('#seriesGrid').removeClass('hidden-grid');
|
|
|
|
|
|
|
|
oTable = $('.dataTablesGrid').dataTable({
|
2012-09-27 23:54:40 +03:00
|
|
|
"sAjaxSource": "Series/Series",
|
|
|
|
"bServerSide": false,
|
2012-02-16 08:53:00 +03:00
|
|
|
"bShowAll": false,
|
|
|
|
"bPaginate": false,
|
|
|
|
"bLengthChange": false,
|
|
|
|
"bFilter": false,
|
|
|
|
"bSort": true,
|
|
|
|
"bInfo": false,
|
|
|
|
"bAutoWidth": false,
|
2012-02-16 10:17:01 +03:00
|
|
|
"bStateSave": true,
|
2012-02-16 10:27:03 +03:00
|
|
|
"iCookieDuration": 60 * 60 *24 * 365, //1 year
|
2012-02-16 08:53:00 +03: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-10-22 10:05:27 +03:00
|
|
|
return "<a href='/series/details/" + source["SeriesId"] + "'>" + source["Title"] + "</a>";
|
2012-02-16 08:53:00 +03:00
|
|
|
}
|
|
|
|
// 'sort' and 'type' both just use the raw data
|
|
|
|
return source["TitleSorter"];
|
|
|
|
}
|
|
|
|
}, //Title
|
2012-03-02 10:59:12 +03:00
|
|
|
{ sWidth: '100px', "mDataProp": "SeasonsCount" }, //Seasons
|
2012-03-13 23:01:30 +03:00
|
|
|
{ sWidth: '100px', "mDataProp": "QualityProfileName", sClass: "qualityColumn" }, //Quality
|
2012-02-29 20:22:58 +03:00
|
|
|
{ sWidth: '120px', "mDataProp": "Network" }, //Network
|
2012-02-16 08:53:00 +03: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 19:12:40 +03:00
|
|
|
var progress = 100;
|
|
|
|
if (row.aData["EpisodeCount"] > 0)
|
|
|
|
progress = row.aData["EpisodeFileCount"] / row.aData["EpisodeCount"] * 100;
|
2012-02-16 08:53:00 +03:00
|
|
|
|
2012-10-12 04:26:06 +03:00
|
|
|
var roundedProgress = Math.round(progress);
|
2012-10-12 03:19:20 +03:00
|
|
|
var progressbar =
|
2012-10-12 04:26:06 +03:00
|
|
|
'<div class="progressbar ui-progressbar ui-widget ui-widget-content ui-corner-all" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="' + roundedProgress + '" data-value="' + progress + '">' +
|
2012-10-12 03:19:20 +03:00
|
|
|
'<span class="progressbar-text">' + row.aData["EpisodeFileCount"] + ' / ' + row.aData["EpisodeCount"] + '</span>' +
|
2012-10-12 04:26:06 +03:00
|
|
|
'<div class="ui-progressbar-value ui-widget-header ui-corner-left" style="width: ' + roundedProgress + '%">' +
|
2012-10-12 03:19:20 +03:00
|
|
|
'<span class="progressbar-text" style="width: 125px">' + row.aData["EpisodeFileCount"] + ' / ' + row.aData["EpisodeCount"] + '</span>' +
|
|
|
|
'</div>' +
|
|
|
|
'</div>';
|
|
|
|
|
|
|
|
return progressbar;
|
2012-10-12 04:26:06 +03:00
|
|
|
}
|
2012-02-16 08:53:00 +03:00
|
|
|
}, //Episodes
|
2012-10-11 02:39:16 +03:00
|
|
|
{
|
2012-10-12 00:21:00 +03:00
|
|
|
sClass: "commandsColumn",
|
2012-10-11 02:39:16 +03:00
|
|
|
sWidth: '50px', "mDataProp": "HasBanner", "bSortable": false, "fnRender": function (row) {
|
2012-10-11 11:02:34 +03:00
|
|
|
return "<i class='icon-cog editButton gridAction' title = 'Edit Series' data-series-id='" + row.aData["SeriesId"] + "' data-series-title='" + row.aData["Title"] + "' ></i> " +
|
|
|
|
"<i class='icon-remove deleteButton gridAction' title = 'Delete Series' data-series-id='" + row.aData["SeriesId"] + "' data-series-title='" + row.aData["Title"] + "'></i>";
|
2012-02-16 08:53:00 +03:00
|
|
|
}
|
|
|
|
}, //Commands
|
|
|
|
{ sWidth: '60px', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) {
|
2012-04-15 03:55:17 +03:00
|
|
|
var result = "<b>Airs Day of Week: </b>" + row.aData["AirsDayOfWeek"] + "<br/>" +
|
|
|
|
"<b>Air Time: </b>" + row.aData["AirTime"] + "<br/>" +
|
2012-02-16 08:53:00 +03:00
|
|
|
"<b>Overview: </b>" + row.aData["Overview"] + "<br/>";
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} //Details
|
|
|
|
],
|
|
|
|
"aaSorting": [[1, 'asc']],
|
|
|
|
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
2012-10-01 01:39:08 +03:00
|
|
|
$(nRow).attr('data-series-id', aData["SeriesId"].toString());
|
2012-09-26 18:51:02 +03:00
|
|
|
},
|
|
|
|
"oLanguage": {
|
|
|
|
"sEmptyTable": "No series have been added"
|
2012-02-16 08:53:00 +03:00
|
|
|
}
|
|
|
|
});
|
2012-02-05 23:17:23 +03:00
|
|
|
});
|
2012-02-23 00:41:47 +03:00
|
|
|
|
|
|
|
//After we delete a series do this...
|
|
|
|
function afterDelete(seriesId) {
|
2012-10-01 01:39:08 +03:00
|
|
|
var row = $('[data-series-id="' + seriesId + '"]');
|
2012-04-26 01:33:20 +03:00
|
|
|
|
|
|
|
if ($(row).hasClass('details-opened')) {
|
|
|
|
var nextRow = $(row).next('tr');
|
|
|
|
if($(nextRow).children('.Details').length > 0) {
|
|
|
|
$(nextRow).hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(row).hide();
|
2012-02-23 00:41:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
//After we save do this...
|
|
|
|
function afterSave() {
|
|
|
|
updateStatus();
|
2012-03-13 23:01:30 +03:00
|
|
|
|
|
|
|
//Update Quality
|
|
|
|
var seriesId = $('#SeriesId').val();
|
|
|
|
var quality = $('#QualityProfileId :selected').text();
|
|
|
|
$('.' + seriesId).children('.qualityColumn').text(quality);
|
2012-02-23 00:41:47 +03: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 23:17:23 +03:00
|
|
|
}
|
|
|
|
|
2012-02-23 00:41:47 +03:00
|
|
|
else {
|
|
|
|
if (status === "Ended") {
|
|
|
|
imgContainer.html(stopImage);
|
2012-02-05 23:17:23 +03:00
|
|
|
}
|
|
|
|
|
2012-02-16 08:53:00 +03:00
|
|
|
else {
|
2012-02-23 00:41:47 +03:00
|
|
|
imgContainer.html(playImage);
|
2012-02-10 11:16:14 +03:00
|
|
|
}
|
|
|
|
}
|
2012-02-23 00:41:47 +03:00
|
|
|
}
|
2011-06-28 04:23:22 +03:00
|
|
|
</script>
|
|
|
|
}
|