From 5ed53008c6ff37ecf78026a66a3a27126831cdc3 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 14 Apr 2012 17:04:08 -0700 Subject: [PATCH] NzbIndex and NzbClub added to the UI. --- .../Content/Images/Indexers/NzbClub.png | Bin 0 -> 603 bytes .../Content/Images/Indexers/NzbIndex.png | Bin 0 -> 260 bytes .../Controllers/SettingsController.cs | 10 ++++++ NzbDrone.Web/Models/IndexerSettingsModel.cs | 8 +++++ NzbDrone.Web/NzbDrone.Web.csproj | 5 +++ NzbDrone.Web/Views/Settings/Indexers.cshtml | 34 ++++++++++++++++++ 6 files changed, 57 insertions(+) create mode 100644 NzbDrone.Web/Content/Images/Indexers/NzbClub.png create mode 100644 NzbDrone.Web/Content/Images/Indexers/NzbIndex.png diff --git a/NzbDrone.Web/Content/Images/Indexers/NzbClub.png b/NzbDrone.Web/Content/Images/Indexers/NzbClub.png new file mode 100644 index 0000000000000000000000000000000000000000..1f68226ad91d330b751b3cc54d0cd2b1268d1f35 GIT binary patch literal 603 zcmV-h0;K(kP)mv$%JLALrb|P#nidRuBXl0HH@Ir9vUZ zb}y5cl}e@m;lkvP?EV3fm4}fMX%GmJYogrxgWpjB_XZxE%N@&o=?YjatemK1i+xet z;JRFg;XW`3p$kx@4OG>J`&IjSDu*5b#BhuGMbvBcuJTRF!<`}PlCus#%Jb_K6NtL6 zfS6%~UrWw7+4#nKowfG<9wt_-&ZE!aK{0+4jLWh;*B}V=laG&P-bHg04wjkQeCJ{i!Cj#7&r?^XZ)Nsns$BurS~%y#%TG_I z=fj!FSULs(a^xKl+qew0^j#H$4*{-)xVNmYy52-7#SL!Pp8v$V@xQeY;{JvD{pJ< pmTxDVa{$21?3mdCKvF&c`~!d=(y#8u9)|z`002ovPDHLkV1hJ$80`Q6 literal 0 HcmV?d00001 diff --git a/NzbDrone.Web/Content/Images/Indexers/NzbIndex.png b/NzbDrone.Web/Content/Images/Indexers/NzbIndex.png new file mode 100644 index 0000000000000000000000000000000000000000..d465fa3522f69e358ee2fd90619b5bb02e5a21d2 GIT binary patch literal 260 zcmV+f0sH=mP)ST5JewRdc+E>Kq_h&ffbUHl8lg)v|b@AxTXptzz9KXkOH6d<%9wFl4a}r?)mFv zIJ}ayY&+lqJOKwxz#XW22eFEI1!S+jlH44b07ft3lfsb}R z?Gyu$mTd+!fM17x5x=lBF`(H2dhv4L4JXI?qD0@hwVQ&j;}8XPdK20$p@4G0000< KMNUMnLSTaXj%H{8 literal 0 HcmV?d00001 diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 99bf5e183..9ef4f447d 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -83,6 +83,8 @@ namespace NzbDrone.Web.Controllers NewznabEnabled = _indexerProvider.GetSettings(typeof(Newznab)).Enable, WomblesEnabled = _indexerProvider.GetSettings(typeof(Wombles)).Enable, FileSharingTalkEnabled = _indexerProvider.GetSettings(typeof(FileSharingTalk)).Enable, + NzbIndexEnabled = _indexerProvider.GetSettings(typeof(NzbIndex)).Enable, + NzbClubEnabled = _indexerProvider.GetSettings(typeof(NzbClub)).Enable, NewznabDefinitions = _newznabProvider.All(), }); @@ -376,6 +378,14 @@ namespace NzbDrone.Web.Controllers fileSharingTalkSettings.Enable = data.FileSharingTalkEnabled; _indexerProvider.SaveSettings(fileSharingTalkSettings); + var nzbIndexSettings = _indexerProvider.GetSettings(typeof(NzbIndex)); + nzbIndexSettings.Enable = data.NzbIndexEnabled; + _indexerProvider.SaveSettings(nzbIndexSettings); + + var nzbClubSettings = _indexerProvider.GetSettings(typeof(NzbClub)); + nzbClubSettings.Enable = data.NzbClubEnabled; + _indexerProvider.SaveSettings(nzbClubSettings); + _configProvider.NzbsOrgUId = data.NzbsOrgUId; _configProvider.NzbsOrgHash = data.NzbsOrgHash; diff --git a/NzbDrone.Web/Models/IndexerSettingsModel.cs b/NzbDrone.Web/Models/IndexerSettingsModel.cs index 45e3969e4..58d734b4a 100644 --- a/NzbDrone.Web/Models/IndexerSettingsModel.cs +++ b/NzbDrone.Web/Models/IndexerSettingsModel.cs @@ -107,6 +107,14 @@ namespace NzbDrone.Web.Models [Description("Enable downloading episodes from File Sharing Talk")] public bool FileSharingTalkEnabled { get; set; } + [DisplayName("NzbIndex")] + [Description("Enable downloading episodes from NzbIndex")] + public bool NzbIndexEnabled { get; set; } + + [DisplayName("NzbClub")] + [Description("Enable downloading episodes from NzbClub")] + public bool NzbClubEnabled { get; set; } + [Required(ErrorMessage = "Please enter a valid number of days")] [DataType(DataType.Text)] [DisplayName("Retention")] diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 2c4476078..92dac587e 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -147,12 +147,17 @@ + + + + + diff --git a/NzbDrone.Web/Views/Settings/Indexers.cshtml b/NzbDrone.Web/Views/Settings/Indexers.cshtml index 61be0559d..42a9525fb 100644 --- a/NzbDrone.Web/Views/Settings/Indexers.cshtml +++ b/NzbDrone.Web/Views/Settings/Indexers.cshtml @@ -30,6 +30,12 @@ @Html.CheckBox("fileSharingTalkStatus", @Model.FileSharingTalkEnabled, new { @class = "indexerStatusButton" }) + + @Html.CheckBox("nzbIndexStatus", @Model.NzbIndexEnabled, new { @class = "indexerStatusButton" }) + + + @Html.CheckBox("nzbClubStatus", @Model.NzbClubEnabled, new { @class = "indexerStatusButton" }) +
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "IndexersForm", name = "IndexersForm", @class = "settingsForm" })) @@ -157,6 +163,22 @@ @Html.TextBoxFor(m => m.FileSharingTalkSecret, new { @class = "inputClass" })
+ +

NzbIndex

+
+ + @Html.CheckBoxFor(m => m.NzbIndexEnabled, new { @class = "inputClass checkClass enabledCheck" }) +
+ +

NzbClub

+
+ + @Html.CheckBoxFor(m => m.NzbClubEnabled, new { @class = "inputClass checkClass enabledCheck" }) +
@@ -226,6 +248,12 @@ if (id == 'FileSharingTalkEnabled') $('#fileSharingTalkStatus').prop('checked', checked); + + if (id == 'NzbIndexEnabled') + $('#nzbIndexStatus').prop('checked', checked); + + if (id == 'NzbClubEnabled') + $('#nzbClubStatus').prop('checked', checked); $('.indexerStatusButton').button("refresh"); reValidate(); @@ -255,6 +283,12 @@ if (id == 'fileSharingTalkStatus') $('#FileSharingTalkEnabled').prop('checked', checked); + + if (id == 'nzbIndexStatus') + $('#NzbIndexEnabled').prop('checked', checked); + + if (id == 'nzbClubStatus') + $('#NzbClubEnabled').prop('checked', checked); reValidate(); });