Settings views all cleaned up.

pull/4/head
Mark McDowall 14 years ago
parent 96f3423990
commit dc44a81099

@ -43,6 +43,7 @@ p, h1, form, button{border:0; margin:0; padding:0;}
text-align:right; text-align:right;
width:340px; width:340px;
float:left; float:left;
margin-bottom: -10px;
} }
#stylized .small #stylized .small
@ -70,6 +71,11 @@ p, h1, form, button{border:0; margin:0; padding:0;}
width: 206px; width: 206px;
} }
#stylized .checkClass
{
margin:10px 0 10px 10px;
}
#stylized button #stylized button
{ {
clear:both; clear:both;

@ -56,22 +56,14 @@ namespace NzbDrone.Web.Controllers
return View(); return View();
} }
public ActionResult Index(string viewName) public ActionResult Index()
{ {
if (viewName != null)
ViewData["viewName"] = viewName;
else
return RedirectToAction("Indexers"); return RedirectToAction("Indexers");
return View("Index");
} }
public ActionResult Indexers() public ActionResult Indexers()
{ {
ViewData["viewName"] = "Indexers"; return View(new IndexerSettingsModel
return View("Index", new IndexerSettingsModel
{ {
NzbMatrixUsername = _configProvider.NzbMatrixUsername, NzbMatrixUsername = _configProvider.NzbMatrixUsername,
NzbMatrixApiKey = _configProvider.NzbMatrixApiKey, NzbMatrixApiKey = _configProvider.NzbMatrixApiKey,
@ -146,8 +138,6 @@ namespace NzbDrone.Web.Controllers
public ActionResult Notifications() public ActionResult Notifications()
{ {
ViewData["viewName"] = "Notifications";
var model = new NotificationSettingsModel var model = new NotificationSettingsModel
{ {
XbmcEnabled = Convert.ToBoolean(_configProvider.GetValue("XbmcEnabled", false)), XbmcEnabled = Convert.ToBoolean(_configProvider.GetValue("XbmcEnabled", false)),
@ -166,13 +156,11 @@ namespace NzbDrone.Web.Controllers
XbmcPassword = _configProvider.GetValue("XbmcPassword", String.Empty) XbmcPassword = _configProvider.GetValue("XbmcPassword", String.Empty)
}; };
return View("Index", model); return View(model);
} }
public ActionResult EpisodeSorting() public ActionResult EpisodeSorting()
{ {
ViewData["viewName"] = "EpisodeSorting";
var model = new EpisodeSortingModel(); var model = new EpisodeSortingModel();
model.SeriesName = _configProvider.SeriesName; model.SeriesName = _configProvider.SeriesName;
@ -189,7 +177,7 @@ namespace NzbDrone.Web.Controllers
model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name"); model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name");
model.MultiEpisodeStyles = new SelectList(EpisodeSortingHelper.GetMultiEpisodeStyles(), "Id", "Name"); model.MultiEpisodeStyles = new SelectList(EpisodeSortingHelper.GetMultiEpisodeStyles(), "Id", "Name");
return View("Index", model); return View(model);
} }
public ViewResult AddProfile() public ViewResult AddProfile()

@ -10,54 +10,66 @@ namespace NzbDrone.Web.Models
{ {
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Username")] [DisplayName("Username")]
[Description("Username for NZB Matrix")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbMatrixUsername { get; set; } public String NzbMatrixUsername { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("API Key")] [DisplayName("API Key")]
[Description("API Key for NZB Matrix")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbMatrixApiKey { get; set; } public String NzbMatrixApiKey { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("UID")] [DisplayName("UID")]
[Description("User ID for Nzbs.org")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbsOrgUId { get; set; } public String NzbsOrgUId { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Hash")] [DisplayName("Hash")]
[Description("Hash for Nzbs.org")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbsOrgHash { get; set; } public String NzbsOrgHash { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("UID")] [DisplayName("UID")]
[Description("User ID for NZBsRus")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbsrusUId { get; set; } public String NzbsrusUId { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Hash")] [DisplayName("Hash")]
[Description("Hash for NZBsRus")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NzbsrusHash { get; set; } public String NzbsrusHash { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Username")] [DisplayName("Username")]
[Description("Username for Newzbin")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NewzbinUsername { get; set; } public String NewzbinUsername { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Password")] [DisplayName("Password")]
[Description("Password for Newzbin")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public String NewzbinPassword { get; set; } public String NewzbinPassword { get; set; }
[DisplayName("NZBs.org")] [DisplayName("NZBs.org")]
[Description("Scan Nzbs.org for new epsiodes")]
public bool NzbsOrgEnabled { get; set; } public bool NzbsOrgEnabled { get; set; }
[DisplayName("NZB Matrix")] [DisplayName("NZB Matrix")]
[Description("Scan NZB Matrix for new epsiodes")]
public bool NzbMatrixEnabled { get; set; } public bool NzbMatrixEnabled { get; set; }
[DisplayName("NZBsRUs")] [DisplayName("NZBsRUs")]
[Description("Scan NZBsRus for new epsiodes")]
public bool NzbsRUsEnabled { get; set; } public bool NzbsRUsEnabled { get; set; }
[DisplayName("Newzbin")] [DisplayName("Newzbin")]
[Description("Scan Newzbin for new epsiodes")]
public bool NewzbinEnabled { get; set; } public bool NewzbinEnabled { get; set; }
} }
} }

@ -6,52 +6,66 @@ namespace NzbDrone.Web.Models
public class NotificationSettingsModel public class NotificationSettingsModel
{ {
[DisplayName("Enabled")] [DisplayName("Enabled")]
[Description("Enable notifications for XBMC?")]
public bool XbmcEnabled { get; set; } public bool XbmcEnabled { get; set; }
[DisplayName("Notify on Grab")] [DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool XbmcNotifyOnGrab { get; set; } public bool XbmcNotifyOnGrab { get; set; }
[DisplayName("Notify on Download")] [DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool XbmcNotifyOnDownload { get; set; } public bool XbmcNotifyOnDownload { get; set; }
[DisplayName("Notify on Rename")] [DisplayName("Notify on Rename")]
[Description("Send notification when episode is renamed?")]
public bool XbmcNotifyOnRename { get; set; } public bool XbmcNotifyOnRename { get; set; }
[DisplayName("Image with Notification")] [DisplayName("Image with Notification")]
[Description("Display NzbDrone image on notifications?")]
public bool XbmcNotificationImage { get; set; } public bool XbmcNotificationImage { get; set; }
[Required] [Required]
[Range(3, 10, ErrorMessage = "Must be between 3 and 10 seconds")] [Range(3, 10, ErrorMessage = "Must be between 3 and 10 seconds")]
[DisplayName("Display Time")] [DisplayName("Display Time")]
[Description("How long the notification should be displayed")]
public int XbmcDisplayTime { get; set; } public int XbmcDisplayTime { get; set; }
[DisplayName("Update on Download")] [DisplayName("Update on Download")]
[Description("Update XBMC library after episode download?")]
public bool XbmcUpdateOnDownload { get; set; } public bool XbmcUpdateOnDownload { get; set; }
[DisplayName("Update on Rename")] [DisplayName("Update on Rename")]
[Description("Update XBMC library after episode is renamed?")]
public bool XbmcUpdateOnRename { get; set; } public bool XbmcUpdateOnRename { get; set; }
[DisplayName("Update on ")] [DisplayName("Full Update")]
[Description("Perform a full update is series update fails?")]
public bool XbmcFullUpdate { get; set; } public bool XbmcFullUpdate { get; set; }
[DisplayName("Clean on Download")] [DisplayName("Clean on Download")]
[Description("Clean XBMC library after episode download?")]
public bool XbmcCleanOnDownload { get; set; } public bool XbmcCleanOnDownload { get; set; }
[DisplayName("Clean on Rename")] [DisplayName("Clean on Rename")]
[Description("Clean XBMC library after episode is renamed?")]
public bool XbmcCleanOnRename { get; set; } public bool XbmcCleanOnRename { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Hosts")] [DisplayName("Hosts")]
[Description("XBMC hosts with port, comma separ")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcHosts { get; set; } public string XbmcHosts { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Username")] [DisplayName("Username")]
[Description("XBMC webserver username")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcUsername { get; set; } public string XbmcUsername { get; set; }
[DataType(DataType.Text)] [DataType(DataType.Text)]
[DisplayName("Password")] [DisplayName("Password")]
[Description("XBMC webserver password")]
[DisplayFormat(ConvertEmptyStringToNull = false)] [DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcPassword { get; set; } public string XbmcPassword { get; set; }
} }

@ -578,6 +578,7 @@
<Content Include="Scripts\2011.1.414\telerik.treeview.min.js" /> <Content Include="Scripts\2011.1.414\telerik.treeview.min.js" />
<Content Include="Scripts\2011.1.414\telerik.upload.min.js" /> <Content Include="Scripts\2011.1.414\telerik.upload.min.js" />
<Content Include="Scripts\2011.1.414\telerik.window.min.js" /> <Content Include="Scripts\2011.1.414\telerik.window.min.js" />
<Content Include="Scripts\settingsForm.js" />
<Content Include="Scripts\doTimeout.js" /> <Content Include="Scripts\doTimeout.js" />
<Content Include="Scripts\episodeSearch.js" /> <Content Include="Scripts\episodeSearch.js" />
<Content Include="Scripts\jquery-1.6.1-vsdoc.js" /> <Content Include="Scripts\jquery-1.6.1-vsdoc.js" />

@ -0,0 +1,22 @@
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
$('#saveAjax').show();
}
function showResponse(responseText, statusText, xhr, $form) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
$('#saveAjax').hide();
}

@ -1,135 +1,97 @@
@using NzbDrone.Web.Helpers @using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.EpisodeSortingModel @model NzbDrone.Web.Models.EpisodeSortingModel
@using (Html.BeginForm("SaveEpisodeSorting", "Settings", FormMethod.Post, new { id = "form", name = "form" }))
{ @section HeaderContent{
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
<style>
#examples
{
margin-bottom: 15px;
}
</style>
}
@section TitleContent{
Settings
}
@section ActionMenu{
@{Html.RenderPartial("SubMenu");}
}
@section MainContent{
<div id="stylized">
@using (Html.BeginForm("SaveEpisodeSorting", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
{
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") @Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
<fieldset> <h1>Episode Sorting</h1>
<legend>Episode Sorting</legend> <p></p>
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.SeriesName)
<div class="config-title">@Html.LabelFor(m => m.SeriesName)</div> <span class="small">@Html.DescriptionFor(m => m.SeriesName)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.SeriesName)</div> </label>
</div> @Html.CheckBoxFor(m => m.SeriesName, new { @class = "inputClass checkClass" })
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeriesName)</div> <label class="labelClass">@Html.LabelFor(m => m.EpisodeName)
<div class="config-description">@Html.DescriptionFor(m => m.SeriesName)</div> <span class="small">@Html.DescriptionFor(m => m.EpisodeName)</span>
</div> </label>
</div> @Html.CheckBoxFor(m => m.EpisodeName, new { @class = "inputClass checkClass" })
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.ReplaceSpaces)
<div class="config-title">@Html.LabelFor(m => m.EpisodeName)</div> <span class="small">@Html.DescriptionFor(m => m.ReplaceSpaces)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.EpisodeName)</div> </label>
</div> @Html.CheckBoxFor(m => m.ReplaceSpaces, new { @class = "inputClass checkClass" })
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.EpisodeName)</div> <label class="labelClass">@Html.LabelFor(m => m.AppendQuality)
<div class="config-description">@Html.DescriptionFor(m => m.EpisodeName)</div> <span class="small">@Html.DescriptionFor(m => m.AppendQuality)</span>
</div> </label>
</div> @Html.CheckBoxFor(m => m.AppendQuality, new { @class = "inputClass checkClass" })
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.SeasonFolders)
<div class="config-title">@Html.LabelFor(m => m.ReplaceSpaces)</div> <span class="small">@Html.DescriptionFor(m => m.SeasonFolders)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.ReplaceSpaces)</div> </label>
</div> @Html.CheckBoxFor(m => m.SeasonFolders, new { @class = "inputClass checkClass" })
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.ReplaceSpaces)</div> <label class="labelClass">@Html.LabelFor(m => m.SeasonFolderFormat)
<div class="config-description">@Html.DescriptionFor(m => m.ReplaceSpaces)</div> <span class="small">@Html.DescriptionFor(m => m.SeasonFolderFormat)</span>
</div> </label>
</div> @Html.TextBoxFor(m => m.SeasonFolderFormat, new { @class = "inputClass" })
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.SeparatorStyle)
<div class="config-title">@Html.LabelFor(m => m.AppendQuality)</div> <span class="small">@Html.DescriptionFor(m => m.SeparatorStyle)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.AppendQuality)</div> </label>
</div> @Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles, new { @class = "inputClass selectClass" })
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.AppendQuality)</div> <label class="labelClass">@Html.LabelFor(m => m.NumberStyle)
<div class="config-description">@Html.DescriptionFor(m => m.AppendQuality)</div> <span class="small">@Html.DescriptionFor(m => m.NumberStyle)</span>
</div> </label>
</div> @Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles, new { @class = "inputClass selectClass" })
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.MultiEpisodeStyle)
<div class="config-title">@Html.LabelFor(m => m.SeasonFolders)</div> <span class="small">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.SeasonFolders)</div> </label>
</div> @Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles, new { @class = "inputClass selectClass" })
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolders)</div> <div id ="examples" class="clearfix">
<div class="config-description">@Html.DescriptionFor(m => m.SeasonFolders)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.SeasonFolderFormat)</div>
<div class="config-value">@Html.TextBoxFor(m => m.SeasonFolderFormat)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolderFormat)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeasonFolderFormat)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.SeparatorStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeparatorStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeparatorStyle)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.NumberStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.NumberStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.NumberStyle)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.MultiEpisodeStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.MultiEpisodeStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</div>
</div>
</div>
<div id="singleEpisodeExample"> <div id="singleEpisodeExample">
</div> </div>
<div id="multiEpisodeExample"> <div id="multiEpisodeExample">
</div> </div>
<input type="submit" id="save_button" value="Save" disabled="disabled" /> </div>
</fieldset>
}
<div id="result" class="hiddenResult">
</div>
@section Scripts{
<script type="text/javascript">
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
$('#save_button').attr('disabled', '');
createExamples();
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
}
function showResponse(responseText, statusText, xhr, $form) { <button type="submit" id="save_button" >Save</button><img src="../../Content/Images/ajax-loader.gif" alt="Loader" id="saveAjax"/>
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
} }
</div>
<div id="result" class="hiddenResult"></div>
}
@section Scripts{
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script src="../../Scripts/settingsForm.js" type="text/javascript"></script>
<script type="text/javascript">
$('#SeriesName').live('change', function () { createExamples(); }); $('#SeriesName').live('change', function () { createExamples(); });
$('#EpisodeName').live('change', function () { createExamples(); }); $('#EpisodeName').live('change', function () { createExamples(); });
$('#ReplaceSpaces').live('change', function () { createExamples(); }); $('#ReplaceSpaces').live('change', function () { createExamples(); });

@ -1,40 +0,0 @@
@section TitleContent{
Settings
}
@section ActionMenu{
@{Html.RenderPartial("SubMenu");}
}
@section MainContent{
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
@{Html.RenderPartial(ViewData["viewName"].ToString());}
}
@section Scripts{
<script type="text/javascript">
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
$('#saveAjax').show();
}
function showResponse(responseText, statusText, xhr, $form) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
$('#saveAjax').hide();
}
</script>
}

