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/4/head
Mark McDowall 14 years ago
parent 6c818bd8d8
commit 7a57ab98dc

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

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

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

@ -47,9 +47,11 @@
columns.Bound(c => c.Date).Title("Date Grabbed").Width(60);
})
.DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" +
"<div><b>Overview: </b><#= EpisodeOverview #></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"))

@ -31,6 +31,8 @@
<div id="menu">
<ul>
<%: 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("Logs", "Index", "Log"))%>
</ul>

@ -31,23 +31,29 @@
<%
Html.Telerik().Menu().Name("historyMenu").Items(items =>
{
items.Add().Text("Trim History").Action("Trim", "History");
items.Add().Text("Purge History").Action("Purge", "History");
items.Add().Text("Start RSS Sync").Action("RssSync", "Series");
}).Render();
%>
</asp:Content>
<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")
.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.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
})
.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"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -56,18 +62,27 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();
%>
</div>
<br />
<div id="today">
<h2>Today</h2>
<%Html.Telerik().Grid<UpcomingEpisodeModel>().Name("Today").NoRecordsTemplate("No watched shows airing today.")
.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.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
})
.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"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -76,18 +91,27 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.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...")
.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.EpisodeNumber).Title("Episode #").Width(40);
columns.Bound(c => c.Title).Title("Episode Title").Width(120);
columns.Bound(c => c.AirDate).Title("Air Date").Width(0);
})
.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"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDate).Ascending()).Enabled(true))
@ -96,4 +120,5 @@
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();
%>
</div>
</asp:Content>

Loading…
Cancel
Save