1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

fixed column layout in history, upcomming

This commit is contained in:
kay.one 2011-04-25 13:32:29 -07:00
parent b65fe99b30
commit 7d20558ea2
2 changed files with 24 additions and 75 deletions

View File

@ -1,25 +1,5 @@
@model List<NzbDrone.Web.Models.HistoryModel> @model List<NzbDrone.Web.Models.HistoryModel>
@using NzbDrone.Web.Models @using NzbDrone.Web.Models
@section Scripts{
<script type="text/javascript">
function onRowDataBound(e) {
e.row.style.boarder = "";
if (e.dataItem.Level == 3) {
e.row.style.backgroundColor = "#FFD700";
}
else if (e.dataItem.Level == 4) {
e.row.style.backgroundColor = "#FF7500";
}
else if (e.dataItem.Level == 5) {
e.row.style.backgroundColor = "black";
e.row.style.color = "red";
}
//e.row.style.color = 'blue';
}
</script>
}
@section TitleContent{ @section TitleContent{
History History
} }
@ -35,12 +15,12 @@ History
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns => .Columns(columns =>
{ {
columns.Bound(c => c.SeriesTitle).Title("Series Name").Width(120); columns.Bound(c => c.SeriesTitle).Title("Series Name");
columns.Bound(c => c.SeasonNumber).Title("Season").Width(10); columns.Bound(c => c.SeasonNumber).Title("Season").Width(1);
columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(10); columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1);
columns.Bound(c => c.EpisodeTitle).Title("Episode Title"); columns.Bound(c => c.EpisodeTitle).Title("Episode Title");
columns.Bound(c => c.Quality).Title("Quality").Width(10); columns.Bound(c => c.Quality).Title("Quality").Width(10);
columns.Bound(c => c.Date).Title("Date/Time Grabbed"); columns.Bound(c => c.Date).Title("Grabbed on");
}) })
.DetailView(detailView => detailView.ClientTemplate( .DetailView(detailView => detailView.ClientTemplate(
"<fieldset>" + "<fieldset>" +

View File

@ -1,39 +1,16 @@
@model List<NzbDrone.Web.Models.UpcomingEpisodeModel> @model List<NzbDrone.Web.Models.UpcomingEpisodeModel>
@using NzbDrone.Web.Models @using NzbDrone.Web.Models
@section Scripts{
<script type="text/javascript">
function onRowDataBound(e) {
e.row.style.boarder = "";
if (e.dataItem.Level == 3) {
e.row.style.backgroundColor = "#FFD700";
}
else if (e.dataItem.Level == 4) {
e.row.style.backgroundColor = "#FF7500";
}
else if (e.dataItem.Level == 5) {
e.row.style.backgroundColor = "black";
e.row.style.color = "red";
}
//e.row.style.color = 'blue';
}
</script>
}
@section TitleContent{ @section TitleContent{
Upcoming Upcoming
} }
@section ActionMenu{ @section ActionMenu{
@{Html.Telerik().Menu().Name("historyMenu").Items( @{Html.Telerik().Menu().Name("historyMenu").Items(
items => { items.Add().Text("Start RSS Sync").Action("RssSync", "Series"); }).Render();} items => { items.Add().Text("Start RSS Sync").Action("RssSync", "Series"); }).Render();}
} }
@section MainContent{ @section MainContent{
<div id="yesterday"> <div id="yesterday">
<h2>Yesterday</h2> <h2>
Yesterday</h2>
@{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" })
@ -41,12 +18,12 @@
{ {
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").Width(110); .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").Width(120); columns.Bound(c => c.Title).Title("Episode Title");
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(
@ -56,28 +33,27 @@
)) ))
.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))
//.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric)) //.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric))
//.Filterable() //.Filterable()
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound")) //.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();} .Render();}
</div> </div>
<br /> <br />
<div id="today"> <div id="today">
<h2>Today</h2> <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.")
.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").Width(110); .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").Width(120); columns.Bound(c => c.Title).Title("Episode Title");
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(
@ -87,16 +63,12 @@
)) ))
.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))
//.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric))
//.Filterable()
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();} .Render();}
</div> </div>
<br /> <br />
<div id="week"> <div id="week">
<h2>7-Day Forecast</h2> <h2>
7-Day Forecast</h2>
@{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" })
@ -104,12 +76,12 @@
{ {
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").Width(110); .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").Width(120); columns.Bound(c => c.Title).Title("Episode Title");
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(
@ -119,9 +91,6 @@
)) ))
.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))
//.Pageable(c => c.PageSize(20).Position(GridPagerPosition.Both).Style(GridPagerStyles.PageInput | GridPagerStyles.NextPreviousAndNumeric))
//.Filterable()
//.ClientEvents(c => c.OnRowDataBound("onRowDataBound"))
.Render();} .Render();}
</div> </div>
} }