1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/Views/Series/Details.cshtml

141 lines
7.1 KiB
Plaintext
Raw Normal View History

@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 05:44:01 +03:00
{
items.Add().Text("Edit").Action("Edit", "Series",
new
{
seriesId =
Model.SeriesId
});
items.Add().Text("Back to Series List").Action("Index",
"Series");
items.Add().Text("Scan For Episodes on Disk").Action(
"SyncEpisodesOnDisk", "Series",
new {seriesId = Model.SeriesId});
items.Add().Text("Update Info").Action(
"UpdateInfo", "Series",
new { seriesId = Model.SeriesId });
2011-04-10 05:44:01 +03:00
items.Add().Text("Rename Series").Action("RenameSeries",
"Series",
new
{
seriesId
=
Model.
SeriesId
});
}).Render();}
}
@section MainContent{
2010-09-24 10:14:42 +03:00
<fieldset>
2010-10-05 09:21:18 +03:00
<div class="display-label">
ID</div>
<div class="display-field">
@Model.SeriesId</div>
2010-10-05 09:21:18 +03:00
<div class="display-label">
Overview</div>
<div class="display-field">
@Model.Overview</div>
2010-10-05 09:21:18 +03:00
<div class="display-label">
Status</div>
<div class="display-field">
@Model.Status</div>
2010-10-05 09:21:18 +03:00
<div class="display-label">
AirTimes</div>
<div class="display-field">
@Model.AirTimes</div>
2010-10-05 09:21:18 +03:00
<div class="display-label">
Language</div>
<div class="display-field">
@Model.Language.ToUpper()</div>
2010-10-05 09:21:18 +03:00
<div class="display-label">
Location</div>
<div class="display-field">
@Model.Path</div>
2010-09-24 10:14:42 +03:00
</fieldset>
@*Todo: This breaks when using SQLServer... thoughts?*@
@foreach (var season in Model.Seasons.Where(s => s.SeasonNumber > 0).Reverse())
2010-10-05 09:21:18 +03:00
{
<br />
<h3>Season @season.SeasonNumber</h3>
Season season1 = season;
Html.Telerik().Grid<EpisodeModel>().Name("seasons_" + season.SeasonNumber)
.TableHtmlAttributes(new { @class = "Grid" })
2011-04-10 05:44:01 +03:00
.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-04-10 05:44:01 +03:00
columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode");
columns.Bound(c => c.Title).Title("Title").Width(300);
columns.Bound(c => c.AirDate).Format("{0:d}").Width(10);
columns.Bound(c => c.Quality).Width(10);
columns.Bound(c => c.Path);
})
//.DetailView(detailView => detailView.Template(e => Html.RenderPartial("EpisodeDetail", e)))
2011-04-10 05:44:01 +03:00
.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()}}))
//.EnableCustomBinding(true)
//.ClientEvents(e => e.OnDetailViewExpand("episodeDetailExpanded")) //Causes issues displaying the episode detail multiple times...
2011-04-10 05:44:01 +03:00
.ToolBar(
c =>
c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new {seasonId = season1.SeasonId})
.ButtonType(GridButtonType.Text))
.Render();
}
//Specials
@{var specialSeasons = Model.Seasons.Where(s => s.SeasonNumber == 0).FirstOrDefault();}
@if (specialSeasons != null)
{
<br />
<h3>
Specials</h3>
Html.Telerik().Grid(specialSeasons.Episodes).Name("seasons_specials")
.TableHtmlAttributes(new { @class = "Grid" })
2011-04-10 05:44:01 +03:00
.Columns(columns =>
{
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
columns.Bound(c => c.Title);
columns.Bound(c => c.AirDate).Format("{0:d}").Width(0);
})
2011-04-10 05:44:01 +03:00
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #></div>"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber)).Enabled(false))
.Footer(false)
.Render();
}
}
@section Scripts{
<script type="text/javascript">
function episodeDetailExpanded(e) {
$console.log("OnDetailViewExpand :: " + e.masterRow.cells[1].innerHTML);
}
</script>
}