@ -1,31 +1,43 @@
@model NzbDrone.Web.Models.IndexerSettingsModel @using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.IndexerSettingsModel
<style>
.section_content
{
padding-left: 15px;
}
.indexer_left @section HeaderContent{
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
<style>
.indexerPanel
{ {
width: 80px; padding-top: 20px;
float:left;
} }
</style> </style>
}
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form" })) { @section TitleContent{
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") Settings
}
@section ActionMenu{
@{Html.RenderPartial("SubMenu");}
}
<fieldset> @section MainContent{
<legend>Indexers</legend> <div id="stylized">
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
{
<h1>Indexer</h1>
<p></p>
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
<div> <div>
@{ Html.Telerik().PanelBar() @{ Html.Telerik().PanelBar()
.Name("PanelBar") .Name("PanelBar")
.HtmlAttributes(new { style = "width: 500px; margin: 10px;" }) //.HtmlAttributes(new { style = "width: 500px; margin: 10px;" })
.ExpandMode(PanelBarExpandMode.Single) .ExpandMode(PanelBarExpandMode.Single)
.SelectedIndex(0) .SelectedIndex(0)
.Items(indexerItem => .Items(indexerItem =>
@ -34,140 +46,94 @@
.Text("NZBs.org") .Text("NZBs.org")
.ImageUrl("~/Content/Images/Indexers/Nzbs.org.png") .ImageUrl("~/Content/Images/Indexers/Nzbs.org.png")
.Content(@<text> .Content(@<text>
<div class="section_content"> <div class="indexerPanel clearfix">
<div class="indexer_group"> <label class="labelClass">@Html.LabelFor(m => m.NzbsOrgEnabled)
<div class="indexer_left"> <span class="small">@Html.DescriptionFor(m => m.NzbsOrgEnabled)</span>
Enabled </label>
</div> @Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "inputClass checkClass" })
<div class="indexer_right">
@Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "indexer_checkbox" }) <label class="labelClass">@Html.LabelFor(m => m.NzbsOrgUId)
</div> <span class="small">@Html.DescriptionFor(m => m.NzbsOrgUId)</span>
</div> </label>
@Html.TextBoxFor(m => m.NzbsOrgUId, new { @class = "inputClass" })
<div class="indexer_group">
<div class="indexer_left"> <label class="labelClass">@Html.LabelFor(m => m.NzbsOrgHash)
@Html.LabelFor(m => m.NzbsOrgUId) <span class="small">@Html.DescriptionFor(m => m.NzbsOrgHash)</span>
</div> </label>
<div class="indexer_right"> @Html.TextBoxFor(m => m.NzbsOrgHash, new { @class = "inputClass" })
@Html.TextBoxFor(m => m.NzbsOrgUId)
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbsOrgHash)
</div>
<div class="indexer_right">
@Html.TextBoxFor(m => m.NzbsOrgHash)
</div>
</div>
</div> </div>
</text>); </text>);
indexerItem.Add() indexerItem.Add()
.Text("NZB Matrix") .Text("NZB Matrix")
.ImageUrl("~/Content/Images/Indexers/NzbMatrix.png") .ImageUrl("~/Content/Images/Indexers/NzbMatrix.png")
.Content(@<text> .Content(@<text>
<div class="section_content"> <div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixEnabled)
<div class="indexer_group"> <span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span>
<div class="indexer_left"> </label>
Enabled @Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass" })
</div>
<div class="indexer_right"> <label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername)
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "indexer_checkbox" }) <span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span>
</div> </label>
</div> @Html.TextBoxFor(m => m.NzbMatrixUsername, new { @class = "inputClass" })
<div class="indexer_group"> <label class="labelClass">@Html.LabelFor(m => m.NzbMatrixApiKey)
<div class="indexer_left"> <span class="small">@Html.DescriptionFor(m => m.NzbMatrixApiKey)</span>
@Html.LabelFor(m => m.NzbMatrixUsername) </label>
</div> @Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" })
<div class="indexer_right">
@Html.TextBoxFor(m => m.NzbMatrixUsername)
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbMatrixApiKey)
</div>
<div class="indexer_right">
@Html.TextBoxFor(m => m.NzbMatrixApiKey)
</div>
</div>
</div> </div>
</text>); </text>);
indexerItem.Add() indexerItem.Add()
.Text("NZBsRus") .Text("NZBsRus")
.ImageUrl("~/Content/Images/Indexers/NzbsRus.png") .ImageUrl("~/Content/Images/Indexers/NzbsRus.png")
.Content(@<text> .Content(@<text>
<div class="section_content"> <div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NzbsRUsEnabled)
<div class="indexer_group"> <span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span>
<div class="indexer_left"> </label>
Enabled @Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass" })
</div>
<div class="indexer_right"> <label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId)
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "indexer_checkbox" }) <span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span>
</div> </label>
</div> @Html.TextBoxFor(m => m.NzbsrusUId, new { @class = "inputClass" })
<div class="indexer_group"> <label class="labelClass">@Html.LabelFor(m => m.NzbsrusHash)
<div class="indexer_left"> <span class="small">@Html.DescriptionFor(m => m.NzbsrusHash)</span>
@Html.LabelFor(m => m.NzbsrusUId) </label>
</div> @Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
<div class="indexer_right">
@Html.TextBoxFor(m => m.NzbsrusUId)
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbsrusHash)
</div>
<div class="indexer_right">
@Html.TextBoxFor(m => m.NzbsrusHash)
</div>
</div>
</div> </div>
</text>); </text>);
indexerItem.Add() indexerItem.Add()
.Text("Newzbin") .Text("Newzbin")
.ImageUrl("~/Content/Images/Indexers/Newzbin.png") .ImageUrl("~/Content/Images/Indexers/Newzbin.png")
.Content(@<text> .Content(@<text>
<div class="section_content"> <div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NewzbinEnabled)
<div class="indexer_group"> <span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span>
<div class="indexer_left"> </label>
Enabled @Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass" })
</div>
<div class="indexer_right"> <label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername)
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "indexer_checkbox" }) <span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span>
</div> </label>
</div> @Html.TextBoxFor(m => m.NewzbinUsername, new { @class = "inputClass" })
<div class="indexer_group"> <label class="labelClass">@Html.LabelFor(m => m.NewzbinPassword)
<div class="indexer_left"> <span class="small">@Html.DescriptionFor(m => m.NewzbinPassword)</span>
@Html.LabelFor(m => m.NewzbinUsername) </label>
</div> @Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass" })
<div class="indexer_right">
@Html.TextBoxFor(m => m.NewzbinUsername)
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NewzbinPassword)
</div>
<div class="indexer_right">
@Html.TextBoxFor(m => m.NewzbinPassword)
</div>
</div>
</div> </div>
</text>); </text>);
}).Render(); }).Render();
} }
</div> </div>
<br/>
<button type="submit" id="save_button" >Save</button><img src="../../Content/Images/ajax-loader.gif" alt="Loader" id="saveAjax"/>
}
<div id="save_button_div">
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</div> </div>
</fieldset>
<div id="result" class="hiddenResult"></div>
} }
<div id="result" class="hiddenResult"></div>

