From bae2cdc1c7c85cd03ffd2d66d80922870aa22873 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 29 Nov 2011 16:45:45 -0800 Subject: [PATCH] Moved from Tabs to Accordion for Notifiers Indexers is the first item in Settings SubMenu (its the default). --- NzbDrone.Web/Content/Settings.css | 9 +- NzbDrone.Web/Views/Settings/Indexers.cshtml | 20 --- .../Views/Settings/Notifications.cshtml | 130 +++++++++++++----- NzbDrone.Web/Views/Settings/Smtp.cshtml | 47 +------ NzbDrone.Web/Views/Settings/SubMenu.cshtml | 2 +- NzbDrone.Web/Views/Settings/Twitter.cshtml | 38 +---- 6 files changed, 98 insertions(+), 148 deletions(-) diff --git a/NzbDrone.Web/Content/Settings.css b/NzbDrone.Web/Content/Settings.css index d931b1fa6..f42128c96 100644 --- a/NzbDrone.Web/Content/Settings.css +++ b/NzbDrone.Web/Content/Settings.css @@ -9,17 +9,10 @@ p, h1, form, button{border:0; margin:0; padding:0;} .settingsForm { - /*margin:0 auto;*/ - width: 600px; + width: 620px; padding: 14px; } -#stylized -{ - /*border:solid 2px #b7ddf2; - background:#ebf4fb;*/ -} - #stylized h1 { font-size:20px; diff --git a/NzbDrone.Web/Views/Settings/Indexers.cshtml b/NzbDrone.Web/Views/Settings/Indexers.cshtml index c3e7e4c86..09628042c 100644 --- a/NzbDrone.Web/Views/Settings/Indexers.cshtml +++ b/NzbDrone.Web/Views/Settings/Indexers.cshtml @@ -7,26 +7,6 @@ .indexerPanel { overflow: auto; - padding-top: 20px; - } - - .additionalInfo - { - float: right; - margin-top: 20px; - margin-right: 40px; - font-size: 120%; - font-weight: bold; - } - - #stylized .indexerPanel .labelClass - { - width: 320px; - } - - #stylized .indexerPanel .small - { - width: 320px; } } diff --git a/NzbDrone.Web/Views/Settings/Notifications.cshtml b/NzbDrone.Web/Views/Settings/Notifications.cshtml index 445dbc8eb..af147d686 100644 --- a/NzbDrone.Web/Views/Settings/Notifications.cshtml +++ b/NzbDrone.Web/Views/Settings/Notifications.cshtml @@ -7,9 +7,6 @@ } @@ -48,30 +43,22 @@ @section MainContent{
@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" })) - { -
- -
- @{Html.RenderPartial("Xbmc", Model);} -
-
- @{Html.RenderPartial("Smtp", Model);} -
-
- @{Html.RenderPartial("Twitter", Model);} -
-
- @{Html.RenderPartial("Growl", Model);} -
-
- @{Html.RenderPartial("Prowl", Model);} -
+ { +
+

XBMC

+ @{Html.RenderPartial("Xbmc", Model);} + +

SMTP

+ @{Html.RenderPartial("Smtp", Model);} + +

Twitter

+ @{Html.RenderPartial("Twitter", Model);} + +

Growl

+ @{Html.RenderPartial("Growl", Model);} + +

Prowl

+ @{Html.RenderPartial("Prowl", Model);}
@@ -84,7 +71,76 @@ + + //Twitter + getAuthorizationUrl = '../Command/GetTwitterAuthorization'; + verifyAuthorizationUrl = '../Command/VerifyTwitterAuthorization'; + + function requestTwitterAuthorization() { + $.ajax({ + type: "GET", + url: getAuthorizationUrl, + error: function(req, status, error) { + alert("Sorry! We could get Twitter Authorization at this time. " + error); + }, + success: function(data, textStatus, jqXHR) { + if (data.IsMessage) + return false; + + $('#authorizationRequestToken').val(data.Token); + window.open(data.Url); + } + }); + } + + function verifyTwitterAuthorization() { + var token = $('#authorizationRequestToken').val(); + var verifier = $('#twitterVerification').val(); + + $.ajax({ + type: "GET", + url: verifyAuthorizationUrl, + data: jQuery.param({ token: token, verifier: verifier }), + error: function(req, status, error) { + alert("Sorry! We could verify Twitter Authorization at this time. " + error); + } + }); + } + + //SMTP + function testSmtpSettings() { + //Get the variables + var server = $('#SmtpServer').val(); + var port = $('#SmtpPort').val(); + var ssl = $('#SmtpUseSsl').val(); + var username = $('#SmtpUsername').val(); + var password = $('#SmtpPassword').val(); + var fromAddress = $('#SmtpFromAddress').val(); + var toAddresses = $('#SmtpToAddresses').val(); + + //Send the data! + $.ajax({ + type: "POST", + url: '../Command/SendTestEmail', + data: jQuery.param({ + server: server, + port: port, + ssl: ssl, + username: username, + password: password, + fromAddress: fromAddress, + toAddresses: toAddresses + }), + error: function (req, status, error) { + alert("Sorry! We could send a test email at this time. " + error); + } + }); + + return false; + } + } diff --git a/NzbDrone.Web/Views/Settings/Smtp.cshtml b/NzbDrone.Web/Views/Settings/Smtp.cshtml index 72bbda310..533643d2b 100644 --- a/NzbDrone.Web/Views/Settings/Smtp.cshtml +++ b/NzbDrone.Web/Views/Settings/Smtp.cshtml @@ -55,49 +55,6 @@ @Html.DescriptionFor(m => m.SmtpToAddresses) @Html.TextBoxFor(m => m.SmtpToAddresses, new { @class = "inputClass" }) -
- - -@*Move this somewhere better*@ - - - \ No newline at end of file + +
\ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/SubMenu.cshtml b/NzbDrone.Web/Views/Settings/SubMenu.cshtml index f55d5bb49..c46ac03b7 100644 --- a/NzbDrone.Web/Views/Settings/SubMenu.cshtml +++ b/NzbDrone.Web/Views/Settings/SubMenu.cshtml @@ -1,8 +1,8 @@  diff --git a/NzbDrone.Web/Views/Settings/Twitter.cshtml b/NzbDrone.Web/Views/Settings/Twitter.cshtml index 51079af87..dac35b055 100644 --- a/NzbDrone.Web/Views/Settings/Twitter.cshtml +++ b/NzbDrone.Web/Views/Settings/Twitter.cshtml @@ -37,40 +37,4 @@ @Html.Hidden("authorizationRequestToken") - - - \ No newline at end of file + \ No newline at end of file