2011-07-01 22:33:03 +02:00
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@model NzbDrone.Web.Models.IndexerSettingsModel
|
2012-02-23 20:16:11 +01:00
|
|
|
@{ Layout = null; }
|
2012-02-24 17:22:13 +01:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.indexerStatusContainer {
|
|
|
|
margin-left: 14px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.field-validation-error {
|
|
|
|
color: red;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-validation-error {
|
|
|
|
background-color: #FFEEEE;
|
|
|
|
border: 1px solid #FF0000;
|
|
|
|
}
|
|
|
|
|
|
|
|
#IndexersForm .validation-error {
|
|
|
|
background: url("../../Content/jQueryUI/images/ui-bg_flat_30_b40404_40x100.png") repeat-x scroll 50% 50% #B40404;
|
|
|
|
}
|
|
|
|
#validation-error-summary {
|
|
|
|
display: none;
|
|
|
|
color: red;
|
|
|
|
}
|
|
|
|
</style>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="infoBox">
|
2012-01-11 20:38:52 +01:00
|
|
|
RSS feeds are checked every 25 minutes for new episodes.</div>
|
2012-02-23 01:35:52 +01:00
|
|
|
<div class="indexerStatusContainer">
|
2012-02-24 17:22:13 +01:00
|
|
|
@Html.CheckBox("nzbsOrgStatus", @Model.NzbsOrgEnabled, new{ @class = "indexerStatusButton" })
|
|
|
|
<label for="nzbsOrgStatus">Nzbs.Org</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("nzbMatrixStatus", @Model.NzbMatrixEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="nzbMatrixStatus">NZBMatrix</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("nzbsRusStatus", @Model.NzbsRUsEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="nzbsRusStatus">NZBsRus</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("newzbinStatus", @Model.NewzbinEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="newzbinStatus">Newzbin</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("newznabStatus", @Model.NewznabEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="newznabStatus">Newznab</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
</div>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div id="stylized">
|
2011-12-01 07:39:11 +01:00
|
|
|
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "IndexersForm", name = "IndexersForm", @class = "settingsForm" }))
|
2012-02-17 10:32:33 +01:00
|
|
|
{
|
2011-12-08 06:30:47 +01:00
|
|
|
<div class="jquery-accordion">
|
2012-02-23 20:16:11 +01:00
|
|
|
<h3>
|
|
|
|
<a href="#">NZBs.org</a></h3>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbsOrgEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
@Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 06:04:44 +01:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgUId)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgUId)</span>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsOrgUId)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</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>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsOrgHash)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.NzbsOrgHash, new { @class = "inputClass" })
|
|
|
|
</div>
|
2012-02-23 20:16:11 +01:00
|
|
|
<h3>
|
|
|
|
<a href="#">NZBMatrix</a></h3>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 06:04:44 +01:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbMatrixUsername)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</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>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbMatrixApiKey)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" })
|
|
|
|
</div>
|
2012-02-23 20:16:11 +01:00
|
|
|
<h3>
|
|
|
|
<a href="#">NZBsRus</a></h3>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="indexerPanel">
|
2012-02-23 20:16:11 +01:00
|
|
|
<div class="warningBox">
|
|
|
|
NZBsRus does not support backlog searching</div>
|
2011-12-01 06:04:44 +01:00
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 06:04:44 +01:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsrusUId)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</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>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsrusHash)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
|
|
|
|
</div>
|
2012-02-23 20:16:11 +01:00
|
|
|
<h3>
|
|
|
|
<a href="#">Newzbin</a></h3>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 06:04:44 +01:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NewzbinUsername)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</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>
|
2012-02-24 17:22:13 +01:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NewzbinPassword)</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
</label>
|
2012-01-23 19:57:15 +01:00
|
|
|
@Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass", type = "password" })
|
2011-12-01 06:04:44 +01:00
|
|
|
</div>
|
2012-02-23 20:16:11 +01:00
|
|
|
<h3>
|
|
|
|
<a href="#">Newznab</a></h3>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NewznabEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 01:35:52 +01:00
|
|
|
@Html.CheckBoxFor(m => m.NewznabEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 06:04:44 +01:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<p>
|
|
|
|
</p>
|
|
|
|
<a id="addItem" href="@Url.Action("AddNewznabProvider", "Settings")">
|
|
|
|
<img src="../../Content/Images/Plus.png" alt="Add Newznab Provider" width="20px"
|
2012-02-24 17:22:13 +01:00
|
|
|
height="20px" />
|
2011-12-01 06:04:44 +01:00
|
|
|
Add Newznab Provider</a>
|
|
|
|
<div id="newznabProviders">
|
|
|
|
@foreach (var provider in Model.NewznabDefinitions)
|
|
|
|
{
|
|
|
|
Html.RenderAction("GetNewznabProviderView", provider);
|
|
|
|
}
|
2011-11-26 05:02:29 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2011-12-01 06:04:44 +01:00
|
|
|
</div>
|
2012-02-17 10:32:33 +01:00
|
|
|
|
|
|
|
<div class="retentionContainer">
|
|
|
|
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.Retention)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.Retention)</span>
|
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.Retention, new { @class = "inputClass" })
|
|
|
|
</div>
|
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
<button type="submit" class="save_button" disabled="disabled">Save</button>
|
|
|
|
|
|
|
|
<span id="validation-error-summary">Please check your settings and re-save</span>
|
2011-12-01 06:04:44 +01:00
|
|
|
}
|
|
|
|
</div>
|
2012-02-24 17:22:13 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
2012-02-24 17:22:13 +01:00
|
|
|
//Allow unobstrusive validation of the AJAX loaded form
|
|
|
|
$.validator.unobtrusive.parse("#IndexersForm");
|
|
|
|
|
|
|
|
//Make the buttons
|
|
|
|
$('.indexerStatusButton').button();
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
//Validator Settings
|
|
|
|
var settings = $.data($('#IndexersForm')[0], 'validator').settings;
|
|
|
|
settings.ignore = [];
|
|
|
|
settings.focusInvalid = false;
|
|
|
|
settings.onfocusout = function (element) { $(element).valid(); };
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
var oldHighlight = settings.highlight;
|
|
|
|
var oldUnhighlight = settings.unhighlight;
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
settings.highlight = function (element, errorClass, validClass) {
|
|
|
|
oldHighlight(element, errorClass, validClass);
|
|
|
|
$(element).parents('div.indexerPanel').prev('h3.ui-accordion-header').addClass('validation-error');
|
|
|
|
};
|
|
|
|
settings.unhighlight = function (element, errorClass, validClass) {
|
|
|
|
oldUnhighlight(element, errorClass, validClass);
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
var container = $(element).parents('div.indexerPanel');
|
|
|
|
if ($(container).children('.' + errorClass).length == 0)
|
|
|
|
$(container).prev('h3.ui-accordion-header').removeClass('validation-error');
|
|
|
|
};
|
2012-02-23 20:16:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$('.enabledCheck').on('change', function () {
|
2012-02-24 17:22:13 +01:00
|
|
|
var id = $(this).prop('id');
|
|
|
|
var checked = $(this).prop('checked');
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
if (id == 'NzbsOrgEnabled')
|
2012-02-24 17:22:13 +01:00
|
|
|
$('#nzbsOrgStatus').prop('checked', checked);
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
if (id == 'NzbMatrixEnabled')
|
2012-02-24 17:22:13 +01:00
|
|
|
$('#nzbMatrixStatus').prop('checked', checked);
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
if (id == 'NzbsRUsEnabled')
|
2012-02-24 17:22:13 +01:00
|
|
|
$('#nzbsRusStatus').prop('checked', checked);
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
if (id == 'NewzbinEnabled')
|
2012-02-24 17:22:13 +01:00
|
|
|
$('#newzbinStatus').prop('checked', checked);
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
if (id == 'NewznabEnabled')
|
2012-02-24 17:22:13 +01:00
|
|
|
$('#newznabStatus').prop('checked', checked);
|
|
|
|
|
|
|
|
$('.indexerStatusButton').button("refresh");
|
|
|
|
reValidate();
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.indexerStatusButton').on('change', function () {
|
|
|
|
var id = $(this).prop('id');
|
|
|
|
var checked = $(this).prop('checked');
|
|
|
|
|
|
|
|
if (id == 'nzbsOrgStatus')
|
|
|
|
$('#NzbsOrgEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'nzbMatrixStatus')
|
|
|
|
$('#NzbMatrixEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'nzbsRusStatus')
|
|
|
|
$('#NzbsRUsEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'newzbinStatus')
|
|
|
|
$('#NewzbinEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'newznabStatus')
|
|
|
|
$('#NewznabEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
reValidate();
|
2012-02-23 20:16:11 +01:00
|
|
|
});
|
2012-02-23 01:35:52 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
function reValidate() {
|
|
|
|
$("#IndexersForm").validate().form();
|
|
|
|
|
|
|
|
var container = $('div.indexerPanel');
|
|
|
|
if ($(container).children('.input-validation-error').length == 0)
|
|
|
|
$(container).prev('h3.ui-accordion-header').removeClass('validation-error');
|
|
|
|
}
|
|
|
|
|
|
|
|
//Newznab
|
2012-02-23 20:16:11 +01:00
|
|
|
$("#addItem").live('click', function () {
|
|
|
|
$.ajax({
|
|
|
|
url: this.href,
|
|
|
|
cache: false,
|
|
|
|
success: function (html) {
|
|
|
|
$("#newznabProviders").append(html);
|
|
|
|
}
|
2012-02-23 01:35:52 +01:00
|
|
|
});
|
2012-02-23 20:16:11 +01:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
var deleteNewznabProviderUrl = '@Url.Action("DeleteNewznabProvider", "Settings")';
|
|
|
|
|
|
|
|
function deleteProvider(id) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: deleteNewznabProviderUrl,
|
|
|
|
data: jQuery.param({ providerId: id }),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could not delete your Provider at this time. " + error);
|
|
|
|
},
|
|
|
|
success: function (data, textStatus, jqXHR) {
|
2012-02-24 17:22:13 +01:00
|
|
|
$("#provider_" + id).remove();
|
2012-02-23 20:16:11 +01:00
|
|
|
}
|
2011-11-13 21:51:15 +01:00
|
|
|
});
|
2012-02-23 20:16:11 +01:00
|
|
|
}
|
2011-11-13 21:51:15 +01:00
|
|
|
|
2012-02-23 20:16:11 +01:00
|
|
|
function getProviderId(obj) {
|
|
|
|
var parentProviderSection = $(obj).parents('.providerSection');
|
|
|
|
return parentProviderSection.children('.newznabProviderId').val();
|
|
|
|
}
|
2011-11-13 21:51:15 +01:00
|
|
|
|
2012-02-24 17:22:13 +01:00
|
|
|
$(".providerName_textbox").on('keyup', function () {
|
2012-02-23 20:16:11 +01:00
|
|
|
var value = $(this).val();
|
|
|
|
var profileId = getProviderId(this);
|
|
|
|
$("#title_" + profileId).text(value);
|
|
|
|
}).keyup();
|
2012-02-24 17:22:13 +01:00
|
|
|
</script>
|