From 0e5ceff380f74763d718ecf4f57560e3e755257f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 20 Apr 2011 18:43:09 -0700 Subject: [PATCH 1/3] Settings partial pages are all in RAZOR now! --- NzbDrone.Web/NzbDrone.Web.csproj | 3 +- NzbDrone.Web/Views/Settings/Downloads.ascx | 189 ------------------ NzbDrone.Web/Views/Settings/Downloads.cshtml | 175 ++++++++++++++++ .../Views/Settings/EpisodeSorting.ascx | 129 ------------ .../Views/Settings/EpisodeSorting.cshtml | 124 ++++++++++++ NzbDrone.Web/Views/Settings/General.ascx | 92 --------- NzbDrone.Web/Views/Settings/General.cshtml | 85 ++++++++ .../Views/Settings/Notifications.ascx | 168 ---------------- .../Views/Settings/Notifications.cshtml | 161 +++++++++++++++ .../Settings/{Quality.ascx => Quality.cshtml} | 37 ++-- NzbDrone.Web/Views/Settings/RootDir.ascx | 32 --- NzbDrone.Web/Views/Settings/RootDir.cshtml | 30 +++ NzbDrone.Web/Views/Settings/SubMenu.ascx | 17 -- NzbDrone.Web/Views/Settings/SubMenu.cshtml | 12 ++ .../Views/Settings/UserProfileSection.ascx | 139 ------------- .../Views/Settings/UserProfileSection.cshtml | 129 ++++++++++++ 16 files changed, 732 insertions(+), 790 deletions(-) delete mode 100644 NzbDrone.Web/Views/Settings/Downloads.ascx create mode 100644 NzbDrone.Web/Views/Settings/Downloads.cshtml delete mode 100644 NzbDrone.Web/Views/Settings/EpisodeSorting.ascx create mode 100644 NzbDrone.Web/Views/Settings/EpisodeSorting.cshtml delete mode 100644 NzbDrone.Web/Views/Settings/General.ascx create mode 100644 NzbDrone.Web/Views/Settings/General.cshtml delete mode 100644 NzbDrone.Web/Views/Settings/Notifications.ascx create mode 100644 NzbDrone.Web/Views/Settings/Notifications.cshtml rename NzbDrone.Web/Views/Settings/{Quality.ascx => Quality.cshtml} (66%) delete mode 100644 NzbDrone.Web/Views/Settings/RootDir.ascx create mode 100644 NzbDrone.Web/Views/Settings/RootDir.cshtml delete mode 100644 NzbDrone.Web/Views/Settings/SubMenu.ascx create mode 100644 NzbDrone.Web/Views/Settings/SubMenu.cshtml delete mode 100644 NzbDrone.Web/Views/Settings/UserProfileSection.ascx create mode 100644 NzbDrone.Web/Views/Settings/UserProfileSection.cshtml diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index aa28433df..7941ec777 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -626,7 +626,7 @@ - + @@ -664,6 +664,7 @@ + diff --git a/NzbDrone.Web/Views/Settings/Downloads.ascx b/NzbDrone.Web/Views/Settings/Downloads.ascx deleted file mode 100644 index c3aa27bde..000000000 --- a/NzbDrone.Web/Views/Settings/Downloads.ascx +++ /dev/null @@ -1,189 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> - - - - <% - Html.EnableClientValidation();%> - -<% - using (Html.BeginForm("SaveDownloads", "Settings", FormMethod.Post, new {id = "form", name = "form"})) - {%> -<%--<%: Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") %>--%> - -
- Download Settings - <%--//Sync Frequency - //Download Propers? - //Retention - //SAB Host/IP - //SAB Port - //SAB APIKey - //SAB Username - //SAB Password - //SAB Category - //SAB Priority--%> - -
- Usenet Variables - -
-
-
<%=Html.LabelFor(m => m.SyncFrequency)%>
-
<%=Html.TextBoxFor(m => m.SyncFrequency)%>
-
-
<%=Html.ValidationMessageFor(m => m.SyncFrequency)%>
-
- -
-
-
<%=Html.LabelFor(m => m.DownloadPropers)%>
-
<%=Html.CheckBoxFor(m => m.DownloadPropers)%>
- -
-
<%=Html.ValidationMessageFor(m => m.DownloadPropers)%>
-
- -
-
-
<%=Html.LabelFor(m => m.Retention)%>
-
<%=Html.TextBoxFor(m => m.Retention)%>
-
-
<%=Html.ValidationMessageFor(m => m.Retention)%>
-
-
- -
-
- <%=Html.LabelFor(m => m.UseBlackHole)%> -
-
- <%=Html.RadioButtonFor(m => m.UseBlackHole, true, new {@class = "blackhole_radio"})%>Blackhole -
-
- <%=Html.RadioButtonFor(m => m.UseBlackHole, false, new {@class = "blackhole_radio"})%>SABnzbd -
-
- - - - - - - - <% - }%> -
-
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/Downloads.cshtml b/NzbDrone.Web/Views/Settings/Downloads.cshtml new file mode 100644 index 000000000..149233ff1 --- /dev/null +++ b/NzbDrone.Web/Views/Settings/Downloads.cshtml @@ -0,0 +1,175 @@ +@model NzbDrone.Web.Models.DownloadSettingsModel + + + +@using (Html.BeginForm("SaveDownloads", "Settings", FormMethod.Post, new { id = "form", name = "form" })) +{ + +
+ Download Settings + +
+ Usenet Variables + +
+
+
@Html.LabelFor(m => m.SyncFrequency)
+
@Html.TextBoxFor(m => m.SyncFrequency)
+
+
@Html.ValidationMessageFor(m => m.SyncFrequency)
+
+ +
+
+
@Html.LabelFor(m => m.DownloadPropers)
+
@Html.CheckBoxFor(m => m.DownloadPropers)
+ +
+
@Html.ValidationMessageFor(m => m.DownloadPropers)
+
+ +
+
+
@Html.LabelFor(m => m.Retention)
+
@Html.TextBoxFor(m => m.Retention)
+
+
@Html.ValidationMessageFor(m => m.Retention)
+
+
+ +
+
+ @Html.LabelFor(m => m.UseBlackHole) +
+
+ @Html.RadioButtonFor(m => m.UseBlackHole, true, new { @class = "blackhole_radio" })Blackhole +
+
+ @Html.RadioButtonFor(m => m.UseBlackHole, false, new { @class = "blackhole_radio" })SABnzbd +
+
+ + + + + + + + +
+} +
+ \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/EpisodeSorting.ascx b/NzbDrone.Web/Views/Settings/EpisodeSorting.ascx deleted file mode 100644 index 0f13d0d05..000000000 --- a/NzbDrone.Web/Views/Settings/EpisodeSorting.ascx +++ /dev/null @@ -1,129 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> - - - - <% - Html.EnableClientValidation();%> - -<% - using (Html.BeginForm("SaveEpisodeSorting", "Settings", FormMethod.Post, new {id = "form", name = "form"})) - {%> -<%--<%: Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") %>--%> - -
- Episode Sorting - -
-
-
<%=Html.LabelFor(m => m.ShowName)%>
-
<%=Html.CheckBoxFor(m => m.ShowName)%>
- -
-
<%=Html.ValidationMessageFor(m => m.ShowName)%>
-
- -
-
-
<%=Html.LabelFor(m => m.EpisodeName)%>
-
<%=Html.CheckBoxFor(m => m.EpisodeName)%>
- -
-
<%=Html.ValidationMessageFor(m => m.EpisodeName)%>
-
- -
-
-
<%=Html.LabelFor(m => m.ReplaceSpaces)%>
-
<%=Html.CheckBoxFor(m => m.ReplaceSpaces)%>
- -
-
<%=Html.ValidationMessageFor(m => m.ReplaceSpaces)%>
-
- -
-
-
<%=Html.LabelFor(m => m.AppendQuality)%>
-
<%=Html.CheckBoxFor(m => m.AppendQuality)%>
- -
-
<%=Html.ValidationMessageFor(m => m.AppendQuality)%>
-
- -
-
-
<%=Html.LabelFor(m => m.UseAirByDate)%>
-
<%=Html.CheckBoxFor(m => m.UseAirByDate)%>
- -
-
<%=Html.ValidationMessageFor(m => m.UseAirByDate)%>
-
- -
-
-
<%=Html.LabelFor(m => m.SeasonFolders)%>
-
<%=Html.CheckBoxFor(m => m.SeasonFolders)%>
- -
-
<%=Html.ValidationMessageFor(m => m.SeasonFolders)%>
-
- -
-
-
<%=Html.LabelFor(m => m.SeasonFolderFormat)%>
-
<%=Html.TextBoxFor(m => m.SeasonFolderFormat)%>
-
-
<%=Html.ValidationMessageFor(m => m.SeasonFolderFormat)%>
-
- -
-
-
<%=Html.LabelFor(m => m.SeparatorStyle)%>
-
<%=Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles)%>
-
-
<%=Html.ValidationMessageFor(m => m.SeparatorStyle)%>
-
- -
-
-
<%=Html.LabelFor(m => m.NumberStyle)%>
-
<%=Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles)%>
-
-
<%=Html.ValidationMessageFor(m => m.NumberStyle)%>
-
- -
-
-
<%=Html.LabelFor(m => m.MultiEpisodeStyle)%>
-
<%=Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles)%>
-
-
<%=Html.ValidationMessageFor(m => m.MultiEpisodeStyle)%>
-
- - - - <% - }%> -
-
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/EpisodeSorting.cshtml b/NzbDrone.Web/Views/Settings/EpisodeSorting.cshtml new file mode 100644 index 000000000..16c03026e --- /dev/null +++ b/NzbDrone.Web/Views/Settings/EpisodeSorting.cshtml @@ -0,0 +1,124 @@ +@model NzbDrone.Web.Models.EpisodeSortingModel + + +@using (Html.BeginForm("SaveEpisodeSorting", "Settings", FormMethod.Post, new { id = "form", name = "form" })) +{ + @Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") + ; + +
+ Episode Sorting + +
+
+
@Html.LabelFor(m => m.ShowName)
+
@Html.CheckBoxFor(m => m.ShowName)
+ +
+
@Html.ValidationMessageFor(m => m.ShowName)
+
+ +
+
+
@Html.LabelFor(m => m.EpisodeName)
+
@Html.CheckBoxFor(m => m.EpisodeName)
+ +
+
@Html.ValidationMessageFor(m => m.EpisodeName)
+
+ +
+
+
@Html.LabelFor(m => m.ReplaceSpaces)
+
@Html.CheckBoxFor(m => m.ReplaceSpaces)
+ +
+
@Html.ValidationMessageFor(m => m.ReplaceSpaces)
+
+ +
+
+
@Html.LabelFor(m => m.AppendQuality)
+
@Html.CheckBoxFor(m => m.AppendQuality)
+ +
+
@Html.ValidationMessageFor(m => m.AppendQuality)
+
+ +
+
+
@Html.LabelFor(m => m.UseAirByDate)
+
@Html.CheckBoxFor(m => m.UseAirByDate)
+ +
+
@Html.ValidationMessageFor(m => m.UseAirByDate)
+
+ +
+
+
@Html.LabelFor(m => m.SeasonFolders)
+
@Html.CheckBoxFor(m => m.SeasonFolders)
+ +
+
@Html.ValidationMessageFor(m => m.SeasonFolders)
+
+ +
+
+
@Html.LabelFor(m => m.SeasonFolderFormat)
+
@Html.TextBoxFor(m => m.SeasonFolderFormat)
+
+
@Html.ValidationMessageFor(m => m.SeasonFolderFormat)
+
+ +
+
+
@Html.LabelFor(m => m.SeparatorStyle)
+
@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles)
+
+
@Html.ValidationMessageFor(m => m.SeparatorStyle)
+
+ +
+
+
@Html.LabelFor(m => m.NumberStyle)
+
@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles)
+
+
@Html.ValidationMessageFor(m => m.NumberStyle)
+
+ +
+
+
@Html.LabelFor(m => m.MultiEpisodeStyle)
+
@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles)
+
+
@Html.ValidationMessageFor(m => m.MultiEpisodeStyle)
+
+ + + +
+} +
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/General.ascx b/NzbDrone.Web/Views/Settings/General.ascx deleted file mode 100644 index 706ebd794..000000000 --- a/NzbDrone.Web/Views/Settings/General.ascx +++ /dev/null @@ -1,92 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> - - - -<% - using (Html.BeginForm("SaveGeneral", "Settings", FormMethod.Post, new {id = "form", name = "form"})) - {%> -<%:Html.ValidationSummary(true, - "Unable to save your settings. Please correct the errors and try again.")%> -
- General - -
- - -
- <% - foreach (var item in Model.Directories) - {%> - <% - Html.RenderPartial("RootDir", item);%> - <% - }%> -
-
- -

- -

-
-<% - } - Html.EndForm();%> -
- - \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/General.cshtml b/NzbDrone.Web/Views/Settings/General.cshtml new file mode 100644 index 000000000..9b49f1e2c --- /dev/null +++ b/NzbDrone.Web/Views/Settings/General.cshtml @@ -0,0 +1,85 @@ +@model NzbDrone.Web.Models.SettingsModel + + + +@using (Html.BeginForm("SaveGeneral", "Settings", FormMethod.Post, new {id = "form", name = "form"})) +{ +@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again."); +
+ General + +
+ + +
+ @foreach (var item in Model.Directories) + { + Html.RenderPartial("RootDir", item); + } +
+
+ +

+ +

+
+} +
+ + \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/Notifications.ascx b/NzbDrone.Web/Views/Settings/Notifications.ascx deleted file mode 100644 index 3d6aa96b8..000000000 --- a/NzbDrone.Web/Views/Settings/Notifications.ascx +++ /dev/null @@ -1,168 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> - - - - <% - Html.EnableClientValidation();%> - -<% - using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new {id = "form", name = "form"})) - {%> -<%--<%: Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") %>--%> - -
- Notification Settings - -
- XBMC -
-
-
<%=Html.LabelFor(m => m.XbmcEnabled)%>
-
<%=Html.CheckBoxFor(m => m.XbmcEnabled)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcEnabled)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcNotifyOnGrab)%>
-
<%=Html.CheckBoxFor(m => m.XbmcNotifyOnGrab)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcNotifyOnGrab)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcNotifyOnDownload)%>
-
<%=Html.CheckBoxFor(m => m.XbmcNotifyOnDownload)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcNotifyOnDownload)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcNotifyOnRename)%>
-
<%=Html.CheckBoxFor(m => m.XbmcNotifyOnRename)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcNotifyOnRename)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcNotificationImage)%>
-
<%=Html.CheckBoxFor(m => m.XbmcNotificationImage)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcNotificationImage)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcDisplayTime)%>
-
<%=Html.TextBoxFor(m => m.XbmcDisplayTime)%>
-
-
<%=Html.ValidationMessageFor(m => m.XbmcDisplayTime)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcUpdateOnDownload)%>
-
<%=Html.CheckBoxFor(m => m.XbmcUpdateOnDownload)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcUpdateOnDownload)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcUpdateOnRename)%>
-
<%=Html.CheckBoxFor(m => m.XbmcUpdateOnRename)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcUpdateOnRename)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcFullUpdate)%>
-
<%=Html.CheckBoxFor(m => m.XbmcFullUpdate)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcFullUpdate)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcCleanOnDownload)%>
-
<%=Html.CheckBoxFor(m => m.XbmcCleanOnDownload)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcCleanOnDownload)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcCleanOnRename)%>
-
<%=Html.CheckBoxFor(m => m.XbmcCleanOnRename)%>
- -
-
<%=Html.ValidationMessageFor(m => m.XbmcCleanOnRename)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcHosts)%>
-
<%=Html.TextBoxFor(m => m.XbmcHosts)%>
-
-
<%=Html.ValidationMessageFor(m => m.XbmcHosts)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcUsername)%>
-
<%=Html.TextBoxFor(m => m.XbmcUsername)%>
-
-
<%=Html.ValidationMessageFor(m => m.XbmcUsername)%>
-
- -
-
-
<%=Html.LabelFor(m => m.XbmcPassword)%>
-
<%=Html.TextBoxFor(m => m.XbmcPassword)%>
-
-
<%=Html.ValidationMessageFor(m => m.XbmcPassword)%>
-
-
- - - - <% - }%> -
-
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/Notifications.cshtml b/NzbDrone.Web/Views/Settings/Notifications.cshtml new file mode 100644 index 000000000..6e86784f0 --- /dev/null +++ b/NzbDrone.Web/Views/Settings/Notifications.cshtml @@ -0,0 +1,161 @@ +@model NzbDrone.Web.Models.NotificationSettingsModel + + + +@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new {id = "form", name = "form"})) +{ +
+ Notification Settings + +
+ XBMC +
+
+
@Html.LabelFor(m => m.XbmcEnabled)
+
@Html.CheckBoxFor(m => m.XbmcEnabled)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcEnabled)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcNotifyOnGrab)
+
@Html.CheckBoxFor(m => m.XbmcNotifyOnGrab)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcNotifyOnGrab)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcNotifyOnDownload)
+
@Html.CheckBoxFor(m => m.XbmcNotifyOnDownload)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcNotifyOnDownload)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcNotifyOnRename)
+
@Html.CheckBoxFor(m => m.XbmcNotifyOnRename)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcNotifyOnRename)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcNotificationImage)
+
@Html.CheckBoxFor(m => m.XbmcNotificationImage)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcNotificationImage)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcDisplayTime)
+
@Html.TextBoxFor(m => m.XbmcDisplayTime)
+
+
@Html.ValidationMessageFor(m => m.XbmcDisplayTime)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcUpdateOnDownload)
+
@Html.CheckBoxFor(m => m.XbmcUpdateOnDownload)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcUpdateOnDownload)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcUpdateOnRename)
+
@Html.CheckBoxFor(m => m.XbmcUpdateOnRename)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcUpdateOnRename)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcFullUpdate)
+
@Html.CheckBoxFor(m => m.XbmcFullUpdate)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcFullUpdate)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcCleanOnDownload)
+
@Html.CheckBoxFor(m => m.XbmcCleanOnDownload)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcCleanOnDownload)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcCleanOnRename)
+
@Html.CheckBoxFor(m => m.XbmcCleanOnRename)
+ +
+
@Html.ValidationMessageFor(m => m.XbmcCleanOnRename)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcHosts)
+
@Html.TextBoxFor(m => m.XbmcHosts)
+
+
@Html.ValidationMessageFor(m => m.XbmcHosts)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcUsername)
+
@Html.TextBoxFor(m => m.XbmcUsername)
+
+
@Html.ValidationMessageFor(m => m.XbmcUsername)
+
+ +
+
+
@Html.LabelFor(m => m.XbmcPassword)
+
@Html.TextBoxFor(m => m.XbmcPassword)
+
+
@Html.ValidationMessageFor(m => m.XbmcPassword)
+
+
+ + + +
+} +
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/Quality.ascx b/NzbDrone.Web/Views/Settings/Quality.cshtml similarity index 66% rename from NzbDrone.Web/Views/Settings/Quality.ascx rename to NzbDrone.Web/Views/Settings/Quality.cshtml index e98c4f3b9..2436ebe88 100644 --- a/NzbDrone.Web/Views/Settings/Quality.ascx +++ b/NzbDrone.Web/Views/Settings/Quality.cshtml @@ -1,4 +1,4 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> +@model NzbDrone.Web.Models.QualityModel - <% - Html.EnableClientValidation();%> - <% - using (Html.BeginForm("SaveQuality", "Settings", FormMethod.Post, new {id = "form", name = "form"})) - {%> +@using (Html.BeginForm("SaveQuality", "Settings", FormMethod.Post, new {id = "form", name = "form"})) +{
- Quality - <%--<%: Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") %>--%> + Quality
-
<%=Html.LabelFor(m => m.DefaultQualityProfileId)%>
-
<%:Html.DropDownListFor(m => m.DefaultQualityProfileId, Model.SelectList)%>
-
<%=Html.ValidationMessageFor(m => m.DefaultQualityProfileId)%>
+
@Html.LabelFor(m => m.DefaultQualityProfileId)
+
@Html.DropDownListFor(m => m.DefaultQualityProfileId, Model.SelectList)
+
@Html.ValidationMessageFor(m => m.DefaultQualityProfileId)
@@ -49,19 +44,17 @@
- <% - foreach (var item in Model.UserProfiles) - {%> - <% - Html.RenderPartial("UserProfileSection", item);%> - <% - }%> + + @foreach (var item in Model.UserProfiles) + { + Html.RenderPartial("UserProfileSection", item); + }
@@ -71,9 +64,7 @@
- - <% - }%> +}
- -
- -
- -
-

