From 94e16a603738451410b9767d969b33d69e2eef78 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 1 Jul 2011 13:59:25 -0700 Subject: [PATCH] root dir is done --- NzbDrone.Web/Content/ActionButton.css | 3 +- NzbDrone.Web/Content/Site.css | 4 +- .../Controllers/AddSeriesController.cs | 7 +- .../Controllers/DirectoryController.cs | 11 +- NzbDrone.Web/NzbDrone.Web.csproj | 11 +- NzbDrone.Web/Views/AddSeries/Index.cshtml | 106 ++---------------- NzbDrone.Web/Views/AddSeries/RootDir.cshtml | 8 +- NzbDrone.Web/Views/AddSeries/Test.cshtml | 9 -- 8 files changed, 25 insertions(+), 134 deletions(-) delete mode 100644 NzbDrone.Web/Views/AddSeries/Test.cshtml diff --git a/NzbDrone.Web/Content/ActionButton.css b/NzbDrone.Web/Content/ActionButton.css index c0eddc1fb..83b4fd123 100644 --- a/NzbDrone.Web/Content/ActionButton.css +++ b/NzbDrone.Web/Content/ActionButton.css @@ -1,11 +1,10 @@ .actionButton { - margin: 5px 0px; + margin: 5px 5px 5px 5px; padding: 5px 10px 5px 10px; background-repeat: no-repeat; background-position: 5px center; background-color: #cccccc; - margin-bottom: 10px; display: inline-block; font-size: 15px; } diff --git a/NzbDrone.Web/Content/Site.css b/NzbDrone.Web/Content/Site.css index 3970a128e..0c641c12c 100644 --- a/NzbDrone.Web/Content/Site.css +++ b/NzbDrone.Web/Content/Site.css @@ -169,13 +169,13 @@ button:active, input[type="button"]:active, input[type="submit"]:active, input[t border-color: #0C48B6; } -input, select +input[type=text], select { font-size: larger; padding: 4px 2px; border: solid 1px #aacfe4; width: 200px; - margin: 2px 0 20px 10px; + margin: 2px 0 10px 10px; height: 20px; } diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index f5ed58b4e..5916152fb 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -55,7 +55,7 @@ namespace NzbDrone.Web.Controllers Path = r.Path, CleanPath = r.Path.Replace(Path.DirectorySeparatorChar, '|').Replace(Path.VolumeSeparatorChar, '^').Replace('\'', '`') }); - ViewData["RootDirs"] = rootDirs; + ViewData["RootDirs"] = rootDirs.ToList(); ViewData["DirSep"] = Path.DirectorySeparatorChar.ToString().Replace(Path.DirectorySeparatorChar, '|'); var defaultQuality = _configProvider.DefaultQualityProfile; @@ -88,11 +88,6 @@ namespace NzbDrone.Web.Controllers } - public ActionResult Test() - { - return View(); - } - public ActionResult AddExisting() { var rootDirs = _rootFolderProvider.GetAll(); diff --git a/NzbDrone.Web/Controllers/DirectoryController.cs b/NzbDrone.Web/Controllers/DirectoryController.cs index 69da11b35..c5ad3f8f2 100644 --- a/NzbDrone.Web/Controllers/DirectoryController.cs +++ b/NzbDrone.Web/Controllers/DirectoryController.cs @@ -32,6 +32,7 @@ namespace NzbDrone.Web.Controllers [HttpGet] public JsonResult GetDirectories(string q) { + string[] dirs = null; try { //Windows (Including UNC) @@ -39,18 +40,16 @@ namespace NzbDrone.Web.Controllers if (windowsSep > -1) { - var dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1)); - return Json(dirs, JsonRequestBehavior.AllowGet); + dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1)); + } - return Json(new string[] { }, JsonRequestBehavior.AllowGet); //Unix var index = q.LastIndexOf('/'); if (index > -1) { - var dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1)); - //return new SelectList(dirs, dirs.FirstOrDefault()); + dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1)); } } catch @@ -58,7 +57,7 @@ namespace NzbDrone.Web.Controllers //Swallow the exceptions so proper JSON is returned to the client (Empty results) } - return Json(new string[]{}, JsonRequestBehavior.AllowGet); + return Json(dirs, JsonRequestBehavior.AllowGet); } } } diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 4e6f2ba3c..0df129208 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -669,12 +669,6 @@ - - - - - - @@ -688,10 +682,11 @@ - + - + + diff --git a/NzbDrone.Web/Views/AddSeries/Index.cshtml b/NzbDrone.Web/Views/AddSeries/Index.cshtml index 37a0e5aae..aab13e9f5 100644 --- a/NzbDrone.Web/Views/AddSeries/Index.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Index.cshtml @@ -1,14 +1,11 @@ @model List @using NzbDrone.Core.Repository - + +@section HeaderContent +{ + +} + @section TitleContent{ Add Series } @@ -26,52 +23,20 @@ Add Series .LoadContentFrom("AddNew", "AddSeries") .Render(); } - @{ Html.Telerik().PanelBar() - .Name("RootDirPanel") - .HtmlAttributes(new { style = "margin: 0px;" }) - .ExpandMode(PanelBarExpandMode.Multiple) - .Items(panelItem => - { - panelItem.Add() - .Text("Root Directories") - .ImageUrl("~/Content/Images/VideoFolder.png") - .Selected((bool)ViewData["ShowRootDirs"]) - .Expanded((bool)ViewData["ShowRootDirs"]) - .Content(@ -
- -
- @foreach (var root in Model) - { - Html.RenderAction("GetRootDirView", root); - } -
- - -
-
); - }).Render(); - }
@Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList)ViewData["qualities"]).HtmlAttributes( new { style = "width: 100px; margin-left:224px;" }).ClientEvents(events => events.OnChange("masterChanged"))
+ + @{Html.RenderAction("RootDir");}
@{ Html.RenderAction("AddExisting", "AddSeries"); }
} + @section Scripts { -} -@{Html.RenderAction("RootDir");}