From c45729a98682579c853b24317f11bc37757214da Mon Sep 17 00:00:00 2001 From: Keivan Date: Mon, 28 Mar 2011 16:38:05 -0700 Subject: [PATCH] removed default root property tweaked the ui on add new show --- NzbDrone.Core/Repository/RootDir.cs | 5 +- .../Controllers/SettingsController.cs | 8 +- NzbDrone.Web/Views/Series/AddNew.aspx | 80 +++++++------------ .../Views/Series/SeriesSearchResults.ascx | 26 +++--- NzbDrone.Web/Views/Settings/RootDir.ascx | 55 ++++++------- 5 files changed, 72 insertions(+), 102 deletions(-) diff --git a/NzbDrone.Core/Repository/RootDir.cs b/NzbDrone.Core/Repository/RootDir.cs index f10319e63..30c84dc27 100644 --- a/NzbDrone.Core/Repository/RootDir.cs +++ b/NzbDrone.Core/Repository/RootDir.cs @@ -8,11 +8,8 @@ namespace NzbDrone.Core.Repository { public class RootDir { - [SubSonicPrimaryKey(true)] - public int RootDirId { get; set; } + public int Id { get; set; } public string Path { get; set; } - - public bool Default { get; set; } } } diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 8a3e2667f..7a20a11e8 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -191,7 +191,7 @@ namespace NzbDrone.Web.Controllers public ViewResult AddRootDir() { - return View("RootDir", new RootDir { Default = false }); + return View("RootDir", new RootDir()); } public ActionResult SubMenu() @@ -225,13 +225,13 @@ namespace NzbDrone.Web.Controllers foreach (var currentRootDir in currentRootDirs) { var closureRootDir = currentRootDir; - if (!data.Directories.Exists(d => d.RootDirId == closureRootDir.RootDirId)) - _rootDirProvider.Remove(closureRootDir.RootDirId); + if (!data.Directories.Exists(d => d.Id == closureRootDir.Id)) + _rootDirProvider.Remove(closureRootDir.Id); } foreach (var dir in data.Directories) { - if (dir.RootDirId == 0) + if (dir.Id == 0) _rootDirProvider.Add(dir); else diff --git a/NzbDrone.Web/Views/Series/AddNew.aspx b/NzbDrone.Web/Views/Series/AddNew.aspx index 7b974e7f3..57451b209 100644 --- a/NzbDrone.Web/Views/Series/AddNew.aspx +++ b/NzbDrone.Web/Views/Series/AddNew.aspx @@ -1,17 +1,15 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> + <%@ Import Namespace="NzbDrone.Web.Models" %> <%@ Import Namespace="Telerik.Web.Mvc.UI" %> <%@ Import Namespace="NzbDrone.Core.Repository" %> - Add New Series - - <% @@ -19,47 +17,37 @@ %> -
-
+
<%= Html.Label("Enter a Series Name") %> <%= Html.TextBox("new_series_name", String.Empty, new { id="new_series_id" }) %> +
- -
+
<%= Html.LabelFor(m => m.QualityProfileId)%> <%: Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)%>
- -

- -

- -
- - - -
- +
+
+ +
+
-
- +
+
diff --git a/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx b/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx index c80e65f39..ead246c5f 100644 --- a/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx +++ b/NzbDrone.Web/Views/Series/SeriesSearchResults.ascx @@ -1,27 +1,25 @@ <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl>" %> <%@ Import Namespace="NzbDrone.Core.Repository" %> -
-
+
Search Results - <% if (Model.Count == 0) { %> - No results found for the series name + No results found for the series name <% } %> - - <% int r = 0; %> <% foreach (var result in Model) { %> - <%: Html.RadioButton("selectedSeries", result.TvDbId, new { @class="searchRadio examplePart", id="searchRadio_" + r }) %> - <%: Html.Label(result.TvDbName) %> (<%: Html.Label(result.FirstAired.ToString("MM/dd/yyyy"))%>) - - <%: Html.TextBox(result.TvDbName + "_text", result.TvDbName, new { id = result.TvDbId + "_text", style="display:none" }) %> - <% r++;%> -
- <% + <%: Html.RadioButton("selectedSeries", result.TvDbId, r ==0, new { @class="searchRadio examplePart", id="searchRadio_" + r }) %> + + <%:result.TvDbName + " (" + result.FirstAired.ToShortDateString()%>) + <%: Html.TextBox(result.TvDbName + "_text", result.TvDbName, new { id = result.TvDbId + "_text", style="display:none" }) %> + <% + + r++;%> +
+ <% } %>
-
\ No newline at end of file +
diff --git a/NzbDrone.Web/Views/Settings/RootDir.ascx b/NzbDrone.Web/Views/Settings/RootDir.ascx index fdc518ee4..e5f8c31e1 100644 --- a/NzbDrone.Web/Views/Settings/RootDir.ascx +++ b/NzbDrone.Web/Views/Settings/RootDir.ascx @@ -1,36 +1,31 @@ <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%@ Import Namespace="NzbDrone.Web.Helpers" %> - <% using (Html.BeginCollectionItem("Directories")) - { %> - - <% - var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_'); + { %> +<% + var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_'); //string sortable1 = String.Format("{0}_sortable1", idClean); - %> - - - -
- -
- -
- <%: Html.CheckBoxFor(m => m.Default, new { @class = "defaultCheckbox" }) %> - <%: Html.TextBoxFor(m => m.Path, new { @class="root_dir_text" }) %> - Delete -
- -
- <%: Html.ValidationMessageFor(m => m.Path) %> -
- -
- <%= Html.TextBoxFor(x => x.RootDirId, new { @style = "display:none" })%> -
- -
+%> + +
+
+
+ <%: Html.TextBoxFor(m => m.Path, new { @class="root_dir_text" }) %> + + Delete
+
+ <%: Html.ValidationMessageFor(m => m.Path) %> +
+
+ <%= Html.TextBoxFor(x => x.Id, new { @style = "display:none" })%> +
+
+
<% } %> \ No newline at end of file