<%=Html.DisplayTextFor(m => m.Name)%>

- Delete -
- -
-
<%=Html.LabelFor(x => x.Name)%>
-
<%=Html.TextBoxFor(x => x.Name)%>
-
<%=Html.ValidationMessageFor(x => x.Name)%>
-
- -
-
-

Allowed

-
    - <% - if (Model.Allowed != null) - {%> - <% - for (int i = 0; i < Model.Allowed.Count(); i++) - {%> -
  • - <%=Html.RadioButtonFor(x => x.Cutoff, Model.Allowed[i])%> - <%=Html.DisplayTextFor(c => c.Allowed[i])%> -
  • - <% - }%> - <% - }%> -
-
- -
-

Not-Allowed

-
    - <% - var qualitiesList = (List) ViewData["Qualities"];%> - - <% - for (int i = 0; i < qualitiesList.Count(); i++) - {%> - <% - //Skip Unknown and any item that is in the allowed list - if (qualitiesList[i].ToString() == "Unknown") - continue; - - if (Model.Allowed != null) - { - if (Model.Allowed.Contains(qualitiesList[i])) - continue; - } -%> - -
  • - <%=Html.RadioButtonFor(x => x.Cutoff, qualitiesList[i])%> - <%=Html.Label(qualitiesList[i].ToString())%> -
  • - - <% - }%> -
