From 1fca5f3e5f1c6c1ff6ae34ad4b59f22302d1b887 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 19 May 2011 08:08:00 -0700 Subject: [PATCH] Series Details updated with overlay when loading. --- NzbDrone.Web/NzbDrone.Web.csproj | 1 + NzbDrone.Web/Views/Series/Details.cshtml | 114 +++++++++++++---------- 2 files changed, 68 insertions(+), 47 deletions(-) diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index c724f2bd6..b32615548 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -577,6 +577,7 @@ + diff --git a/NzbDrone.Web/Views/Series/Details.cshtml b/NzbDrone.Web/Views/Series/Details.cshtml index 88722f824..c1046493c 100644 --- a/NzbDrone.Web/Views/Series/Details.cshtml +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -58,60 +58,72 @@ {
-

- Season @season.SeasonNumber

- Season season1 = season; - Html.Telerik().Grid().Name("seasons_" + season.SeasonNumber) - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(o => o.EpisodeId) - .ClientTemplate( - "") - .Title("") - .Width(1) - .HtmlAttributes(new { style = "text-align:center" }); +

Season @season.SeasonNumber

+
+ @{Season season1 = season; + Html.Telerik().Grid().Name("seasons_" + season.SeasonNumber) + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(o => o.EpisodeId) + .ClientTemplate( + "") + .Title("") + .Width(1) + .HtmlAttributes(new { style = "text-align:center" }); - columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode"); - columns.Bound(c => c.Title).Title("Title").Width(300); - columns.Bound(c => c.AirDate).Format("{0:d}").Width(10); - columns.Bound(c => c.Quality).Width(10); - columns.Bound(c => c.Path); - }) - //.DetailView(detailView => detailView.Template(e => Html.RenderPartial("EpisodeDetail", e))) - .DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
<#= Path #>
")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true)) - .Footer(false) - .DataBinding( - d => - d.Ajax().Select("_AjaxSeasonGrid", "Series", - new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } })) - //.EnableCustomBinding(true) - //.ClientEvents(e => e.OnDetailViewExpand("episodeDetailExpanded")) //Causes issues displaying the episode detail multiple times... - .ToolBar( - c => - c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season1.SeasonId }) - .ButtonType(GridButtonType.Text)) - .Render(); + columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode"); + columns.Bound(c => c.Title).Title("Title").Width(300); + columns.Bound(c => c.AirDate).Format("{0:d}").Width(10); + columns.Bound(c => c.Quality).Width(10); + columns.Bound(c => c.Path); + }) + .DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
<#= Path #>
")) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true)) + .Footer(false) + .DataBinding( + d => + d.Ajax().Select("_AjaxSeasonGrid", "Series", + new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } })) + .ToolBar( + c => + c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season1.SeasonId }) + .ButtonType(GridButtonType.Text)) + .Render();} + Loading Loading... +
} @{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();} @if (specialSeasons != null) {
-

- Specials

- Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); - columns.Bound(c => c.Title); - columns.Bound(c => c.AirDate).Format("{0:d}").Width(0); - }) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber)).Enabled(false)) - .Footer(false) - .Render(); +

Specials

+
+ @{Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials") + .TableHtmlAttributes(new {@class = "Grid"}) + .Columns(columns => + { + columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); + columns.Bound(c => c.Title); + columns.Bound(c => c.AirDate).Format("{0:d}").Width(0); + }) + //.DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
<#= Path #>
")) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber)).Enabled(false)) + .Footer(false) + .Render(); } + Loading Loading... +
} } @section Scripts{ @@ -119,5 +131,13 @@ function episodeDetailExpanded(e) { $console.log("OnDetailViewExpand :: " + e.masterRow.cells[1].innerHTML); } + + function grid_bind(args) { + $('.grid-container').children('.grid-loader').stop().css("top", "0px").fadeIn('slow'); + } + + function grid_bound(args) { + $('.grid-container').children('.grid-loader').stop().fadeOut('slow'); + } }