diff --git a/NzbDrone.Web/Content/Images/Downloading.png b/NzbDrone.Web/Content/Images/Downloading.png index 63cacfae8..f49538894 100644 Binary files a/NzbDrone.Web/Content/Images/Downloading.png and b/NzbDrone.Web/Content/Images/Downloading.png differ diff --git a/NzbDrone.Web/Content/Images/Rename.png b/NzbDrone.Web/Content/Images/Rename.png new file mode 100644 index 000000000..bfeb37431 Binary files /dev/null and b/NzbDrone.Web/Content/Images/Rename.png differ diff --git a/NzbDrone.Web/Content/Images/Search.png b/NzbDrone.Web/Content/Images/Search.png new file mode 100644 index 000000000..c445e5c6d Binary files /dev/null and b/NzbDrone.Web/Content/Images/Search.png differ diff --git a/NzbDrone.Web/Controllers/CommandController.cs b/NzbDrone.Web/Controllers/CommandController.cs index 00c8e7638..7d8ae9164 100644 --- a/NzbDrone.Web/Controllers/CommandController.cs +++ b/NzbDrone.Web/Controllers/CommandController.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Web.Controllers public JsonResult RssSync() { _jobProvider.QueueJob(typeof(RssSyncJob)); - return new JsonResult { Data = "ok" }; + return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } public JsonResult SyncEpisodesOnDisk(int seriesId) @@ -27,7 +27,7 @@ namespace NzbDrone.Web.Controllers //Syncs the episodes on disk for the specified series _jobProvider.QueueJob(typeof(DiskScanJob), seriesId); - return new JsonResult { Data = "ok" }; + return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } public JsonResult UpdateInfo(int seriesId) @@ -35,7 +35,7 @@ namespace NzbDrone.Web.Controllers //Syncs the episodes on disk for the specified series _jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId); - return new JsonResult { Data = "ok" }; + return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } public JsonResult RenameSeries(int seriesId) @@ -43,7 +43,7 @@ namespace NzbDrone.Web.Controllers //Syncs the episodes on disk for the specified series //_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId); - return new JsonResult { Data = "ok" }; + return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; } } } diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index c281c7da7..53caf1316 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -142,6 +142,8 @@ + + diff --git a/NzbDrone.Web/Scripts/seriesDetails.js b/NzbDrone.Web/Scripts/seriesDetails.js index edd0c1e86..c8320d783 100644 --- a/NzbDrone.Web/Scripts/seriesDetails.js +++ b/NzbDrone.Web/Scripts/seriesDetails.js @@ -1,5 +1,9 @@ var notIgnoredImage = '../../Content/Images/notIgnored.png'; var ignoredImage = '../../Content/Images/ignored.png'; +var notAiredImage = '../../Content/Images/NotAired.png'; +var readyImage = '../../Content/Images/Ready.png'; +var downloadingImage = '../../Content/Images/Downloading.png'; + var seriesId = 0; var saveSeasonIgnoreUrl = '../Series/SaveSeasonIgnore'; var saveEpisodeIgnoreUrl = '../Series/SaveEpisodeIgnore'; @@ -64,6 +68,8 @@ function toggleChildren(seasonNumber, ignored) { } function toggleMaster(seasonNumber) { + //Toggles all master toggles when the childen changes or the grid is loaded + var ignoreEpisodes = $('.ignoreEpisode_' + seasonNumber); var ignoredCount = ignoreEpisodes.filter('.ignored').length; var masters = $('.ignoreSeason_' + seasonNumber); @@ -82,6 +88,7 @@ function toggleMaster(seasonNumber) { } function toggleMasters(seasonNumber, ignored) { + //Toggles the other master(s) to match the one that was just changed var masters = $('.ignoreSeason_' + seasonNumber); if (ignored) { @@ -125,6 +132,7 @@ function grid_dataBound(e) { var seasonNumber = id.replace('seasons_', ''); toggleMaster(seasonNumber); + setMasterStatus(this); } //Episode Ignore Saving @@ -183,4 +191,33 @@ function searchSeason(seriesId, seasonNumber) { alert("Sorry! We could search for series: " + seriesId + " season: " + seasonNumber + " at this time. " + error); } }); +} + +//Set master status to match children +function setMasterStatus(grid) { + //Get children of this grid + var masterStatus = $(grid).find('.statusImageMaster'); + var statuses = $(grid).find('.statusImage').filter(':not(.statusImageMaster)'); + var episodeCount = statuses.length; + + //Get missing count + if (statuses.filter('.status-Missing').length == episodeCount) { + //Leave as is (default is missing) + return; + } + + if (statuses.filter('.status-NotAired').length == episodeCount) { + masterStatus.attr('src', notAiredImage); + return; + } + + if (statuses.filter('.status-Ready').length == episodeCount) { + masterStatus.attr('src', readyImage); + return; + } + + if (statuses.filter('.status-Downloading').length == episodeCount) { + masterStatus.attr('src', downloadingImage); + return; + } } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/Details.cshtml b/NzbDrone.Web/Views/Series/Details.cshtml index d221aec72..067c9d6c6 100644 --- a/NzbDrone.Web/Views/Series/Details.cshtml +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -7,22 +7,7 @@ - @@ -96,26 +117,32 @@ .TableHtmlAttributes(new { @class = "Grid" }) .Columns(columns => { - columns.Bound(o => o.Ignored) - .Title("") - .ClientTemplate( - "") - .Width(20) - .HtmlAttributes(new { style = "text-align:center" }); + //columns.Bound(o => o.Ignored) + // .Title("") + // .ClientTemplate( + // "") + // .Width(20) + // .HtmlAttributes(new { style = "text-align:center" }); columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode"); columns.Bound(c => c.Title).Title("Title"); columns.Bound(c => c.AirDate).Width(0); columns.Bound(c => c.Quality).Width(0); columns.Bound(c => c.Status) - .ClientTemplate("<#= Status #>") - .Width(20) - .HtmlAttributes(new { style = "text-align:center" }); - columns.Bound(o => o.EpisodeId).Title("") - .ClientTemplate("\" onclick=\"searchForEpisode('<#= EpisodeId #>'); return false;\">Search" - + " | " + - "\" onclick=\"renameEpisode('<#= EpisodeFileId #>'); return false;\">Rename" - ); + .Title("" + + "Status" + + "Search" + + "Rename") + .ClientTemplate("" + + "<#= Status #>" + + "\" onclick=\"searchForEpisode('<#= EpisodeId #>'); return false;\">Search" + + "\" onclick=\"renameEpisode('<#= EpisodeFileId #>'); return false;\">Rename") + .Width(80); + //columns.Bound(o => o.EpisodeId).Title("") + // .ClientTemplate("\" onclick=\"searchForEpisode('<#= EpisodeId #>'); return false;\">Search" + // + " | " + + // "\" onclick=\"renameEpisode('<#= EpisodeFileId #>'); return false;\">Rename" + // ); }) .DetailView(detailView => detailView.ClientTemplate("
<#= Overview #>
<#= Path #>
")) .Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(false)) @@ -124,12 +151,12 @@ d => d.Ajax().Select("_AjaxSeasonGrid", "Series", new RouteValueDictionary { { "seriesId", Model.SeriesId }, { "seasonNumber", season } })) - .ToolBar(toolbar => toolbar.Template(@ + @*.ToolBar(toolbar => toolbar.Template(@ - )) + ))*@ .ClientEvents(clientEvents => { clientEvents.OnRowDataBound("grid_rowBound");