Added filtering to the missing View.

pull/4/head
Mark McDowall 14 years ago
parent 0f170e8a03
commit 7b4ac03748

@ -29,7 +29,7 @@ namespace NzbDrone.Web.Controllers
//TODO: possible subsonic bug, IQuarible causes some issues so ToList() is called //TODO: possible subsonic bug, IQuarible causes some issues so ToList() is called
//https://github.com/subsonic/SubSonic-3.0/issues/263 //https://github.com/subsonic/SubSonic-3.0/issues/263
var missing = _episodeProvider.EpisodesWithoutFiles(false).Select(e => new MissingEpisodeModel var missing = _episodeProvider.EpisodesWithoutFiles(true).Select(e => new MissingEpisodeModel
{ {
EpisodeId = e.EpisodeId, EpisodeId = e.EpisodeId,
SeasonNumber = e.SeasonNumber, SeasonNumber = e.SeasonNumber,

@ -1,16 +1,22 @@
@model List<MissingEpisodeModel> @model List<MissingEpisodeModel>
@using NzbDrone.Web.Models; @using NzbDrone.Web.Models;
@section TitleContent{
Missing
}
@section MainContent{ @section MainContent{
@{Html.Telerik().Grid<MissingEpisodeModel>().Name("missing") @{Html.Telerik().Grid<MissingEpisodeModel>().Name("missing")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesTitle).Title("Series Name"); columns.Bound(c => c.SeriesTitle).Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season").Width(1); columns.Bound(c => c.SeasonNumber).Title("Season").Width(40);
columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1); columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(40);
columns.Bound(c => c.EpisodeTitle).Title("Episode Title"); columns.Bound(c => c.EpisodeTitle).Title("Episode Title");
columns.Bound(c => c.AirDate).Title("Air Date").Width(50); columns.Bound(c => c.AirDate).Format("{0:d}")
.Title("Air Date")
.Width(80);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +
@ -19,10 +25,12 @@
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBinding", "Missing")) .DataBinding(data => data.Ajax().Select("_AjaxBinding", "Missing"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Descending()).Enabled(true)) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Descending()).Enabled(true))
.Filterable(filtering => filtering
.Filters(filters => filters
.Add(o => o.SeasonNumber).IsGreaterThan(0)))
.Pageable( .Pageable(
c => c =>
c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious)) c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
//.Filterable()
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();} .Render();}
} }
Loading…
Cancel
Save