Moved from Tabs to Accordion for Notifiers

Indexers is the first item in Settings SubMenu (its the default).
This commit is contained in:
Mark McDowall 2011-11-29 16:45:45 -08:00
parent 168f83dc38
commit bae2cdc1c7
6 changed files with 99 additions and 149 deletions

View File

@ -9,17 +9,10 @@ p, h1, form, button{border:0; margin:0; padding:0;}
.settingsForm .settingsForm
{ {
/*margin:0 auto;*/ width: 620px;
width: 600px;
padding: 14px; padding: 14px;
} }
#stylized
{
/*border:solid 2px #b7ddf2;
background:#ebf4fb;*/
}
#stylized h1 #stylized h1
{ {
font-size:20px; font-size:20px;

View File

@ -7,26 +7,6 @@
.indexerPanel .indexerPanel
{ {
overflow: auto; 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;
} }
</style> </style>
} }

View File

@ -7,9 +7,6 @@
<style> <style>
.notifier .notifier
{ {
width: 560px;
padding: 5px;
margin-left: -8px;
overflow: auto; overflow: auto;
} }
@ -21,19 +18,17 @@
padding-top: 3px; padding-top: 3px;
} }
.notifierLine
{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #CCCCCD;
padding-bottom:10px;
}
#save_button #save_button
{ {
margin-top: 10px; margin-top: 10px;
} }
#smtpTest
{
margin-top: 10px;
margin-bottom: 10px;
margin-left: 220px;
}
</style> </style>
} }
@ -49,30 +44,22 @@
<div id="stylized"> <div id="stylized">
@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" })) @using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
{ {
<div id="tabs"> <div id="accordion">
<ul> <h3><a href="#">XBMC</a></h3>
<li><a href="#tabs-xbmc">XBMC</a></li>
<li><a href="#tabs-smtp">SMTP</a></li>
<li><a href="#tabs-twitter">Twitter</a></li>
<li><a href="#tabs-growl">Growl</a></li>
<li><a href="#tabs-prowl">Prowl</a></li>
</ul>
<div id="tabs-xbmc">
@{Html.RenderPartial("Xbmc", Model);} @{Html.RenderPartial("Xbmc", Model);}
</div>
<div id="tabs-smtp"> <h3><a href="#">SMTP</a></h3>
@{Html.RenderPartial("Smtp", Model);} @{Html.RenderPartial("Smtp", Model);}
</div>
<div id="tabs-twitter"> <h3><a href="#">Twitter</a></h3>
@{Html.RenderPartial("Twitter", Model);} @{Html.RenderPartial("Twitter", Model);}
</div>
<div id="tabs-growl"> <h3><a href="#">Growl</a></h3>
@{Html.RenderPartial("Growl", Model);} @{Html.RenderPartial("Growl", Model);}
</div>
<div id="tabs-prowl"> <h3><a href="#">Prowl</a></h3>
@{Html.RenderPartial("Prowl", Model);} @{Html.RenderPartial("Prowl", Model);}
</div> </div>
</div>
<button type="submit" id="save_button" disabled="disabled">Save</button> <button type="submit" id="save_button" disabled="disabled">Save</button>
} }
@ -84,7 +71,76 @@
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$("#tabs").tabs(); $("#accordion").accordion({
autoHeight: false
}); });
});
//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;
}
</script> </script>
} }

View File

@ -55,49 +55,6 @@
<span class="small">@Html.DescriptionFor(m => m.SmtpToAddresses)</span> <span class="small">@Html.DescriptionFor(m => m.SmtpToAddresses)</span>
</label> </label>
@Html.TextBoxFor(m => m.SmtpToAddresses, new { @class = "inputClass" }) @Html.TextBoxFor(m => m.SmtpToAddresses, new { @class = "inputClass" })
</div>
<input type="button" onclick="testSmtpSettings();" value="Test SMTP" id="smtpTest"/> <input type="button" onclick="testSmtpSettings();" value="Test SMTP" id="smtpTest"/>
</div>
@*Move this somewhere better*@
<style>
#smtpTest
{
margin-top: 10px;
margin-bottom: 10px;
margin-left: 220px;
}
</style>
<script type="text/javascript">
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;
}
</script>

View File

@ -1,8 +1,8 @@
<ul class="sub-menu"> <ul class="sub-menu">
<li>@Html.ActionLink("Indexers", "Indexers", "Settings")</li>
<li>@Html.ActionLink("Quality", "Quality", "Settings")</li> <li>@Html.ActionLink("Quality", "Quality", "Settings")</li>
<li>@Html.ActionLink("Naming", "Naming", "Settings")</li> <li>@Html.ActionLink("Naming", "Naming", "Settings")</li>
<li>@Html.ActionLink("Notifications", "Notifications", "Settings")</li> <li>@Html.ActionLink("Notifications", "Notifications", "Settings")</li>
<li>@Html.ActionLink("Indexers", "Indexers", "Settings")</li>
<li>@Html.ActionLink("SABnzbd", "Sabnzbd", "Settings")</li> <li>@Html.ActionLink("SABnzbd", "Sabnzbd", "Settings")</li>
<li>@Html.ActionLink("System", "System", "Settings")</li> <li>@Html.ActionLink("System", "System", "Settings")</li>
</ul> </ul>

View File

@ -38,39 +38,3 @@
@Html.Hidden("authorizationRequestToken") @Html.Hidden("authorizationRequestToken")
</div> </div>
<script type="text/javascript">
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);
}
});
}
</script>