|
|
@ -1,53 +1,63 @@
|
|
|
|
@using NzbDrone.Common
|
|
|
|
@using NzbDrone.Common
|
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
|
|
|
@model IEnumerable<NzbDrone.Web.Models.SeriesModel>
|
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
|
|
|
|
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@Html.IncludeCss("Settings.css")
|
|
|
|
@Html.IncludeCss("Settings.css")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
/* progress bar container */
|
|
|
|
.ui-progressbar
|
|
|
|
.progressbar
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
position:relative;
|
|
|
|
width: 125px;
|
|
|
|
width: 125px;
|
|
|
|
height: 20px;
|
|
|
|
height: 20px;
|
|
|
|
position: relative;
|
|
|
|
background-color: transparent;
|
|
|
|
color: black;
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
|
|
|
|
margin: 2px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.progressBarText
|
|
|
|
/* color bar */
|
|
|
|
|
|
|
|
.progressbar div.progress
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
width: 0;
|
|
|
|
display: block;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.ui-progressbar-value
|
|
|
|
|
|
|
|
{
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
background-color: #065EFE;
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* text on bar */
|
|
|
|
|
|
|
|
.progressbar div.progress .progressText
|
|
|
|
.ui-progressbar-value .progressBarText
|
|
|
|
{
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
position: relative;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: normal;
|
|
|
|
color: white;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* text off bar */
|
|
|
|
|
|
|
|
.progressbar div.progressText
|
|
|
|
/* Set the row height so it won't resize when the progress bar is created */
|
|
|
|
|
|
|
|
.seriesTable tr
|
|
|
|
{
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
height: 28px;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
text-align: center;
|
|
|
|
.editButton, .deleteButton
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
width: 18px;
|
|
|
|
|
|
|
|
height: 18px;
|
|
|
|
|
|
|
|
padding: 3px 1px;
|
|
|
|
|
|
|
|
margin: 0px;
|
|
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.t-grid .t-alt
|
|
|
|
.editButton:hover, .deleteButton:hover
|
|
|
|
{
|
|
|
|
{
|
|
|
|
background: #E5ECF9;
|
|
|
|
background-color: #065EFE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
@section ActionMenu{
|
|
|
|
@section ActionMenu{
|
|
|
@ -56,90 +66,147 @@
|
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
|
|
|
|
|
|
|
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
|
|
|
<table class="seriesTable">
|
|
|
|
.DataBinding(data => data.Ajax()
|
|
|
|
<colgroup>
|
|
|
|
.Select("_AjaxSeriesGrid", "Series")
|
|
|
|
<col/>
|
|
|
|
.Update("_SaveAjaxSeriesEditing", "Series")
|
|
|
|
<col style="width:100px" />
|
|
|
|
.Delete("_DeleteAjaxSeriesEditing", "Series"))
|
|
|
|
<col style="width:100px" />
|
|
|
|
.Columns(columns =>
|
|
|
|
<col style="width:100px" />
|
|
|
|
{
|
|
|
|
<col style="width:100px" />
|
|
|
|
columns.Bound(o => o.Title)
|
|
|
|
<col style="width:140px" />
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
<col style="width:100px" />
|
|
|
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
|
|
|
</colgroup>
|
|
|
|
"><#= Title #></a>");
|
|
|
|
<tr>
|
|
|
|
columns.Bound(o => o.SeasonsCount).Title("Seasons");
|
|
|
|
<th>Title</th>
|
|
|
|
columns.Bound(o => o.QualityProfileName).Title("Quality");
|
|
|
|
<th>Seasons</th>
|
|
|
|
columns.Bound(o => o.Status);
|
|
|
|
<th>Quality</th>
|
|
|
|
//columns.Bound(o => o.AirsDayOfWeek);
|
|
|
|
<th>Status</th>
|
|
|
|
columns.Bound(o => o.NextAiring);
|
|
|
|
<th>Next Airing</th>
|
|
|
|
columns.Bound(o => o.Episodes).Title("Episodes").Width(125)
|
|
|
|
<th>Episodes</th>
|
|
|
|
.ClientTemplate("<div id=\"progressbar_<#= SeriesId #>\" class=\"progressbar\">" +
|
|
|
|
|
|
|
|
"<div class=\"progressText\"></div>" +
|
|
|
|
@*Commands Column*@
|
|
|
|
"<div class=\"progress\">" +
|
|
|
|
<th>
|
|
|
|
"<span class=\"progressText\" style=\"width: 125px;\"></span>" +
|
|
|
|
Commands
|
|
|
|
"</div>" +
|
|
|
|
</th>
|
|
|
|
"</div>");
|
|
|
|
</tr>
|
|
|
|
columns.Command(commands =>
|
|
|
|
@foreach (var series in Model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
commands.Edit().ButtonType(GridButtonType.Image);
|
|
|
|
Html.RenderPartial("Series", series);
|
|
|
|
commands.Delete().ButtonType(GridButtonType.Image);
|
|
|
|
}
|
|
|
|
}).Title("Actions").Width(90);
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
<div id="seriesEditor" title="Edit Series"></div>
|
|
|
|
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
|
|
|
<div id="seriesDelete" title="Delete Series">
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
|
|
|
<input class="seriesId" type="hidden" value="">
|
|
|
|
"<b>Airs Day of Week:</b> " + "<#= AirsDayOfWeek #>" +
|
|
|
|
Are you sure you want to delete '<span class="seriesTitle"></span>'?
|
|
|
|
"<br />" +
|
|
|
|
</div>
|
|
|
|
"<b>Overview:</b> " +
|
|
|
|
|
|
|
|
"<#= Overview #>"
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
clientEvents.OnEdit("grid_edit");
|
|
|
|
|
|
|
|
clientEvents.OnSave("grid_save");
|
|
|
|
|
|
|
|
clientEvents.OnRowDataBound("grid_rowBound");
|
|
|
|
|
|
|
|
if(EnviromentProvider.IsProduction)
|
|
|
|
|
|
|
|
clientEvents.OnError("grid_onError");
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.Render();}
|
|
|
|
|
|
|
|
@section Scripts{
|
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
var windowElement;
|
|
|
|
var seriesEditorUrl = './Series/SeriesEditor';
|
|
|
|
|
|
|
|
var saveSeriesEditorUrl = './Series/SaveSeriesEditor';
|
|
|
|
function grid_edit(args) {
|
|
|
|
var seriesDeleteUrl = './Series/DeleteSeries';
|
|
|
|
$(args.form)
|
|
|
|
|
|
|
|
.closest(".t-window")
|
|
|
|
$(document).ready(function () {
|
|
|
|
.data("tWindow")
|
|
|
|
$(".progressBar").each(function () {
|
|
|
|
.center();
|
|
|
|
var element = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var progressbar = $(element).progressbar({
|
|
|
|
function grid_save(e) {
|
|
|
|
value: parseInt($(element).attr("value"))
|
|
|
|
$('#ajaxSaveWheel').show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function grid_rowBound(e) {
|
|
|
|
|
|
|
|
var dataItem = e.dataItem;
|
|
|
|
|
|
|
|
var seriesId = dataItem.SeriesId;
|
|
|
|
|
|
|
|
var episodeCount = dataItem.EpisodeCount;
|
|
|
|
|
|
|
|
var episodeFileCount = dataItem.EpisodeFileCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#progressbar_" + seriesId).episodeProgress(episodeFileCount, episodeCount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function ($) {
|
|
|
|
|
|
|
|
$.fn.episodeProgress = function (episodes, totalEpisodes) {
|
|
|
|
|
|
|
|
return this.each(
|
|
|
|
|
|
|
|
function () {
|
|
|
|
|
|
|
|
var div = $(this);
|
|
|
|
|
|
|
|
var progressBar = div.find(".progress");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var width = Math.round(episodes / totalEpisodes * 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progressBar.css("width", width + "%");
|
|
|
|
|
|
|
|
div.find(".progressText").html(episodes + " / " + totalEpisodes);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
var label = progressbar.find('.progressBarText').clone().width(progressbar.width());
|
|
|
|
})(jQuery);
|
|
|
|
progressbar.find('.ui-progressbar-value').append(label);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#seriesEditor").dialog({
|
|
|
|
|
|
|
|
autoOpen: false,
|
|
|
|
|
|
|
|
height: 350,
|
|
|
|
|
|
|
|
width: 670,
|
|
|
|
|
|
|
|
resizable: false,
|
|
|
|
|
|
|
|
modal: true,
|
|
|
|
|
|
|
|
buttons: {
|
|
|
|
|
|
|
|
"Save": function () {
|
|
|
|
|
|
|
|
//Save the form
|
|
|
|
|
|
|
|
$('#SeriesEditorForm').submit();
|
|
|
|
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Cancel: function () {
|
|
|
|
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#seriesDelete").dialog({
|
|
|
|
|
|
|
|
autoOpen: false,
|
|
|
|
|
|
|
|
resizable: false,
|
|
|
|
|
|
|
|
height: 170,
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
|
|
|
//.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
|
|
|
|
|
|
|
|
$("#seriesEditor").dialog("option", "title", "Edit Series: " + 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")
|
|
|
|
|
|
|
|
//.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");
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
}
|
|
|
|
}
|
|
|
|