diff --git a/NzbDrone.Web/Content/Menu.css b/NzbDrone.Web/Content/Menu.css new file mode 100644 index 000000000..2dc07197c --- /dev/null +++ b/NzbDrone.Web/Content/Menu.css @@ -0,0 +1,20 @@ +#sub-menu +{ + padding-left: 5px; +} + +#sub-menu li +{ + display: inline; + list-style-type: none; + padding-left: 8px; + padding-right: 12px; + padding-top: 6px; + border-right: 1px solid #F0F0F0; +} + +#sub-menu a +{ + text-decoration: none; + color: #105CD6; +} \ No newline at end of file diff --git a/NzbDrone.Web/Controllers/CommandController.cs b/NzbDrone.Web/Controllers/CommandController.cs new file mode 100644 index 000000000..00c8e7638 --- /dev/null +++ b/NzbDrone.Web/Controllers/CommandController.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using NzbDrone.Core.Providers.Jobs; + +namespace NzbDrone.Web.Controllers +{ + public class CommandController : Controller + { + private readonly JobProvider _jobProvider; + + public CommandController(JobProvider jobProvider) + { + _jobProvider = jobProvider; + } + + public JsonResult RssSync() + { + _jobProvider.QueueJob(typeof(RssSyncJob)); + return new JsonResult { Data = "ok" }; + } + + public JsonResult SyncEpisodesOnDisk(int seriesId) + { + //Syncs the episodes on disk for the specified series + _jobProvider.QueueJob(typeof(DiskScanJob), seriesId); + + return new JsonResult { Data = "ok" }; + } + + public JsonResult UpdateInfo(int seriesId) + { + //Syncs the episodes on disk for the specified series + _jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId); + + return new JsonResult { Data = "ok" }; + } + + public JsonResult RenameSeries(int seriesId) + { + //Syncs the episodes on disk for the specified series + //_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId); + + return new JsonResult { Data = "ok" }; + } + } +} diff --git a/NzbDrone.Web/Controllers/HistoryController.cs b/NzbDrone.Web/Controllers/HistoryController.cs index e0a1e2e8c..8145614bf 100644 --- a/NzbDrone.Web/Controllers/HistoryController.cs +++ b/NzbDrone.Web/Controllers/HistoryController.cs @@ -26,16 +26,16 @@ namespace NzbDrone.Web.Controllers return View(); } - public ActionResult Trim() + public JsonResult Trim() { _historyProvider.Trim(); - return RedirectToAction("Index"); + return new JsonResult { Data = "ok" }; } - public ActionResult Purge() + public JsonResult Purge() { _historyProvider.Purge(); - return RedirectToAction("Index"); + return new JsonResult { Data = "ok" }; } [GridAction] diff --git a/NzbDrone.Web/Controllers/LogController.cs b/NzbDrone.Web/Controllers/LogController.cs index e17915924..8df032ecc 100644 --- a/NzbDrone.Web/Controllers/LogController.cs +++ b/NzbDrone.Web/Controllers/LogController.cs @@ -18,11 +18,11 @@ namespace NzbDrone.Web.Controllers return View(); } - - public ActionResult Clear() + public JsonResult Clear() { _logProvider.DeleteAll(); - return RedirectToAction("Index"); + + return new JsonResult { Data = "ok" }; } [GridAction] diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 59566e3bb..aaec2aadf 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -47,12 +47,6 @@ namespace NzbDrone.Web.Controllers return View(); } - public ActionResult RssSync() - { - _jobProvider.QueueJob(typeof(RssSyncJob)); - return RedirectToAction("Index"); - } - public ActionResult SeasonEditor(int seriesId) { var model = new List(); @@ -185,21 +179,6 @@ namespace NzbDrone.Web.Controllers return View(model); } - public ActionResult SyncEpisodesOnDisk(int seriesId) - { - //Syncs the episodes on disk for the specified series - _jobProvider.QueueJob(typeof(DiskScanJob), seriesId); - - return RedirectToAction("Details", new { seriesId }); - } - - public ActionResult UpdateInfo(int seriesId) - { - //Syncs the episodes on disk for the specified series - _jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId); - return RedirectToAction("Details", new { seriesId }); - } - private List GetSeriesModels(IList seriesInDb) { var series = seriesInDb.Select(s => new SeriesModel diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index d72690add..f3400e515 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -135,6 +135,8 @@ + + @@ -152,6 +154,7 @@ Global.asax + @@ -287,11 +290,10 @@ - + - diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index 360180511..a5f67248f 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -4,11 +4,10 @@ History } @section ActionMenu{ - @{Html.Telerik().Menu().Name("historyMenu").Items(items => - { - items.Add().Text("Trim History").Action("Trim", "History"); - items.Add().Text("Purge History").Action("Purge", "History"); - }).Render();} + } @section MainContent{
@@ -42,3 +41,12 @@ History .Render();}
} + + \ No newline at end of file diff --git a/NzbDrone.Web/Views/Log/Index.cshtml b/NzbDrone.Web/Views/Log/Index.cshtml index 656d6cd87..6d6c0a5c4 100644 --- a/NzbDrone.Web/Views/Log/Index.cshtml +++ b/NzbDrone.Web/Views/Log/Index.cshtml @@ -22,10 +22,13 @@ @section TitleContent{ Logs } + @section ActionMenu{ - @{Html.Telerik().Menu().Name("logMenu").Items(items => items.Add().Text("Clear Logs").Action("Clear", "Log")) - .Render();} + } + @section MainContent{ @{Html.Telerik().Grid(Model).Name("logsGrid") .TableHtmlAttributes(new { @class = "Grid" }) @@ -47,3 +50,10 @@ Logs .ClientEvents(c => c.OnRowDataBound("onRowDataBound")) .Render();} } + + \ No newline at end of file diff --git a/NzbDrone.Web/Views/Series/Details.cshtml b/NzbDrone.Web/Views/Series/Details.cshtml index 0d1d22c72..4405cfd21 100644 --- a/NzbDrone.Web/Views/Series/Details.cshtml +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -25,43 +25,16 @@ @section ActionMenu{ - @{Html.Telerik().Menu().Name("SeriesMenu").Items(items => - { - 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 }); - items.Add().Text("Rename Series").Action("RenameSeries", "Series", new { seriesId = Model.SeriesId }); - }).Render();} + } @section MainContent{ -
-
- ID
-
- @Model.SeriesId
-
- Overview
-
- @Model.Overview
-
- Status
-
- @Model.Status
-
- AirTimes
-
- @Model.AirsDayOfWeek
-
- Language
-
- Location
-
- @Model.Path
-
@foreach (var season in Model.Seasons.Where(s => s > 0).Reverse()) { -

Season @season

diff --git a/NzbDrone.Web/Views/Series/Index.cshtml b/NzbDrone.Web/Views/Series/Index.cshtml index 82a08a942..fee117b0d 100644 --- a/NzbDrone.Web/Views/Series/Index.cshtml +++ b/NzbDrone.Web/Views/Series/Index.cshtml @@ -1,4 +1,5 @@ @using NzbDrone.Core.Repository; +@using NzbDrone.Web.Controllers @using NzbDrone.Web.Models; @model IEnumerable @section TitleContent{ @@ -49,7 +50,10 @@ NZBDrone @section ActionMenu{ - @{Html.RenderPartial("SubMenu");} + } @section MainContent{
@@ -119,8 +123,7 @@ NZBDrone $("#progressbar_" + seriesId).episodeProgress(episodeFileCount, episodeCount); } - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/_Layout.cshtml b/NzbDrone.Web/Views/Shared/_Layout.cshtml index 510c9733f..e0f040b4b 100644 --- a/NzbDrone.Web/Views/Shared/_Layout.cshtml +++ b/NzbDrone.Web/Views/Shared/_Layout.cshtml @@ -13,6 +13,7 @@ + diff --git a/NzbDrone.Web/Views/Upcoming/Index.cshtml b/NzbDrone.Web/Views/Upcoming/Index.cshtml index 492d18a5d..0522ea0d2 100644 --- a/NzbDrone.Web/Views/Upcoming/Index.cshtml +++ b/NzbDrone.Web/Views/Upcoming/Index.cshtml @@ -4,8 +4,9 @@ Upcoming } @section ActionMenu{ - @{Html.Telerik().Menu().Name("historyMenu").Items( - items => { items.Add().Text("Start RSS Sync").Action("RssSync", "Series"); }).Render();} + } @section MainContent{