-
-
- - <%=Html.ValidationMessageFor(x => x.Cutoff)%> - -
- <%=Html.TextBoxFor(x => x.QualityProfileId, new {@style = "display:none"})%> - <%=Html.CheckBoxFor(x => x.UserProfile, new {@style = "display:none"})%> - <%=Html.TextBoxFor(m => m.AllowedString, new {@style = "display:none"})%> -
-
-
- - - -<% - }%> \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml b/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml new file mode 100644 index 000000000..a730e3e45 --- /dev/null +++ b/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml @@ -0,0 +1,129 @@ +@model NzbDrone.Core.Repository.Quality.QualityProfile +@using NzbDrone.Core.Repository.Quality +@using NzbDrone.Web.Helpers + +@using (Html.BeginCollectionItem("UserProfiles")) +{ + + var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_'); + + string sortable1 = String.Format("{0}_sortable1", idClean); + string sortable2 = String.Format("{0}_sortable2", idClean); + string allowedStringName = String.Format("{0}_AllowedString", idClean); + string connectedSortable = String.Format("connected{0}", idClean); + string title = String.Format("{0}_Title", idClean); + string nameBox = String.Format("{0}_Name", idClean); + + + + + +
+ +
+ +
+

<@Html.DisplayTextFor(m => m.Name)

+ Delete +
+ +
+
@Html.LabelFor(x => x.Name)
+
@Html.TextBoxFor(x => x.Name)
+
@Html.ValidationMessageFor(x => x.Name)
+
+ +
+
+

Allowed

+
    + @if (Model.Allowed != null) + { + for (int i = 0; i < Model.Allowed.Count(); i++) + { +
  • + @Html.RadioButtonFor(x => x.Cutoff, Model.Allowed[i]) + @Html.DisplayTextFor(c => c.Allowed[i]) +
  • + } + } +
+
+ +
+

Not-Allowed

+
    + + @{var qualitiesList = (List)ViewData["Qualities"];} + + @for (int i = 0; i < qualitiesList.Count(); i++) + { + //Skip Unknown and any item that is in the allowed list + if (qualitiesList[i].ToString() == "Unknown") + { + continue; + } + + if (Model.Allowed != null) + { + if (Model.Allowed.Contains(qualitiesList[i])) + { + continue; + } + } + +
  • + @Html.RadioButtonFor(x => x.Cutoff, qualitiesList[i]) + @Html.Label(qualitiesList[i].ToString()) +
  • + } +
+
+
+ + @Html.ValidationMessageFor(x => x.Cutoff) + +
+ @Html.TextBoxFor(x => x.QualityProfileId, new { @style = "display:none" }) + @Html.CheckBoxFor(x => x.UserProfile, new { @style = "display:none" }) + @Html.TextBoxFor(m => m.AllowedString, new { @style = "display:none" }) +
+
+
+ + +} \ No newline at end of file From b8a3b58c796db5118468a88deef280e0faf4746c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 20 Apr 2011 19:28:40 -0700 Subject: [PATCH 2/3] Footer has been RAZOR'd. --- .../Views/Shared/{Footer.ascx => Footer.cshtml} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename NzbDrone.Web/Views/Shared/{Footer.ascx => Footer.cshtml} (59%) diff --git a/NzbDrone.Web/Views/Shared/Footer.ascx b/NzbDrone.Web/Views/Shared/Footer.cshtml similarity index 59% rename from NzbDrone.Web/Views/Shared/Footer.ascx rename to NzbDrone.Web/Views/Shared/Footer.cshtml index 7a4bb3ac0..a7731928f 100644 --- a/NzbDrone.Web/Views/Shared/Footer.ascx +++ b/NzbDrone.Web/Views/Shared/Footer.cshtml @@ -1,6 +1,4 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> - - -<%--
RSS Sync:
--%> +@*
RSS Sync:
*@
RSS Sync:
- \ No newline at end of file + \ No newline at end of file From d3d138c2af689c3ed3256a788e758699b3fcf6a1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 20 Apr 2011 20:52:09 -0700 Subject: [PATCH 3/3] Master page for RAZOR views created and will be auto inherited by pages. Settings have been RAZORfied. --- NzbDrone.Web/NzbDrone.Web.csproj | 22 +++---- NzbDrone.Web/Views/Settings/Index.aspx | 18 ------ NzbDrone.Web/Views/Settings/Index.cshtml | 13 ++++ NzbDrone.Web/Views/Settings/Quality.cshtml | 1 - NzbDrone.Web/Views/Settings/SubMenu.cshtml | 2 +- .../Views/Settings/UserProfileSection.cshtml | 24 ++++---- NzbDrone.Web/Views/Shared/SiteLayout.cshtml | 59 +++++++++++++++++++ NzbDrone.Web/Views/_ViewStart.cshtml | 3 + 8 files changed, 100 insertions(+), 42 deletions(-) delete mode 100644 NzbDrone.Web/Views/Settings/Index.aspx create mode 100644 NzbDrone.Web/Views/Settings/Index.cshtml create mode 100644 NzbDrone.Web/Views/Shared/SiteLayout.cshtml create mode 100644 NzbDrone.Web/Views/_ViewStart.cshtml diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 7941ec777..af29bd968 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -624,16 +624,7 @@ - - - - - - - - - - + Designer @@ -665,6 +656,17 @@ + + + + + + + + + + +
diff --git a/NzbDrone.Web/Views/Settings/Index.aspx b/NzbDrone.Web/Views/Settings/Index.aspx deleted file mode 100644 index 94128dffa..000000000 --- a/NzbDrone.Web/Views/Settings/Index.aspx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - - - Settings - - - - - <% - Html.RenderPartial("SubMenu");%> - - - - - - <% - Html.RenderPartial(ViewData["viewName"].ToString());%> - diff --git a/NzbDrone.Web/Views/Settings/Index.cshtml b/NzbDrone.Web/Views/Settings/Index.cshtml new file mode 100644 index 000000000..7da7aa1ba --- /dev/null +++ b/NzbDrone.Web/Views/Settings/Index.cshtml @@ -0,0 +1,13 @@ +@section TitleContent{ + Settings +} + +@section ActionMenu{ + @{Html.RenderPartial("SubMenu");} +} + +@section MainContent{ + + + @{Html.RenderPartial(ViewData["viewName"].ToString());} +} diff --git a/NzbDrone.Web/Views/Settings/Quality.cshtml b/NzbDrone.Web/Views/Settings/Quality.cshtml index 2436ebe88..c65215dc9 100644 --- a/NzbDrone.Web/Views/Settings/Quality.cshtml +++ b/NzbDrone.Web/Views/Settings/Quality.cshtml @@ -24,7 +24,6 @@ } - @using (Html.BeginForm("SaveQuality", "Settings", FormMethod.Post, new {id = "form", name = "form"})) {
diff --git a/NzbDrone.Web/Views/Settings/SubMenu.cshtml b/NzbDrone.Web/Views/Settings/SubMenu.cshtml index 3f675ed33..e796bb556 100644 --- a/NzbDrone.Web/Views/Settings/SubMenu.cshtml +++ b/NzbDrone.Web/Views/Settings/SubMenu.cshtml @@ -1,4 +1,4 @@ -@{Html.Telerik().Menu().Name("Menu").Items(items => +@{Html.Telerik().Menu().Name("SubMenu").Items(items => { items.Add().Text("General").Action("General", "Settings"); items.Add().Text("Indexers").Action("Indexers", "Settings"); diff --git a/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml b/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml index a730e3e45..04701f15f 100644 --- a/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml +++ b/NzbDrone.Web/Views/Settings/UserProfileSection.cshtml @@ -28,19 +28,19 @@ } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/SiteLayout.cshtml b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml new file mode 100644 index 000000000..fed6c00c5 --- /dev/null +++ b/NzbDrone.Web/Views/Shared/SiteLayout.cshtml @@ -0,0 +1,59 @@ +@using Helpers; + + + + + + + NZBDrone + @{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css") + .Add("telerik.sitefinity.css") + .Add("notibar.css")) + .Render();} + + + + + @**@ + @**@ + @**@ + + @RenderSection("HeaderContent", required: false) + + +
+ + +
+ @RenderSection("ActionMenu", required: false) + @RenderSection("MainContent", required: false) + @RenderBody() +
+ +
+ Scanning Series Folder... +
+
+ + @{Html.Telerik().ScriptRegistrar().Scripts( + c => c.Add("jquery-ui-1.8.8.min.js") + .Add("jquery.form.js") + .Add("jquery.jgrowl.js") + .Add("Notification.js") + .Add("jquery-tgc-countdown-1.0.js") + .Add("MicrosoftAjax.js") + .Add("MicrosoftMvcValidation.js")) + .Render();} + diff --git a/NzbDrone.Web/Views/_ViewStart.cshtml b/NzbDrone.Web/Views/_ViewStart.cshtml new file mode 100644 index 000000000..bf880d908 --- /dev/null +++ b/NzbDrone.Web/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/SiteLayout.cshtml"; +}