@model SeriesModel
@using NzbDrone.Common
@using NzbDrone.Web.Helpers
@using NzbDrone.Web.Models
@{ViewBag.Title = Model.Title;}
@section HeaderContent
{
@Html.IncludeCss("Grid.css")
}
@{ ViewBag.Title = Model.Title; }
@section ActionMenu{
}
@{
var bannerUrl = "../../Content/Images/img03.jpg";
if (Model.HasBanner)
{
bannerUrl = "../../MediaCover/Banners/" + Model.SeriesId + ".jpg";
}
}
@foreach (var season in Model.Seasons)
{
var ignoreSeason = "ignoreSeason_" + season;
@(season == 0 ? "Specials" : "Season " + season)
}
@foreach (var s in Model.Seasons.Reverse())
{
var seriesId = @Model.SeriesId;
var season = s;
@(season == 0 ? "Specials" : "Season " + season)
Html.Telerik().Grid().Name("seasons_" + season)
.TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns =>
{
columns.Bound(c => c.EpisodeNumber).Width(100).Title("Episode #").Sortable(true);
columns.Bound(c => c.Title).Title("Title").Sortable(false);
columns.Bound(c => c.AirDate).Width(100).Sortable(false);
columns.Bound(c => c.Quality).Width(100);
columns.Bound(c => c.Status).Sortable(false)
.Title("" +
"" +
Ajax.ImageActionLink("../../Content/Images/Search.png", new { Alt = "Search", Title = "Search for all episodes in this season", @class = "searchImage searchImageMaster" }, "SearchSeason", "Episode", new { SeriesId = seriesId, SeasonNumber = season }, null, null) +
Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename all episodes in this season", @class = "renameImage renameImageMaster" }, "RenameSeason", "Episode", new { SeriesId = seriesId, SeasonNumber = season }, null, null))
.ClientTemplate("" +
"" +
Ajax.ImageActionLink("../../Content/Images/Search.png", new { Alt = "Search", Title = "Search for episode", @class = "searchImage" }, "Search", "Episode", new { EpisodeId = "<#= EpisodeId #>" }, null, null) +
Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename episode", @class = "renameImage" }, "Rename", "Episode", new { EpisodeFileId = "<#= EpisodeFileId #>" }, null, null))
.Width(80);
})
.DetailView(detailView => detailView.ClientTemplate("<#= Overview #> <#= Path #>
"))
.Footer(true)
.DataBinding(
d =>
d.Ajax().Select("_AjaxSeasonGrid", "Series",
new RouteValueDictionary { { "seriesId", Model.SeriesId }, { "seasonNumber", season } }))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
clientEvents.OnDataBound("grid_dataBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
.Sortable(sorting => sorting
.OrderBy(sortOrder => sortOrder.Add(o => o.EpisodeNumber).Descending()).SortMode(GridSortMode.SingleColumn))
.Render();
}
@section Scripts{
@Html.IncludeScript("NzbDrone/seriesDetails.js")
}