2011-04-21 07:14:47 +00:00
|
|
|
@model NzbDrone.Core.Repository.Series
|
|
|
|
@using NzbDrone.Core.Repository
|
|
|
|
@using NzbDrone.Web.Models
|
|
|
|
@section TitleContent{
|
|
|
|
@Model.Title
|
|
|
|
}
|
|
|
|
@section ActionMenu{
|
|
|
|
@{Html.Telerik().Menu().Name("SeriesMenu").Items(items =>
|
2011-04-10 02:44:01 +00:00
|
|
|
{
|
|
|
|
items.Add().Text("Back to Series List").Action("Index",
|
|
|
|
"Series");
|
|
|
|
items.Add().Text("Scan For Episodes on Disk").Action(
|
|
|
|
"SyncEpisodesOnDisk", "Series",
|
2011-04-24 05:48:12 +00:00
|
|
|
new { seriesId = Model.SeriesId });
|
2011-04-20 07:44:13 +00:00
|
|
|
items.Add().Text("Update Info").Action(
|
|
|
|
"UpdateInfo", "Series",
|
|
|
|
new { seriesId = Model.SeriesId });
|
2011-04-10 02:44:01 +00:00
|
|
|
items.Add().Text("Rename Series").Action("RenameSeries",
|
|
|
|
"Series",
|
|
|
|
new
|
|
|
|
{
|
|
|
|
seriesId
|
|
|
|
=
|
|
|
|
Model.
|
|
|
|
SeriesId
|
|
|
|
});
|
2011-04-21 07:14:47 +00:00
|
|
|
}).Render();}
|
|
|
|
}
|
|
|
|
@section MainContent{
|
2010-09-24 07:14:42 +00:00
|
|
|
<fieldset>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
ID</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.SeriesId</div>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
Overview</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.Overview</div>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
Status</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.Status</div>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
AirTimes</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.AirTimes</div>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
Language</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.Language.ToUpper()</div>
|
2010-10-05 06:21:18 +00:00
|
|
|
<div class="display-label">
|
|
|
|
Location</div>
|
|
|
|
<div class="display-field">
|
2011-04-21 07:14:47 +00:00
|
|
|
@Model.Path</div>
|
2010-09-24 07:14:42 +00:00
|
|
|
</fieldset>
|
2011-04-24 05:48:12 +00:00
|
|
|
@*Todo: This breaks when using SQLServer... thoughts?*@
|
|
|
|
@foreach (var season in Model.Seasons.Where(s => s.SeasonNumber > 0).Reverse())
|
|
|
|
{
|
2011-04-21 07:14:47 +00:00
|
|
|
|
2011-04-24 05:48:12 +00:00
|
|
|
<br />
|
2011-05-24 04:12:54 +00:00
|
|
|
<h3>
|
|
|
|
Season @season.SeasonNumber</h3>
|
2011-05-19 15:08:00 +00:00
|
|
|
<div class="grid-container">
|
|
|
|
@{Season season1 = season;
|
2011-05-24 04:12:54 +00:00
|
|
|
Html.Telerik().Grid<EpisodeModel>().Name("seasons_" + season.SeasonNumber)
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(o => o.EpisodeId)
|
|
|
|
.ClientTemplate(
|
|
|
|
"<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />")
|
|
|
|
.Title("")
|
|
|
|
.Width(1)
|
|
|
|
.HtmlAttributes(new { style = "text-align:center" });
|
2011-03-31 01:42:27 +00:00
|
|
|
|
2011-05-24 04:12:54 +00:00
|
|
|
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
|
|
|
|
columns.Bound(c => c.Title).Title("Title");
|
|
|
|
columns.Bound(c => c.AirDate).Format("{0:d}").Width(0);
|
|
|
|
columns.Bound(c => c.Quality).Width(0);
|
|
|
|
columns.Bound(c => c.Status).Width(0);
|
2011-05-27 06:03:57 +00:00
|
|
|
columns.Bound(o => o.EpisodeId).Title("")
|
|
|
|
.ClientTemplate("<a href='#Search' onClick=\"return searchForEpisode('<#= EpisodeId #>')\" >Search</a>");
|
2011-05-24 04:12:54 +00:00
|
|
|
})
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
|
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
{
|
|
|
|
clientEvents.OnDataBinding("grid_bind");
|
|
|
|
clientEvents.OnDataBound("grid_bound");
|
|
|
|
})
|
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true))
|
|
|
|
.Footer(true)
|
|
|
|
.DataBinding(
|
|
|
|
d =>
|
|
|
|
d.Ajax().Select("_AjaxSeasonGrid", "Series",
|
|
|
|
new RouteValueDictionary { { "seasonId", season1.SeasonId.ToString() } }))
|
|
|
|
.ToolBar(
|
|
|
|
c =>
|
|
|
|
c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season1.SeasonId })
|
|
|
|
.ButtonType(GridButtonType.Text))
|
|
|
|
.Render();}
|
|
|
|
<span class="grid-loader">
|
|
|
|
<img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/>
|
|
|
|
Loading...</span>
|
2011-05-19 15:08:00 +00:00
|
|
|
</div>
|
2011-04-24 05:48:12 +00:00
|
|
|
}
|
|
|
|
@{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();}
|
|
|
|
@if (specialSeasons != null)
|
|
|
|
{
|
2010-10-30 02:46:32 +00:00
|
|
|
|
2011-04-24 05:48:12 +00:00
|
|
|
<br />
|
2011-05-24 04:12:54 +00:00
|
|
|
<h3>
|
|
|
|
Specials</h3>
|
2011-05-19 15:08:00 +00:00
|
|
|
<div class="grid-container">
|
2011-05-21 07:09:41 +00:00
|
|
|
@{Html.Telerik().Grid<EpisodeModel>().Name("seasons_specials")
|
2011-05-24 04:12:54 +00:00
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
2011-05-19 15:08:00 +00:00
|
|
|
.Columns(columns =>
|
2011-05-21 07:09:41 +00:00
|
|
|
{
|
|
|
|
columns.Bound(o => o.EpisodeId)
|
|
|
|
.ClientTemplate(
|
|
|
|
"<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />")
|
|
|
|
.Title("")
|
|
|
|
.Width(1)
|
|
|
|
.HtmlAttributes(new { style = "text-align:center" });
|
|
|
|
|
|
|
|
columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode");
|
2011-05-24 04:12:54 +00:00
|
|
|
columns.Bound(c => c.Title).Title("Title").Width(10000);
|
2011-05-21 07:09:41 +00:00
|
|
|
columns.Bound(c => c.AirDate).Format("{0:d}").Width(10);
|
|
|
|
columns.Bound(c => c.Quality).Width(10);
|
2011-05-24 04:12:54 +00:00
|
|
|
columns.Bound(c => c.Status).Width(10);
|
2011-05-21 07:09:41 +00:00
|
|
|
})
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
|
2011-05-19 15:08:00 +00:00
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
{
|
|
|
|
clientEvents.OnDataBinding("grid_bind");
|
|
|
|
clientEvents.OnDataBound("grid_bound");
|
|
|
|
})
|
2011-05-21 07:09:41 +00:00
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true))
|
|
|
|
.Footer(true)
|
|
|
|
.DataBinding(
|
|
|
|
d =>
|
|
|
|
d.Ajax().Select("_AjaxSeasonGrid", "Series",
|
|
|
|
new RouteValueDictionary { { "seasonId", specialSeasons.SeasonId.ToString() } }))
|
2011-05-19 15:08:00 +00:00
|
|
|
.Render(); }
|
2011-05-24 04:12:54 +00:00
|
|
|
<span class="grid-loader">
|
|
|
|
<img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/>
|
|
|
|
Loading...</span>
|
2011-05-19 15:08:00 +00:00
|
|
|
</div>
|
2011-04-24 05:48:12 +00:00
|
|
|
}
|
2011-04-21 07:14:47 +00:00
|
|
|
}
|
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
2010-10-30 02:46:32 +00:00
|
|
|
function episodeDetailExpanded(e) {
|
|
|
|
$console.log("OnDetailViewExpand :: " + e.masterRow.cells[1].innerHTML);
|
|
|
|
}
|
2011-05-27 06:03:57 +00:00
|
|
|
|
|
|
|
var searchUrl = '@Url.Action("Search", "Episode")';
|
|
|
|
|
|
|
|
function searchForEpisode(id) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: searchUrl,
|
|
|
|
data: jQuery.param({ episodeId: id }),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could search for " + id + " at this time. " + error);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2010-10-30 02:46:32 +00:00
|
|
|
</script>
|
2011-04-21 07:14:47 +00:00
|
|
|
}
|