Merge branch 'markus101'

pull/4/head
kay.one 14 years ago
commit 7d7b37be5b

@ -588,6 +588,7 @@
<Content Include="Content\Images\Indexers\Unknown.png"> <Content Include="Content\Images\Indexers\Unknown.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Images\Loading.gif" />
<Content Include="Content\Images\Plus.png" /> <Content Include="Content\Images\Plus.png" />
<Content Include="Content\Images\spin.gif" /> <Content Include="Content\Images\spin.gif" />
<Content Include="Content\Images\ui-bg_diagonals-small_0_aaaaaa_40x40.png" /> <Content Include="Content\Images\ui-bg_diagonals-small_0_aaaaaa_40x40.png" />

@ -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');
}

@ -11,34 +11,37 @@ History
}).Render();} }).Render();}
} }
@section MainContent{ @section MainContent{
@{Html.Telerik().Grid<HistoryModel>().Name("history") <div class="grid-container">
.TableHtmlAttributes(new { @class = "Grid" }) @{Html.Telerik().Grid<HistoryModel>().Name("history")
.Columns(columns => .TableHtmlAttributes(new { @class = "Grid" })
{ .Columns(columns =>
columns.Bound(c => c.Indexer) {
.ClientTemplate("<center><img alt='<#= Indexer #>' src='" + Url.Content("~/Content/Images/Indexers/") + "<#= Indexer #>.png' /></center>") columns.Bound(c => c.Indexer)
.Title("") .ClientTemplate("<center><img alt='<#= Indexer #>' src='" + Url.Content("~/Content/Images/Indexers/") + "<#= Indexer #>.png' /></center>")
.Width(20); .Title("")
columns.Bound(c => c.SeriesTitle).Title("Series Name"); .Width(20);
columns.Bound(c => c.SeasonNumber).Title("Season").Width(1); columns.Bound(c => c.SeriesTitle).Title("Series Name");
columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1); columns.Bound(c => c.SeasonNumber).Title("Season").Width(1);
columns.Bound(c => c.EpisodeTitle).Title("Episode Title"); columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1);
columns.Bound(c => c.Quality).Title("Quality").Width(50); columns.Bound(c => c.EpisodeTitle).Title("Episode Title");
columns.Bound(c => c.Date).Title("Grabbed on"); columns.Bound(c => c.Quality).Title("Quality").Width(50);
}) columns.Bound(c => c.Date).Title("Grabbed on");
.DetailView(detailView => detailView.ClientTemplate( })
"<fieldset>" + .DetailView(detailView => detailView.ClientTemplate(
"<div><b>Overview: </b><#= EpisodeOverview #></div>" + "<fieldset>" +
"<div><b>NZB Title: </b><#= NzbTitle #></div>" + "<div><b>Overview: </b><#= EpisodeOverview #></div>" +
"<div><b>Proper: </b><#= IsProper #></div>" + "<div><b>NZB Title: </b><#= NzbTitle #></div>" +
"</fieldset>" "<div><b>Proper: </b><#= IsProper #></div>" +
)) "</fieldset>"
.DataBinding(data => data.Ajax().Select("_AjaxBinding", "History")) ))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Date).Descending()).Enabled(true)) .DataBinding(data => data.Ajax().Select("_AjaxBinding", "History"))
.Pageable( .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Date).Descending()).Enabled(true))
c => .Pageable(
c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) c =>
//.Filterable() c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) //.Filterable()
.Render();} //.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
} }

