Added upcoming and history links to main menu.

Made Upcoming look a bit better, still needs work.
Wrapped Details in Upcoming/History in fieldset
pull/2/head
Mark McDowall 14 years ago
parent 6c818bd8d8
commit 7a57ab98dc

@ -488,7 +488,7 @@ div.t-window-content {
border-width: 0 1px 1px 0; border-width: 0 1px 1px 0;
font-weight: normal; font-weight: normal;
overflow: hidden; overflow: hidden;
padding: 0.3em 0.3em; padding: 0.3em 0.6em;
white-space: nowrap; white-space: nowrap;
} }
.t-grid-header .t-last-header { .t-grid-header .t-last-header {
@ -500,7 +500,7 @@ div.t-window-content {
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
margin: -0.3em -0.6em; margin: -0.3em -0.6em;
padding: 0.3em 0.3em 0.3em 0.6em; padding: 0.3em 2.4em 0.3em 0.6em;
} }
.t-grid-header .t-header .t-icon { .t-grid-header .t-header .t-icon {
position: static; position: static;

@ -31,6 +31,7 @@ namespace NzbDrone.Web.Controllers
{ {
var upcoming = _upcomingEpisodesProvider.Yesterday().Select(e => new UpcomingEpisodeModel var upcoming = _upcomingEpisodesProvider.Yesterday().Select(e => new UpcomingEpisodeModel
{ {
SeriesId = e.Series.SeriesId,
SeriesName = e.Series.Title, SeriesName = e.Series.Title,
SeasonNumber = e.SeasonNumber, SeasonNumber = e.SeasonNumber,
EpisodeNumber = e.EpisodeNumber, EpisodeNumber = e.EpisodeNumber,
@ -47,6 +48,7 @@ namespace NzbDrone.Web.Controllers
{ {
var upcoming = _upcomingEpisodesProvider.Today().Select(e => new UpcomingEpisodeModel var upcoming = _upcomingEpisodesProvider.Today().Select(e => new UpcomingEpisodeModel
{ {
SeriesId = e.Series.SeriesId,
SeriesName = e.Series.Title, SeriesName = e.Series.Title,
SeasonNumber = e.SeasonNumber, SeasonNumber = e.SeasonNumber,
EpisodeNumber = e.EpisodeNumber, EpisodeNumber = e.EpisodeNumber,
@ -63,6 +65,7 @@ namespace NzbDrone.Web.Controllers
{ {
var upcoming = _upcomingEpisodesProvider.Week().Select(e => new UpcomingEpisodeModel var upcoming = _upcomingEpisodesProvider.Week().Select(e => new UpcomingEpisodeModel
{ {
SeriesId = e.Series.SeriesId,
SeriesName = e.Series.Title, SeriesName = e.Series.Title,
SeasonNumber = e.SeasonNumber, SeasonNumber = e.SeasonNumber,
EpisodeNumber = e.EpisodeNumber, EpisodeNumber = e.EpisodeNumber,

@ -7,6 +7,7 @@ namespace NzbDrone.Web.Models
{ {
public class UpcomingEpisodeModel public class UpcomingEpisodeModel
{ {
public int SeriesId { get; set; }
public string SeriesName { get; set; } public string SeriesName { get; set; }
public int SeasonNumber { get; set; } public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; } public int EpisodeNumber { get; set; }

@ -47,9 +47,11 @@
columns.Bound(c => c.Date).Title("Date Grabbed").Width(60); columns.Bound(c => c.Date).Title("Date Grabbed").Width(60);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" +
"<div><b>Overview: </b><#= EpisodeOverview #></div>" + "<div><b>Overview: </b><#= EpisodeOverview #></div>" +
"<div><b>NZB Title: </b><#= NzbTitle #></div>" + "<div><b>NZB Title: </b><#= NzbTitle #></div>" +
"<div><b>Proper: </b><#= IsProper #></div>" "<div><b>Proper: </b><#= IsProper #></div>" +
"</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBinding", "History")) .DataBinding(data => data.Ajax().Select("_AjaxBinding", "History"))

@ -31,6 +31,8 @@
<div id="menu"> <div id="menu">
<ul> <ul>
<%: MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series")) %> <%: MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series")) %>
<%: MvcHtmlString.Create(Html.CurrentActionLink("Upcoming", "Index", "Upcoming")) %>
<%: MvcHtmlString.Create(Html.CurrentActionLink("History", "Index", "History")) %>
<%: MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings"))%> <%: MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings"))%>
<%: MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))%> <%: MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))%>
</ul> </ul>

@ -31,23 +31,29 @@
<% <%
Html.Telerik().Menu().Name("historyMenu").Items(items => Html.Telerik().Menu().Name("historyMenu").Items(items =>
{ {
items.Add().Text("Trim History").Action("Trim", "History"); items.Add().Text("Start RSS Sync").Action("RssSync", "Series");
items.Add().Text("Purge History").Action("Purge", "History");
}).Render(); }).Render();
%> %>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<div id="yesterday">
<h2>Yesterday</h2>
<%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Yesterday").NoRecordsTemplate("No watched shows aired yesterday") <%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Yesterday").NoRecordsTemplate("No watched shows aired yesterday")
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName).Title("Series Name").Width(110); columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + "><#= SeriesName #></a>")
.Title("Series Name").Width(110);
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").Width(120); columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0); columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<div><b>Overview: </b><#= Overview #></div>" "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingYesterday", "Upcoming")) .DataBinding(data => data.Ajax().Select("_AjaxBindingYesterday", "Upcoming"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -56,18 +62,27 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) //.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render(); .Render();
%> %>
</div>
<br />
<div id="today">
<h2>Today</h2>
<%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Today").NoRecordsTemplate("No watched shows airing today.") <%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Today").NoRecordsTemplate("No watched shows airing today.")
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName).Title("Series Name").Width(110); columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + "><#= SeriesName #></a>")
.Title("Series Name").Width(110);
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").Width(120); columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0); columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<div><b>Overview: </b><#= Overview #></div>" "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingToday", "Upcoming")) .DataBinding(data => data.Ajax().Select("_AjaxBindingToday", "Upcoming"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -76,18 +91,27 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) //.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render(); .Render();
%> %>
</div>
<br />
<div id="week">
<h2>7-Day Forecast</h2>
<%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Week").NoRecordsTemplate("No watched shows airing in the next week...") <%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Week").NoRecordsTemplate("No watched shows airing in the next week...")
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesName).Title("Series Name").Width(110); columns.Bound(c => c.SeriesName)
.ClientTemplate("<a href=" + Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) + "><#= SeriesName #></a>")
.Title("Series Name").Width(110);
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").Width(120); columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0); columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<div><b>Overview: </b><#= Overview #></div>" "<fieldset>" +
"<div><b>Overview: </b><#= Overview #></div>" +
"</fieldset>"
)) ))
.DataBinding(data => data.Ajax().Select("_AjaxBindingWeek", "Upcoming")) .DataBinding(data => data.Ajax().Select("_AjaxBindingWeek", "Upcoming"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true)) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -96,4 +120,5 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) //.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render(); .Render();
%> %>
</div>
</asp:Content> </asp:Content>

Loading…
Cancel
Save