@ -1,136 +1,136 @@
@model NzbDrone.Web.Models.NotificationSettingsModel @using NzbDrone.Web.Helpers
@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form" })) @model NzbDrone.Web.Models.NotificationSettingsModel
{
<fieldset> @section HeaderContent{
<legend>Notification Settings</legend> <link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
<fieldset class="sub-field">
<legend>XBMC</legend> <style>
<div class="config-section"> .notifier
<div class="config-group"> {
<div class="config-title">@Html.LabelFor(m => m.XbmcEnabled)</div> width: 560px;
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcEnabled)</div> border:solid 2px #CCCCCD;
</div> padding: 5px;
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcEnabled)</div> margin-bottom: 10px;
</div> }
<div class="config-section">
<div class="config-group"> .notifier h4
<div class="config-title">@Html.LabelFor(m => m.XbmcNotifyOnGrab)</div> {
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcNotifyOnGrab)</div> font-weight: bold;
</div> margin-bottom: 0px;
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcNotifyOnGrab)</div> padding-left: 5px;
</div> padding-top: 3px;
<div class="config-section"> }
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.XbmcNotifyOnDownload)</div> .notifierLine
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcNotifyOnDownload)</div> {
</div> font-size:11px;
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcNotifyOnDownload)</div> color:#666666;
</div> margin-bottom:20px;
<div class="config-section"> border-bottom:solid 1px #CCCCCD;
<div class="config-group"> padding-bottom:10px;
<div class="config-title">@Html.LabelFor(m => m.XbmcNotifyOnRename)</div> }
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcNotifyOnRename)</div> </style>
</div> }
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcNotifyOnRename)</div>
</div> @section TitleContent{
<div class="config-section"> Settings
<div class="config-group"> }
<div class="config-title">@Html.LabelFor(m => m.XbmcNotificationImage)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcNotificationImage)</div> @section ActionMenu{
</div> @{Html.RenderPartial("SubMenu");}
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcNotificationImage)</div> }
</div>
<div class="config-section"> @section MainContent{
<div class="config-group"> <div id="stylized">
<div class="config-title">@Html.LabelFor(m => m.XbmcDisplayTime)</div> @using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
<div class="config-value">@Html.TextBoxFor(m => m.XbmcDisplayTime)</div> {
</div> <h1>Notifications</h1>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcDisplayTime)</div> <p></p>
</div>
<div class="config-section"> <div id="xbmc" class="notifier clearfix">
<div class="config-group"> <h4>XBMC</h4>
<div class="config-title">@Html.LabelFor(m => m.XbmcUpdateOnDownload)</div> <div class="notifierLine"></div>
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcUpdateOnDownload)</div>
</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcEnabled)
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcUpdateOnDownload)</div> <span class="small">@Html.DescriptionFor(m => m.XbmcEnabled)</span>
</div> </label>
<div class="config-section"> @Html.CheckBoxFor(m => m.XbmcEnabled, new { @class = "inputClass checkClass" })
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.XbmcUpdateOnRename)</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcNotifyOnGrab)
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcUpdateOnRename)</div> <span class="small">@Html.DescriptionFor(m => m.XbmcNotifyOnGrab)</span>
</div> </label>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcUpdateOnRename)</div> @Html.CheckBoxFor(m => m.XbmcNotifyOnGrab, new { @class = "inputClass checkClass" })
</div>
<div class="config-section"> <label class="labelClass">@Html.LabelFor(m => m.XbmcNotifyOnDownload)
<div class="config-group"> <span class="small">@Html.DescriptionFor(m => m.XbmcNotifyOnDownload)</span>
<div class="config-title">@Html.LabelFor(m => m.XbmcFullUpdate)</div> </label>
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcFullUpdate)</div> @Html.CheckBoxFor(m => m.XbmcNotifyOnDownload, new { @class = "inputClass checkClass" })
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcFullUpdate)</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcNotifyOnRename)
</div> <span class="small">@Html.DescriptionFor(m => m.XbmcNotifyOnRename)</span>
<div class="config-section"> </label>
<div class="config-group"> @Html.CheckBoxFor(m => m.XbmcNotifyOnRename, new { @class = "inputClass checkClass" })
<div class="config-title">@Html.LabelFor(m => m.XbmcCleanOnDownload)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcCleanOnDownload)</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcNotificationImage)
</div> <span class="small">@Html.DescriptionFor(m => m.XbmcNotificationImage)</span>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcCleanOnDownload)</div> </label>
</div> @Html.CheckBoxFor(m => m.XbmcNotificationImage, new { @class = "inputClass checkClass" })
<div class="config-section">
<div class="config-group"> <label class="labelClass">@Html.LabelFor(m => m.XbmcDisplayTime)
<div class="config-title">@Html.LabelFor(m => m.XbmcCleanOnRename)</div> <span class="small">@Html.DescriptionFor(m => m.XbmcDisplayTime)</span>
<div class="config-value">@Html.CheckBoxFor(m => m.XbmcCleanOnRename)</div> </label>
</div> @Html.TextBoxFor(m => m.XbmcDisplayTime, new { @class = "inputClass" })
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcCleanOnRename)</div>
</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcUpdateOnDownload)
<div class="config-section"> <span class="small">@Html.DescriptionFor(m => m.XbmcUpdateOnDownload)</span>
<div class="config-group"> </label>
<div class="config-title">@Html.LabelFor(m => m.XbmcHosts)</div> @Html.CheckBoxFor(m => m.XbmcUpdateOnDownload, new { @class = "inputClass checkClass" })
<div class="config-value">@Html.TextBoxFor(m => m.XbmcHosts)</div>
</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcUpdateOnRename)
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcHosts)</div> <span class="small">@Html.DescriptionFor(m => m.XbmcUpdateOnRename)</span>
</div> </label>
<div class="config-section"> @Html.CheckBoxFor(m => m.XbmcUpdateOnRename, new { @class = "inputClass checkClass" })
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.XbmcUsername)</div> <label class="labelClass">@Html.LabelFor(m => m.XbmcFullUpdate)
<div class="config-value">@Html.TextBoxFor(m => m.XbmcUsername)</div> <span class="small">@Html.DescriptionFor(m => m.XbmcFullUpdate)</span>
</div> </label>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcUsername)</div> @Html.CheckBoxFor(m => m.XbmcFullUpdate, new { @class = "inputClass checkClass" })
</div>
<div class="config-section"> <label class="labelClass">@Html.LabelFor(m => m.XbmcCleanOnDownload)
<div class="config-group"> <span class="small">@Html.DescriptionFor(m => m.XbmcCleanOnDownload)</span>
<div class="config-title">@Html.LabelFor(m => m.XbmcPassword)</div> </label>
<div class="config-value">@Html.TextBoxFor(m => m.XbmcPassword)</div> @Html.CheckBoxFor(m => m.XbmcCleanOnDownload, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.XbmcCleanOnRename)
<span class="small">@Html.DescriptionFor(m => m.XbmcCleanOnRename)</span>
</label>
@Html.CheckBoxFor(m => m.XbmcCleanOnRename, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.XbmcHosts)
<span class="small">@Html.DescriptionFor(m => m.XbmcHosts)</span>
</label>
@Html.TextBoxFor(m => m.XbmcHosts, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.XbmcUsername)
<span class="small">@Html.DescriptionFor(m => m.XbmcUsername)</span>
</label>
@Html.TextBoxFor(m => m.XbmcUsername, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.XbmcPassword)
<span class="small">@Html.DescriptionFor(m => m.XbmcPassword)</span>
</label>
@Html.TextBoxFor(m => m.XbmcPassword, new { @class = "inputClass" })
</div> </div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.XbmcPassword)</div>
<button type="submit" id="save_button" >Save</button><img src="../../Content/Images/ajax-loader.gif" alt="Loader" id="saveAjax"/>
}
</div> </div>
</fieldset>
<input type="submit" id="save_button" value="Save" disabled="disabled" /> <div id="result" class="hiddenResult"></div>
</fieldset>
} }
<div id="result" class="hiddenResult">
</div>
@section Scripts{
<script type="text/javascript">
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
$('#save_button').attr('disabled', '');
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
}
function showResponse(responseText, statusText, xhr, $form) { @section Scripts{
$("#result").empty().html(responseText); <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
$("#form :input").attr("disabled", false); <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
} <script src="../../Scripts/settingsForm.js" type="text/javascript"></script>
</script>
} }

