Added quality to Series detail view

This commit is contained in:
kay.one 2011-03-30 19:56:00 -07:00
parent d310c06f2e
commit 79a0f09b43
3 changed files with 15 additions and 8 deletions

View File

@ -9,6 +9,7 @@ using System.Web.Mvc;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Repository.Quality;
using NzbDrone.Web.Models;
using Telerik.Web.Mvc;
using TvdbLib.Data;
@ -138,7 +139,9 @@ namespace NzbDrone.Web.Controllers
Title = c.Title,
Overview = c.Overview,
AirDate = c.AirDate,
Path = GetEpisodePath(c.EpisodeFile)
Path = GetEpisodePath(c.EpisodeFile),
Quality = c.EpisodeFile == null ? String.Empty : c.EpisodeFile.Quality.ToString()
});
return View(new GridModel(episodes));
}

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Web.Models
{
@ -14,5 +15,7 @@ namespace NzbDrone.Web.Models
public string Overview { get; set; }
public string Path { get; set; }
public DateTime AirDate { get; set; }
public String Quality { get; set; }
}
}

View File

@ -66,13 +66,14 @@
.Width(1)
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode");
columns.Bound(c => c.Title).Title("Title");
columns.Bound(c => c.AirDate).Format("{0:d}").Width(0);
columns.Bound(c => c.Quality);
columns.Bound(c => c.Path);
})
//.DetailView(detailView => detailView.Template(e => Html.RenderPartial("EpisodeDetail", e)))
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #></div>"))
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.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() } }))