mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
episode grid is now sortable.
This commit is contained in:
parent
f84f8ac992
commit
f4047dee2c
@ -93,7 +93,7 @@ public ActionResult _AjaxSeasonGrid(int seriesId, int seasonNumber)
|
||||
{
|
||||
using (MiniProfiler.StepStatic("Controller"))
|
||||
{
|
||||
var episodes = GetEpisodeModels(_episodeProvider.GetEpisodesBySeason(seriesId, seasonNumber)).OrderByDescending(e => e.EpisodeNumber);
|
||||
var episodes = GetEpisodeModels(_episodeProvider.GetEpisodesBySeason(seriesId, seasonNumber));
|
||||
return View(new GridModel(episodes));
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,8 @@
|
||||
@section TitleContent{
|
||||
@Model.Title
|
||||
}
|
||||
|
||||
<script src="../../Scripts/NzbDrone/seriesDetails.js" type="text/javascript"></script>
|
||||
<link href="../../Content/Grid.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style>
|
||||
.seasonToggleTopGroup
|
||||
{
|
||||
@ -48,7 +46,6 @@
|
||||
|
||||
.searchImage:hover, .renameImage:hover, .ignoreEpisode:hover, .ignoreEpisodesMaster:hover
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#banner-container
|
||||
@ -62,7 +59,6 @@
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@section ActionMenu{
|
||||
<ul class="sub-menu">
|
||||
<li>@Ajax.ActionLink("Scan Disk", "ScanDisk", "Command", new { seriesId = Model.SeriesId }, null)</li>
|
||||
@ -71,7 +67,6 @@
|
||||
<li>@Ajax.ActionLink("Rename Episodes", "RenameEpisodes", "Episode", new { seriesId = Model.SeriesId }, null)</li>
|
||||
</ul>
|
||||
}
|
||||
|
||||
<div id="banner-container">
|
||||
@{
|
||||
var bannerUrl = "../../Content/Images/img03.jpg";
|
||||
@ -83,7 +78,6 @@
|
||||
}
|
||||
<img src="@bannerUrl" alt="Banner"/>
|
||||
</div>
|
||||
|
||||
<div class="seasonToggleTopGroup">
|
||||
@foreach (var season in Model.Seasons)
|
||||
{
|
||||
@ -94,7 +88,6 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@foreach (var s in Model.Seasons.Reverse())
|
||||
{
|
||||
var seriesId = @Model.SeriesId;
|
||||
@ -104,17 +97,15 @@
|
||||
@(season == 0 ? "Specials" : "Season " + season)
|
||||
</h2>
|
||||
|
||||
<div class="grid-container">
|
||||
@{
|
||||
Html.Telerik().Grid<EpisodeModel>().Name("seasons_" + season)
|
||||
.TableHtmlAttributes(new { @class = "Grid" })
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.EpisodeNumber).Width(50).Title("Episode");
|
||||
columns.Bound(c => c.Title).Title("Title");
|
||||
columns.Bound(c => c.AirDate).Width(100);
|
||||
columns.Bound(c => c.EpisodeNumber).Width(100).Title("Episode").Sortable(true);
|
||||
columns.Bound(c => c.Title).Title("Title").Sortable(false);
|
||||
columns.Bound(c => c.AirDate).Width(100).Sortable(false);
|
||||
columns.Bound(c => c.Quality).Width(100);
|
||||
columns.Bound(c => c.Status)
|
||||
columns.Bound(c => c.Status).Sortable(false)
|
||||
.Title("<img src='../../Content/Images/ignoredNeutral.png' class='ignoredEpisodesMaster ignoreEpisode ignoreSeason_" + season + "' title='Click to toggle season ignore status' />" +
|
||||
"<img src='../../Content/Images/Missing.png' alt='Status' title='Season Status' class='statusImage statusImageMaster' />" +
|
||||
"<a href=\"../Episode/SearchSeason?seriesId=" + @seriesId + "&seasonNumber=" + @season + "\" onclick=\"searchSeason(" + @seriesId + ", " + @season + "); return false;\"><img src='../../Content/Images/Search.png' alt='Search' title='Search for all episodes in this season' class='searchImage searchImageMaster' /></a>" +
|
||||
@ -137,10 +128,11 @@
|
||||
clientEvents.OnRowDataBound("grid_rowBound");
|
||||
clientEvents.OnDataBound("grid_dataBound");
|
||||
})
|
||||
.Render();}
|
||||
</div>
|
||||
.Sortable(sorting => sorting
|
||||
.OrderBy(sortOrder => sortOrder.Add(o => o.EpisodeNumber).Descending()).SortMode(GridSortMode.SingleColumn))
|
||||
.Render();
|
||||
}
|
||||
}
|
||||
|
||||
@section Scripts{
|
||||
<script type="text/javascript">
|
||||
seriesId = @Model.SeriesId;
|
||||
|
@ -51,9 +51,7 @@ NzbDrone
|
||||
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
||||
</ul>
|
||||
}
|
||||
<div class="grid-container">
|
||||
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
||||
.TableHtmlAttributes(new { @class = "Grid" })
|
||||
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
||||
.DataBinding(data => data.Ajax()
|
||||
.Select("_AjaxSeriesGrid", "Series")
|
||||
@ -85,7 +83,6 @@ NzbDrone
|
||||
|
||||
})
|
||||
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
||||
//.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
|
||||
.DetailView(detailView => detailView.ClientTemplate(
|
||||
"<b>Airs Day of Week:</b> " + "<#= AirsDayOfWeek #>" +
|
||||
"<br />" +
|
||||
@ -99,7 +96,6 @@ NzbDrone
|
||||
clientEvents.OnRowDataBound("grid_rowBound");
|
||||
})
|
||||
.Render();}
|
||||
</div>
|
||||
@section Scripts{
|
||||
<script type="text/javascript">
|
||||
var windowElement;
|
||||
|
Loading…
Reference in New Issue
Block a user