diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 2c939cc5a..267090a0f 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -588,6 +588,7 @@ Always + diff --git a/NzbDrone.Web/Scripts/gridLoad.js b/NzbDrone.Web/Scripts/gridLoad.js new file mode 100644 index 000000000..1fe5c40c5 --- /dev/null +++ b/NzbDrone.Web/Scripts/gridLoad.js @@ -0,0 +1,11 @@ +function grid_bind(args) { + var id = this.attributes[0].textContent; + var parent = $('#' + id).parent(); + parent.children('.grid-loader').stop().css("top", "0px").fadeIn('slow'); +} + +function grid_bound(args) { + var id = this.attributes[0].textContent; + var parent = $('#' + id).parent(); + $('.grid-container').children('.grid-loader').stop().fadeOut('slow'); +} \ No newline at end of file diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index 16aed6ffc..707381460 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -11,34 +11,37 @@ History }).Render();} } @section MainContent{ - @{Html.Telerik().Grid().Name("history") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.Indexer) - .ClientTemplate("
<#= Indexer #>
") - .Title("") - .Width(20); - columns.Bound(c => c.SeriesTitle).Title("Series Name"); - columns.Bound(c => c.SeasonNumber).Title("Season").Width(1); - columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1); - columns.Bound(c => c.EpisodeTitle).Title("Episode Title"); - columns.Bound(c => c.Quality).Title("Quality").Width(50); - columns.Bound(c => c.Date).Title("Grabbed on"); - }) - .DetailView(detailView => detailView.ClientTemplate( - "
" + - "
Overview: <#= EpisodeOverview #>
" + - "
NZB Title: <#= NzbTitle #>
" + - "
Proper: <#= IsProper #>
" + - "
" - )) - .DataBinding(data => data.Ajax().Select("_AjaxBinding", "History")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Date).Descending()).Enabled(true)) - .Pageable( - c => - c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) - //.Filterable() - //.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) - .Render();} +
+ @{Html.Telerik().Grid().Name("history") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(c => c.Indexer) + .ClientTemplate("
<#= Indexer #>
") + .Title("") + .Width(20); + columns.Bound(c => c.SeriesTitle).Title("Series Name"); + columns.Bound(c => c.SeasonNumber).Title("Season").Width(1); + columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1); + columns.Bound(c => c.EpisodeTitle).Title("Episode Title"); + columns.Bound(c => c.Quality).Title("Quality").Width(50); + columns.Bound(c => c.Date).Title("Grabbed on"); + }) + .DetailView(detailView => detailView.ClientTemplate( + "
" + + "
Overview: <#= EpisodeOverview #>
" + + "
NZB Title: <#= NzbTitle #>
" + + "
Proper: <#= IsProper #>
" + + "
" + )) + .DataBinding(data => data.Ajax().Select("_AjaxBinding", "History")) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Date).Descending()).Enabled(true)) + .Pageable( + c => + c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) + //.Filterable() + //.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) + .Render();} + Loading Loading... +
} diff --git a/NzbDrone.Web/Views/Series/Details.cshtml b/NzbDrone.Web/Views/Series/Details.cshtml index c1046493c..1e32134de 100644 --- a/NzbDrone.Web/Views/Series/Details.cshtml +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -85,7 +85,7 @@ clientEvents.OnDataBound("grid_bound"); }) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true)) - .Footer(false) + .Footer(true) .DataBinding( d => d.Ajax().Select("_AjaxSeasonGrid", "Series", @@ -131,13 +131,5 @@ 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'); - } } diff --git a/NzbDrone.Web/Views/Series/Index.cshtml b/NzbDrone.Web/Views/Series/Index.cshtml index 84ed0c13e..5dea9dc03 100644 --- a/NzbDrone.Web/Views/Series/Index.cshtml +++ b/NzbDrone.Web/Views/Series/Index.cshtml @@ -60,14 +60,6 @@ .center(); } - 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'); - } - function openSeasonEditor(seriesId, seriesName) { windowElement = null; windowElement = $.telerik.window.create({ diff --git a/NzbDrone.Web/Views/Shared/SiteLayout.cshtml b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml index a40680b7f..abf64dce5 100644 --- a/NzbDrone.Web/Views/Shared/SiteLayout.cshtml +++ b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml @@ -49,6 +49,7 @@ .Add("Notification.js") .Add("jquery-tgc-countdown-1.0.js") .Add("MicrosoftAjax.js") - .Add("MicrosoftMvcValidation.js")) + .Add("MicrosoftMvcValidation.js") + .Add("gridLoad.js")) .Render();} diff --git a/NzbDrone.Web/Views/Upcoming/Index.cshtml b/NzbDrone.Web/Views/Upcoming/Index.cshtml index 609f0dd5b..c1e6a44cb 100644 --- a/NzbDrone.Web/Views/Upcoming/Index.cshtml +++ b/NzbDrone.Web/Views/Upcoming/Index.cshtml @@ -9,116 +9,144 @@ Upcoming } @section MainContent{
-

- Yesterday

- @{Html.Telerik().Grid().Name("Yesterday").NoRecordsTemplate( - "No watched shows aired yesterday") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.SeriesName) - .ClientTemplate("<#= SeriesName #>") - .Title("Series Name"); - columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); - columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); - columns.Bound(c => c.Title).Title("Episode Title"); - columns.Bound(c => c.AirDate).Title("Air Date").Width(160); - }) - .DetailView(detailView => detailView.ClientTemplate( - "
" + - "
Overview: <#= Overview #>
" + - "
" - )) - .DataBinding(data => data.Ajax().Select("_AjaxBindingYesterday", "Upcoming")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) - //.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric)) - //.Filterable() - //.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) - .Render();} +

Yesterday

+
+ @{Html.Telerik().Grid().Name("Yesterday").NoRecordsTemplate( + "No watched shows aired yesterday") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(c => c.SeriesName) + .ClientTemplate("<#= SeriesName #>") + .Title("Series Name"); + columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); + columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); + columns.Bound(c => c.Title).Title("Episode Title"); + columns.Bound(c => c.AirDate).Title("Air Date").Width(160); + }) + .DetailView(detailView => detailView.ClientTemplate( + "
" + + "
Overview: <#= Overview #>
" + + "
" + )) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .DataBinding(data => data.Ajax().Select("_AjaxBindingYesterday", "Upcoming")) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) + //.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric)) + //.Filterable() + //.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) + .Render();} + Loading Loading... +

-

- Today

- @{Html.Telerik().Grid().Name("Today").NoRecordsTemplate("No watched shows airing today.") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.SeriesName) - .ClientTemplate("<#= SeriesName #>") - .Title("Series Name"); - columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); - columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); - columns.Bound(c => c.Title).Title("Episode Title"); - columns.Bound(c => c.AirDate).Title("Air Date").Width(160); - }) - .DetailView(detailView => detailView.ClientTemplate( - "
" + - "
Overview: <#= Overview #>
" + - "
" - )) - .DataBinding(data => data.Ajax().Select("_AjaxBindingToday", "Upcoming")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) - .Render();} +

Today

+
+ @{Html.Telerik().Grid().Name("Today").NoRecordsTemplate("No watched shows airing today.") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(c => c.SeriesName) + .ClientTemplate("<#= SeriesName #>") + .Title("Series Name"); + columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); + columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); + columns.Bound(c => c.Title).Title("Episode Title"); + columns.Bound(c => c.AirDate).Title("Air Date").Width(160); + }) + .DetailView(detailView => detailView.ClientTemplate( + "
" + + "
Overview: <#= Overview #>
" + + "
" + )) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .DataBinding(data => data.Ajax().Select("_AjaxBindingToday", "Upcoming")) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) + .Render();} + Loading Loading... +

-

- Tomorrow

- @{Html.Telerik().Grid().Name("Tomorrow").NoRecordsTemplate( - "No watched shows airing tomorrow") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.SeriesName) - .ClientTemplate("<#= SeriesName #>") - .Title("Series Name"); - columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); - columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); - columns.Bound(c => c.Title).Title("Episode Title"); - columns.Bound(c => c.AirDate).Title("Air Date").Width(160); - }) - .DetailView(detailView => detailView.ClientTemplate( - "
" + - "
Overview: <#= Overview #>
" + - "
" - )) - .DataBinding(data => data.Ajax().Select("_AjaxBindingTomorrow", "Upcoming")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) - .Render();} +

Tomorrow

+
+ @{Html.Telerik().Grid().Name("Tomorrow").NoRecordsTemplate( + "No watched shows airing tomorrow") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(c => c.SeriesName) + .ClientTemplate("<#= SeriesName #>") + .Title("Series Name"); + columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); + columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); + columns.Bound(c => c.Title).Title("Episode Title"); + columns.Bound(c => c.AirDate).Title("Air Date").Width(160); + }) + .DetailView(detailView => detailView.ClientTemplate( + "
" + + "
Overview: <#= Overview #>
" + + "
" + )) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .DataBinding(data => data.Ajax().Select("_AjaxBindingTomorrow", "Upcoming")) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) + .Render();} + Loading Loading... +

-

- Future Forecast

- @{Html.Telerik().Grid().Name("Week").NoRecordsTemplate( - "No watched shows airing in the next week...") - .TableHtmlAttributes(new { @class = "Grid" }) - .Columns(columns => - { - columns.Bound(c => c.SeriesName) - .ClientTemplate("<#= SeriesName #>") - .Title("Series Name"); - columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); - columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); - columns.Bound(c => c.Title).Title("Episode Title"); - columns.Bound(c => c.AirDate).Title("Air Date").Width(160); - }) - .DetailView(detailView => detailView.ClientTemplate( - "
" + - "
Overview: <#= Overview #>
" + - "
" - )) - .DataBinding(data => data.Ajax().Select("_AjaxBindingWeek", "Upcoming")) - .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) - .Render();} +

Future Forecast

+
+ @{Html.Telerik().Grid().Name("Week").NoRecordsTemplate( + "No watched shows airing in the next week...") + .TableHtmlAttributes(new { @class = "Grid" }) + .Columns(columns => + { + columns.Bound(c => c.SeriesName) + .ClientTemplate("<#= SeriesName #>") + .Title("Series Name"); + columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); + columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); + columns.Bound(c => c.Title).Title("Episode Title"); + columns.Bound(c => c.AirDate).Title("Air Date").Width(160); + }) + .DetailView(detailView => detailView.ClientTemplate( + "
" + + "
Overview: <#= Overview #>
" + + "
" + )) + .ClientEvents(clientEvents => + { + clientEvents.OnDataBinding("grid_bind"); + clientEvents.OnDataBound("grid_bound"); + }) + .DataBinding(data => data.Ajax().Select("_AjaxBindingWeek", "Upcoming")) + .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) + .Render();} + Loading Loading... +
}