2011-10-01 07:04:06 +00:00
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@model NzbDrone.Web.Models.SystemSettingsModel
|
2011-12-01 05:04:44 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
@{
|
2013-01-17 05:09:57 +00:00
|
|
|
Layout = "_SettingsLayout.cshtml";
|
2012-10-15 00:50:01 +00:00
|
|
|
}
|
2012-01-17 07:34:54 +00:00
|
|
|
|
|
|
|
<div class="infoBox">
|
2012-02-25 21:21:41 +00:00
|
|
|
You must manually restart NzbDrone for these changes to take effect. (Automatic restart coming soon!)
|
2012-01-17 07:34:54 +00:00
|
|
|
</div>
|
|
|
|
|
2011-10-01 07:04:06 +00:00
|
|
|
<div id="stylized">
|
2011-12-01 06:39:11 +00:00
|
|
|
@using (Html.BeginForm("SaveSystem", "Settings", FormMethod.Post, new { id = "SystemForm", name = "SystemForm", @class = "settingsForm" }))
|
2011-10-01 07:04:06 +00:00
|
|
|
{
|
|
|
|
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.LaunchBrowser)
|
2011-12-01 05:04:44 +00:00
|
|
|
<span class="small">@Html.DescriptionFor(m => m.LaunchBrowser)</span>
|
2011-10-01 07:04:06 +00:00
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.LaunchBrowser, new { @class = "inputClass checkClass" })
|
|
|
|
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.Port)
|
2011-12-01 05:04:44 +00:00
|
|
|
<span class="small">@Html.DescriptionFor(m => m.Port)</span>
|
2012-02-25 21:21:41 +00:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.Port)</span>
|
2011-10-01 07:04:06 +00:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.Port, new { @class = "inputClass" })
|
2011-10-07 23:24:28 +00:00
|
|
|
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.AuthenticationType)
|
2011-12-01 05:04:44 +00:00
|
|
|
<span class="small">@Html.DescriptionFor(m => m.AuthenticationType)</span>
|
2011-10-07 23:24:28 +00:00
|
|
|
</label>
|
|
|
|
@Html.DropDownListFor(m => m.AuthenticationType, Model.AuthTypeSelectList, new { @class = "inputClass" })
|
2012-01-27 03:59:30 +00:00
|
|
|
|
2012-09-04 07:11:27 +00:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.RecycleBin)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.RecycleBin)</span>
|
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.RecycleBin)</span>
|
|
|
|
</label>
|
2012-09-05 05:34:51 +00:00
|
|
|
@Html.TextBoxFor(m => m.RecycleBin, new { @class = "inputClass folderLookup" })
|
2012-09-04 07:11:27 +00:00
|
|
|
|
2012-01-27 03:59:30 +00:00
|
|
|
<label class="labelClass"> Backup Configuration
|
|
|
|
<span class="small">Backup your Configuration file and Database</span>
|
|
|
|
</label>
|
|
|
|
<input type="button" value="Backup Now" onclick="window.location='../System/Backup'; return false;" class="inputClass" />
|
2011-10-01 07:04:06 +00:00
|
|
|
|
2011-12-01 06:39:11 +00:00
|
|
|
<button type="submit" class="save_button" disabled="disabled">
|
2011-12-01 05:04:44 +00:00
|
|
|
Save</button>
|
2011-10-01 07:04:06 +00:00
|
|
|
}
|
|
|
|
</div>
|
2012-02-25 21:21:41 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
@section Scripts
|
|
|
|
{
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
//Allow unobstrusive validation of the AJAX loaded form
|
|
|
|
$.validator.unobtrusive.parse('#SystemForm');
|
2012-02-25 21:21:41 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
//Validator Settings
|
|
|
|
var settings = $.data($('#SystemForm')[0], 'validator').settings;
|
|
|
|
settings.ignore = [];
|
|
|
|
settings.focusInvalid = false;
|
|
|
|
settings.onfocusout = function(element) { $(element).valid(); };
|
2012-02-25 21:21:41 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
var oldHighlight = settings.highlight;
|
|
|
|
var oldUnhighlight = settings.unhighlight;
|
2012-02-25 21:21:41 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
settings.highlight = function(element, errorClass, validClass) {
|
|
|
|
oldHighlight(element, errorClass, validClass);
|
|
|
|
$(element).parents('div.ui-accordion-content').prev('h3.ui-accordion-header').addClass('validation-error');
|
|
|
|
};
|
|
|
|
settings.unhighlight = function(element, errorClass, validClass) {
|
|
|
|
oldUnhighlight(element, errorClass, validClass);
|
2012-02-25 21:21:41 +00:00
|
|
|
|
2012-10-15 00:50:01 +00:00
|
|
|
var container = $(element).parents('div.ui-accordion-content');
|
|
|
|
if ($(container).children('.' + errorClass).length == 0)
|
|
|
|
$(container).prev('h3.ui-accordion-header').removeClass('validation-error');
|
|
|
|
};
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
}
|