@ -7,22 +7,7 @@
<script src="../../Scripts/jquery-1.6.1.js" type="text/javascript"></script> <script src="../../Scripts/jquery-1.6.1.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
function renameOption(text, value) {
$("#DefaultQualityProfileId option[value='" + value + "']").html(text);
}
function addOption(text, value) {
var myCombo = $('#DefaultQualityProfileId');
var exists = $("#DefaultQualityProfileId option[value='" + value + "']");
if (exists.length == 0)
myCombo.append($('\<option\> \</option\>').val(value).html(text));
}
function removeOption(value) {
$("#DefaultQualityProfileId option[value='" + value + "']").remove();
}
</script> </script>
} }
@ -74,6 +59,7 @@
@section Scripts{ @section Scripts{
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script src="../../Scripts/settingsForm.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$("#addItem").click(function () { $("#addItem").click(function () {
@ -94,6 +80,23 @@
sendToServer(id); sendToServer(id);
} }
function renameOption(text, value) {
$("#DefaultQualityProfileId option[value='" + value + "']").html(text);
}
function addOption(text, value) {
var myCombo = $('#DefaultQualityProfileId');
var exists = $("#DefaultQualityProfileId option[value='" + value + "']");
if (exists.length == 0)
myCombo.append($('\<option\> \</option\>').val(value).html(text));
}
function removeOption(value) {
$("#DefaultQualityProfileId option[value='" + value + "']").remove();
}
function sendToServer(id) { function sendToServer(id) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -115,29 +118,6 @@
}); });
} }
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
$('#saveAjax').show();
}
function showResponse(responseText, statusText, xhr, $form) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
$('#saveAjax').hide();
}
function getProfileId(obj) { function getProfileId(obj) {
var parentProfileSection = $(obj).parents('.profileSection'); var parentProfileSection = $(obj).parents('.profileSection');
return parentProfileSection.children('.qualityProfileId').val(); return parentProfileSection.children('.qualityProfileId').val();

@ -76,6 +76,7 @@
@section Scripts{ @section Scripts{
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script src="../../Scripts/settingsForm.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
var autoConfigureSabUrl = '@Url.Action("AutoConfigureSab", "Settings")'; var autoConfigureSabUrl = '@Url.Action("AutoConfigureSab", "Settings")';
@ -97,28 +98,5 @@
$('#SabApiKey').val(data.ApiKey); $('#SabApiKey').val(data.ApiKey);
} }
} }
$(document).ready(function () {
var options = {
target: '#result',
beforeSubmit: showRequest,
success: showResponse,
type: 'post',
resetForm: false
};
$('#form').ajaxForm(options);
});
function showRequest(formData, jqForm, options) {
$("#result").empty().html('Saving...');
$("#form :input").attr("disabled", true);
$('#saveAjax').show();
}
function showResponse(responseText, statusText, xhr, $form) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
$('#saveAjax').hide();
}
</script> </script>
} }

@ -9,3 +9,5 @@
"Settings"); "Settings");
}).Render(); }).Render();
} }
<div style="margin-bottom: 10px"></div>
Loading…
Cancel
Save