@ -58,60 +58,72 @@
{ {
<br /> <br />
<h3> <h3>Season @season.SeasonNumber</h3>
Season @season.SeasonNumber</h3> <div class="grid-container">
Season season1 = season; @{Season season1 = season;
Html.Telerik().Grid<EpisodeModel>().Name("seasons_" + season.SeasonNumber) Html.Telerik().Grid<EpisodeModel>().Name("seasons_" + season.SeasonNumber)
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(o => o.EpisodeId) columns.Bound(o => o.EpisodeId)
.ClientTemplate( .ClientTemplate(
"<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />") "<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />")
.Title("") .Title("")
.Width(1) .Width(1)
.HtmlAttributes(new { style = "text-align:center" }); .HtmlAttributes(new { style = "text-align:center" });
columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode"); columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode");
columns.Bound(c => c.Title).Title("Title").Width(300); columns.Bound(c => c.Title).Title("Title").Width(300);
columns.Bound(c => c.AirDate).Format("{0:d}").Width(10); columns.Bound(c => c.AirDate).Format("{0:d}").Width(10);
columns.Bound(c => c.Quality).Width(10); columns.Bound(c => c.Quality).Width(10);
columns.Bound(c => c.Path); columns.Bound(c => c.Path);
}) })
//.DetailView(detailView => detailView.Template(e => Html.RenderPartial("EpisodeDetail", e))) .DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>")) .ClientEvents(clientEvents =>
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true)) {
.Footer(false) clientEvents.OnDataBinding("grid_bind");
.DataBinding( clientEvents.OnDataBound("grid_bound");
d => })
d.Ajax().Select("_AjaxSeasonGrid", "Series", .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true))
new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } })) .Footer(true)
//.EnableCustomBinding(true) .DataBinding(
//.ClientEvents(e => e.OnDetailViewExpand("episodeDetailExpanded")) //Causes issues displaying the episode detail multiple times... d =>
.ToolBar( d.Ajax().Select("_AjaxSeasonGrid", "Series",
c => new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } }))
c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season1.SeasonId }) .ToolBar(
.ButtonType(GridButtonType.Text)) c =>
.Render(); c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season1.SeasonId })
.ButtonType(GridButtonType.Text))
.Render();}
<span class="grid-loader"><img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/> Loading...</span>
</div>
} }
@{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();} @{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();}
@if (specialSeasons != null) @if (specialSeasons != null)
{ {
<br /> <br />
<h3> <h3>Specials</h3>
Specials</h3> <div class="grid-container">
Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials") @{Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new {@class = "Grid"})
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
columns.Bound(c => c.Title); columns.Bound(c => c.Title);
columns.Bound(c => c.AirDate).Format("{0:d}").Width(0); columns.Bound(c => c.AirDate).Format("{0:d}").Width(0);
}) })
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber)).Enabled(false)) //.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.Footer(false) .ClientEvents(clientEvents =>
.Render(); {
clientEvents.OnDataBinding("grid_bind");
clientEvents.OnDataBound("grid_bound");
})
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber)).Enabled(false))
.Footer(false)
.Render(); }
<span class="grid-loader"><img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/> Loading...</span>
</div>
} }
} }
@section Scripts{ @section Scripts{

@ -60,14 +60,6 @@
.center(); .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) { function openSeasonEditor(seriesId, seriesName) {
windowElement = null; windowElement = null;
windowElement = $.telerik.window.create({ windowElement = $.telerik.window.create({

@ -49,6 +49,7 @@
.Add("Notification.js") .Add("Notification.js")
.Add("jquery-tgc-countdown-1.0.js") .Add("jquery-tgc-countdown-1.0.js")
.Add("MicrosoftAjax.js") .Add("MicrosoftAjax.js")
.Add("MicrosoftMvcValidation.js")) .Add("MicrosoftMvcValidation.js")
.Add("gridLoad.js"))
.Render();} .Render();}
</html> </html>

@ -9,116 +9,144 @@ Upcoming
} }
@section MainContent{ @section MainContent{
<div id="yesterday"> <div id="yesterday">
<h2> <h2>Yesterday</h2>
Yesterday</h2> <div class="grid-container">
@{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Yesterday").NoRecordsTemplate( @{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Yesterday").NoRecordsTemplate(
"No watched shows aired yesterday") "No watched shows aired yesterday")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName) columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + .ClientTemplate("<a href=" +
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
"><#= SeriesName #></a>") "><#= SeriesName #></a>")
.Title("Series Name"); .Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40);
columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title"); columns.Bound(c => c.Title).Title("Episode Title");
columns.Bound(c => c.AirDate).Title("Air Date").Width(160); columns.Bound(c => c.AirDate).Title("Air Date").Width(160);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" + "<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>" "</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingYesterday", "Upcoming")) .ClientEvents(clientEvents =>
.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)) clientEvents.OnDataBinding("grid_bind");
//.Filterable() clientEvents.OnDataBound("grid_bound");
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) })
.Render();} .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();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
</div> </div>
<br /> <br />
<div id="today"> <div id="today">
<h2> <h2>Today</h2>
Today</h2> <div class="grid-container">
@{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Today").NoRecordsTemplate("No watched shows airing today.") @{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Today").NoRecordsTemplate("No watched shows airing today.")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName) columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + .ClientTemplate("<a href=" +
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
"><#= SeriesName #></a>") "><#= SeriesName #></a>")
.Title("Series Name"); .Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40);
columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title"); columns.Bound(c => c.Title).Title("Episode Title");
columns.Bound(c => c.AirDate).Title("Air Date").Width(160); columns.Bound(c => c.AirDate).Title("Air Date").Width(160);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" + "<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>" "</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingToday", "Upcoming")) .ClientEvents(clientEvents =>
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) {
.Render();} 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();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
</div> </div>
<br /> <br />
<div id="tomorrow"> <div id="tomorrow">
<h2> <h2>Tomorrow</h2>
Tomorrow</h2> <div class="grid-container">
@{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Tomorrow").NoRecordsTemplate( @{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Tomorrow").NoRecordsTemplate(
"No watched shows airing tomorrow") "No watched shows airing tomorrow")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName) columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + .ClientTemplate("<a href=" +
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
"><#= SeriesName #></a>") "><#= SeriesName #></a>")
.Title("Series Name"); .Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40);
columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title"); columns.Bound(c => c.Title).Title("Episode Title");
columns.Bound(c => c.AirDate).Title("Air Date").Width(160); columns.Bound(c => c.AirDate).Title("Air Date").Width(160);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" + "<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>" "</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingTomorrow", "Upcoming")) .ClientEvents(clientEvents =>
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) {
.Render();} 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();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
</div> </div>
<br /> <br />
<div id="week"> <div id="week">
<h2> <h2>Future Forecast</h2>
Future Forecast</h2> <div class="grid-container">
@{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Week").NoRecordsTemplate( @{Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Week").NoRecordsTemplate(
"No watched shows airing in the next week...") "No watched shows airing in the next week...")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName) columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + .ClientTemplate("<a href=" +
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
"><#= SeriesName #></a>") "><#= SeriesName #></a>")
.Title("Series Name"); .Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40); columns.Bound(c => c.SeasonNumber).Title("Season #").Width(40);
columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40); columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title"); columns.Bound(c => c.Title).Title("Episode Title");
columns.Bound(c => c.AirDate).Title("Air Date").Width(160); columns.Bound(c => c.AirDate).Title("Air Date").Width(160);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" + "<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>" "</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingWeek", "Upcoming")) .ClientEvents(clientEvents =>
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) {
.Render();} 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();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
</div> </div>
} }

Loading…
Cancel
Save