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;
width:340px;
float:left;
margin-bottom: -10px;
}
#stylized .small
@ -70,6 +71,11 @@ p, h1, form, button{border:0; margin:0; padding:0;}
width: 206px;
}
#stylized .checkClass
{
margin:10px 0 10px 10px;
}
#stylized button
{
clear:both;

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

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

@ -6,52 +6,66 @@ namespace NzbDrone.Web.Models
public class NotificationSettingsModel
{
[DisplayName("Enabled")]
[Description("Enable notifications for XBMC?")]
public bool XbmcEnabled { get; set; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool XbmcNotifyOnGrab { get; set; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool XbmcNotifyOnDownload { get; set; }
[DisplayName("Notify on Rename")]
[Description("Send notification when episode is renamed?")]
public bool XbmcNotifyOnRename { get; set; }
[DisplayName("Image with Notification")]
[Description("Display NzbDrone image on notifications?")]
public bool XbmcNotificationImage { get; set; }
[Required]
[Range(3, 10, ErrorMessage = "Must be between 3 and 10 seconds")]
[DisplayName("Display Time")]
[Description("How long the notification should be displayed")]
public int XbmcDisplayTime { get; set; }
[DisplayName("Update on Download")]
[Description("Update XBMC library after episode download?")]
public bool XbmcUpdateOnDownload { get; set; }
[DisplayName("Update on Rename")]
[Description("Update XBMC library after episode is renamed?")]
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; }
[DisplayName("Clean on Download")]
[Description("Clean XBMC library after episode download?")]
public bool XbmcCleanOnDownload { get; set; }
[DisplayName("Clean on Rename")]
[Description("Clean XBMC library after episode is renamed?")]
public bool XbmcCleanOnRename { get; set; }
[DataType(DataType.Text)]
[DisplayName("Hosts")]
[Description("XBMC hosts with port, comma separ")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcHosts { get; set; }
[DataType(DataType.Text)]
[DisplayName("Username")]
[Description("XBMC webserver username")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcUsername { get; set; }
[DataType(DataType.Text)]
[DisplayName("Password")]
[Description("XBMC webserver password")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
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.upload.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\episodeSearch.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
@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.")
<fieldset>
<legend>Episode Sorting</legend>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.SeriesName)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.SeriesName)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeriesName)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeriesName)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.EpisodeName)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.EpisodeName)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.EpisodeName)</div>
<div class="config-description">@Html.DescriptionFor(m => m.EpisodeName)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.ReplaceSpaces)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.ReplaceSpaces)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.ReplaceSpaces)</div>
<div class="config-description">@Html.DescriptionFor(m => m.ReplaceSpaces)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.AppendQuality)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.AppendQuality)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.AppendQuality)</div>
<div class="config-description">@Html.DescriptionFor(m => m.AppendQuality)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.SeasonFolders)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.SeasonFolders)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolders)</div>
<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>
@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.")
<h1>Episode Sorting</h1>
<p></p>
<label class="labelClass">@Html.LabelFor(m => m.SeriesName)
<span class="small">@Html.DescriptionFor(m => m.SeriesName)</span>
</label>
@Html.CheckBoxFor(m => m.SeriesName, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.EpisodeName)
<span class="small">@Html.DescriptionFor(m => m.EpisodeName)</span>
</label>
@Html.CheckBoxFor(m => m.EpisodeName, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.ReplaceSpaces)
<span class="small">@Html.DescriptionFor(m => m.ReplaceSpaces)</span>
</label>
@Html.CheckBoxFor(m => m.ReplaceSpaces, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.AppendQuality)
<span class="small">@Html.DescriptionFor(m => m.AppendQuality)</span>
</label>
@Html.CheckBoxFor(m => m.AppendQuality, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolders)
<span class="small">@Html.DescriptionFor(m => m.SeasonFolders)</span>
</label>
@Html.CheckBoxFor(m => m.SeasonFolders, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolderFormat)
<span class="small">@Html.DescriptionFor(m => m.SeasonFolderFormat)</span>
</label>
@Html.TextBoxFor(m => m.SeasonFolderFormat, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.SeparatorStyle)
<span class="small">@Html.DescriptionFor(m => m.SeparatorStyle)</span>
</label>
@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles, new { @class = "inputClass selectClass" })
<label class="labelClass">@Html.LabelFor(m => m.NumberStyle)
<span class="small">@Html.DescriptionFor(m => m.NumberStyle)</span>
</label>
@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles, new { @class = "inputClass selectClass" })
<label class="labelClass">@Html.LabelFor(m => m.MultiEpisodeStyle)
<span class="small">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</span>
</label>
@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles, new { @class = "inputClass selectClass" })
<div id ="examples" class="clearfix">
<div id="singleEpisodeExample">
</div>
<div id="multiEpisodeExample">
</div>
</div>
<div id="singleEpisodeExample">
</div>
<div id="multiEpisodeExample">
</div>
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</fieldset>
}
<div id="result" class="hiddenResult">
<button type="submit" id="save_button" >Save</button><img src="../../Content/Images/ajax-loader.gif" alt="Loader" id="saveAjax"/>
}
</div>
<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) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
}
<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(); });
$('#EpisodeName').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,173 +1,139 @@
@model NzbDrone.Web.Models.IndexerSettingsModel
@using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.IndexerSettingsModel
<style>
.section_content
{
padding-left: 15px;
}
.indexer_left
{
width: 80px;
float:left;
}
@section HeaderContent{
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
<style>
.indexerPanel
{
padding-top: 20px;
}
</style>
}
@section TitleContent{
Settings
}
@section ActionMenu{
@{Html.RenderPartial("SubMenu");}
}
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form" })) {
@section MainContent{
<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>
@{ Html.Telerik().PanelBar()
.Name("PanelBar")
//.HtmlAttributes(new { style = "width: 500px; margin: 10px;" })
.ExpandMode(PanelBarExpandMode.Single)
.SelectedIndex(0)
.Items(indexerItem =>
{
indexerItem.Add()
.Text("NZBs.org")
.ImageUrl("~/Content/Images/Indexers/Nzbs.org.png")
.Content(@<text>
<div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgEnabled)
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgUId)
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgUId)</span>
</label>
@Html.TextBoxFor(m => m.NzbsOrgUId, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgHash)
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgHash)</span>
</label>
@Html.TextBoxFor(m => m.NzbsOrgHash, new { @class = "inputClass" })
</div>
</text>);
indexerItem.Add()
.Text("NZB Matrix")
.ImageUrl("~/Content/Images/Indexers/NzbMatrix.png")
.Content(@<text>
<div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixEnabled)
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername)
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span>
</label>
@Html.TextBoxFor(m => m.NzbMatrixUsername, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixApiKey)
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixApiKey)</span>
</label>
@Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" })
</div>
</text>);
indexerItem.Add()
.Text("NZBsRus")
.ImageUrl("~/Content/Images/Indexers/NzbsRus.png")
.Content(@<text>
<div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NzbsRUsEnabled)
<span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass" })
<fieldset>
<legend>Indexers</legend>
<div>
@{ Html.Telerik().PanelBar()
.Name("PanelBar")
.HtmlAttributes(new { style = "width: 500px; margin: 10px;" })
.ExpandMode(PanelBarExpandMode.Single)
.SelectedIndex(0)
.Items(indexerItem =>
{
indexerItem.Add()
.Text("NZBs.org")
.ImageUrl("~/Content/Images/Indexers/Nzbs.org.png")
.Content(@<text>
<div class="section_content">
<div class="indexer_group">
<div class="indexer_left">
Enabled
</div>
<div class="indexer_right">
@Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "indexer_checkbox" })
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbsOrgUId)
</div>
<div class="indexer_right">
@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>
</text>);
indexerItem.Add()
.Text("NZB Matrix")
.ImageUrl("~/Content/Images/Indexers/NzbMatrix.png")
.Content(@<text>
<div class="section_content">
<div class="indexer_group">
<div class="indexer_left">
Enabled
</div>
<div class="indexer_right">
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "indexer_checkbox" })
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbMatrixUsername)
</div>
<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>
</text>);
indexerItem.Add()
.Text("NZBsRus")
.ImageUrl("~/Content/Images/Indexers/NzbsRus.png")
.Content(@<text>
<div class="section_content">
<div class="indexer_group">
<div class="indexer_left">
Enabled
</div>
<div class="indexer_right">
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "indexer_checkbox" })
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NzbsrusUId)
</div>
<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>
</text>);
indexerItem.Add()
.Text("Newzbin")
.ImageUrl("~/Content/Images/Indexers/Newzbin.png")
.Content(@<text>
<div class="section_content">
<div class="indexer_group">
<div class="indexer_left">
Enabled
</div>
<div class="indexer_right">
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "indexer_checkbox" })
</div>
</div>
<div class="indexer_group">
<div class="indexer_left">
@Html.LabelFor(m => m.NewzbinUsername)
</div>
<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>
</text>);
}).Render();
}
</div>
<div id="save_button_div">
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</div>
</fieldset>
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId)
<span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span>
</label>
@Html.TextBoxFor(m => m.NzbsrusUId, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusHash)
<span class="small">@Html.DescriptionFor(m => m.NzbsrusHash)</span>
</label>
@Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
</div>
</text>);
indexerItem.Add()
.Text("Newzbin")
.ImageUrl("~/Content/Images/Indexers/Newzbin.png")
.Content(@<text>
<div class="indexerPanel clearfix">
<label class="labelClass">@Html.LabelFor(m => m.NewzbinEnabled)
<span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass" })
<label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername)
<span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span>
</label>
@Html.TextBoxFor(m => m.NewzbinUsername, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NewzbinPassword)
<span class="small">@Html.DescriptionFor(m => m.NewzbinPassword)</span>
</label>
@Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass" })
</div>
</text>);
}).Render();
}
</div>
<br/>
<button type="submit" id="save_button" >Save</button><img src="../../Content/Images/ajax-loader.gif" alt="Loader" id="saveAjax"/>
}
<div id="result" class="hiddenResult"></div>
</div>
<div id="result" class="hiddenResult"></div>
}

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

@ -7,22 +7,7 @@
<script src="../../Scripts/jquery-1.6.1.js" type="text/javascript"></script>
<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>
}
@ -74,6 +59,7 @@
@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">
$("#addItem").click(function () {
@ -94,6 +80,23 @@
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) {
$.ajax({
type: "POST",
@ -114,29 +117,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) {
var parentProfileSection = $(obj).parents('.profileSection');

@ -76,6 +76,7 @@
@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">
var autoConfigureSabUrl = '@Url.Action("AutoConfigureSab", "Settings")';
@ -97,28 +98,5 @@
$('#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>
}

@ -8,4 +8,6 @@
items.Add().Text("Notifications").Action("Notifications",
"Settings");
}).Render();
}
}
<div style="margin-bottom: 10px"></div>
Loading…
Cancel
Save