2012-01-30 01:38:44 +00:00
|
|
|
@using NzbDrone.Common
|
2011-12-12 21:52:29 +00:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-05-10 06:32:33 +00:00
|
|
|
@using NzbDrone.Web.Models;
|
2012-02-07 03:48:26 +00:00
|
|
|
@model List<NzbDrone.Web.Models.SeriesModel>
|
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-06 22:13:33 +00:00
|
|
|
@Html.IncludeCss("Grid.css")
|
2011-12-12 21:52:29 +00:00
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.editButton, .deleteButton
|
|
|
|
{
|
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
padding: 3px 1px;
|
|
|
|
margin: 0px;
|
|
|
|
vertical-align: middle;
|
2011-06-25 01:20:52 +00:00
|
|
|
}
|
2011-07-03 19:02:33 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
.editButton:hover, .deleteButton:hover
|
2011-07-03 19:02:33 +00:00
|
|
|
{
|
2012-02-05 20:17:23 +00:00
|
|
|
background-color: #065EFE;
|
2011-07-03 19:02:33 +00:00
|
|
|
}
|
2012-02-05 20:23:37 +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">
|
2011-08-06 02:04:35 +00:00
|
|
|
<li>@Html.ActionLink("Add Series", "Index", "AddSeries")</li>
|
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
|
|
|
</ul>
|
2011-04-21 07:14:47 +00:00
|
|
|
}
|
2012-02-05 20:17:23 +00:00
|
|
|
|
|
|
|
<table class="seriesTable">
|
2012-02-07 22:28:53 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
<colgroup>
|
2012-02-07 22:28:53 +00:00
|
|
|
<col style="width: 10px"/>
|
2012-02-07 08:12:17 +00:00
|
|
|
<col style="width:auto" />
|
2012-02-05 20:17:23 +00:00
|
|
|
<col style="width:100px" />
|
|
|
|
<col style="width:100px" />
|
|
|
|
<col style="width:140px" />
|
2012-02-07 08:12:17 +00:00
|
|
|
<col style="width:100px" />
|
|
|
|
<col style="width:80px"/>
|
2012-02-05 20:17:23 +00:00
|
|
|
</colgroup>
|
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>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Title</th>
|
|
|
|
<th>Seasons</th>
|
|
|
|
<th>Quality</th>
|
|
|
|
<th>Next Airing</th>
|
|
|
|
<th>Episodes</th>
|
2012-02-07 03:48:26 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
@*Commands Column*@
|
|
|
|
<th>
|
|
|
|
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@for (int i = 0; i < Model.Count; i++)
|
2012-02-07 03:48:26 +00:00
|
|
|
{
|
2012-02-07 22:28:53 +00:00
|
|
|
var series = Model[i];
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("Series", series);
|
|
|
|
}
|
2012-02-07 03:48:26 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("Series", series, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 03:48:26 +00:00
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
</tbody>
|
2012-02-05 20:17:23 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<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>
|
2011-06-28 01:23:22 +00:00
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
2012-02-05 20:17:23 +00:00
|
|
|
var seriesEditorUrl = './Series/SeriesEditor';
|
|
|
|
var saveSeriesEditorUrl = './Series/SaveSeriesEditor';
|
|
|
|
var seriesDeleteUrl = './Series/DeleteSeries';
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(".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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#seriesEditor").dialog({
|
|
|
|
autoOpen: false,
|
2012-02-07 08:20:56 +00:00
|
|
|
height: 'auto',
|
2012-02-05 20:17:23 +00:00
|
|
|
width: 670,
|
|
|
|
resizable: false,
|
|
|
|
modal: true,
|
|
|
|
buttons: {
|
2012-02-05 21:36:57 +00:00
|
|
|
"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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2012-02-05 20:17:23 +00:00
|
|
|
"Save": function () {
|
|
|
|
//Save the form
|
|
|
|
$('#SeriesEditorForm').submit();
|
2012-02-10 08:16:14 +00:00
|
|
|
updateStatus();
|
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
$(this).dialog("close");
|
|
|
|
},
|
|
|
|
Cancel: function () {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#seriesDelete").dialog({
|
|
|
|
autoOpen: false,
|
|
|
|
resizable: false,
|
2012-02-07 08:20:56 +00:00
|
|
|
height: 'auto',
|
2012-02-05 20:17:23 +00:00
|
|
|
width: 450,
|
|
|
|
modal: true,
|
|
|
|
buttons: {
|
2012-02-07 06:37:03 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
"Delete": function () {
|
2012-02-07 06:37:03 +00:00
|
|
|
|
2012-02-05 20:17:23 +00:00
|
|
|
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")
|
|
|
|
//.button()
|
|
|
|
.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
|
2012-02-07 06:37:03 +00:00
|
|
|
$("#seriesEditor").dialog("option", "title", title);
|
2012-02-05 20:17:23 +00:00
|
|
|
|
|
|
|
//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")
|
|
|
|
//.button()
|
|
|
|
.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");
|
|
|
|
});
|
2012-02-10 08:16:14 +00:00
|
|
|
|
|
|
|
function updateStatus() {
|
|
|
|
var monitored = $('#Monitored').attr('checked');
|
|
|
|
var seriesId = $('#SeriesId').val();
|
|
|
|
var img = $('.' + seriesId).children('.statusColumn').children('img');
|
|
|
|
var state = img.attr('alt');
|
|
|
|
|
|
|
|
if (state == "Ended")
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (state == "Active") {
|
|
|
|
if (!monitored) {
|
|
|
|
img.attr('title', 'Not monitored');
|
|
|
|
img.attr('alt', 'Paused');
|
|
|
|
img.attr('src', '../../Content/Images/pause.png');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state == "Paused") {
|
|
|
|
if (monitored) {
|
|
|
|
img.attr('title', 'Continuing');
|
|
|
|
img.attr('alt', 'Active');
|
|
|
|
img.attr('src', '../../Content/Images/play.png');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-06-28 01:23:22 +00:00
|
|
|
</script>
|
|
|
|
}
|