2011-07-01 23:33:03 +03:00
|
|
|
@using NzbDrone.Web.Helpers
|
|
|
|
@model NzbDrone.Web.Models.IndexerSettingsModel
|
2012-10-15 03:50:01 +03:00
|
|
|
|
|
|
|
@{
|
|
|
|
Layout = "_SettingsLayout.cshtml";
|
|
|
|
}
|
2012-02-24 19:22:13 +03:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.indexerStatusContainer {
|
|
|
|
margin-left: 14px;
|
|
|
|
}
|
|
|
|
</style>
|
2012-10-15 03:50:01 +03:00
|
|
|
|
2012-02-23 03:35:52 +03:00
|
|
|
<div class="indexerStatusContainer">
|
2012-02-24 19:22:13 +03:00
|
|
|
@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("newznabStatus", @Model.NewznabEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="newznabStatus">Newznab</label>
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
@Html.CheckBox("womblesStatus", @Model.WomblesEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="womblesStatus">Womble's Index</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("fileSharingTalkStatus", @Model.FileSharingTalkEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="fileSharingTalkStatus">File Sharing Talk</label>
|
2012-04-15 03:04:08 +03:00
|
|
|
|
|
|
|
@Html.CheckBox("nzbIndexStatus", @Model.NzbIndexEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="nzbIndexStatus">NzbIndex</label>
|
|
|
|
|
|
|
|
@Html.CheckBox("nzbClubStatus", @Model.NzbClubEnabled, new { @class = "indexerStatusButton" })
|
|
|
|
<label for="nzbClubStatus">Nzb Club</label>
|
2012-02-23 03:35:52 +03:00
|
|
|
</div>
|
2011-12-01 08:04:44 +03:00
|
|
|
<div id="stylized">
|
2011-12-01 09:39:11 +03:00
|
|
|
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "IndexersForm", name = "IndexersForm", @class = "settingsForm" }))
|
2012-02-17 12:32:33 +03:00
|
|
|
{
|
2012-10-07 22:50:16 +03:00
|
|
|
<div class="jquery-accordion jquery-accordion-collapse-all">
|
2012-04-14 09:44:34 +03:00
|
|
|
<h3><a href="#">NZBMatrix</a></h3>
|
2011-12-01 08:04:44 +03:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 03:35:52 +03:00
|
|
|
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 08:04:44 +03:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span>
|
2012-02-24 19:22:13 +03:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbMatrixUsername)</span>
|
2011-12-01 08:04:44 +03: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 19:22:13 +03:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbMatrixApiKey)</span>
|
2011-12-01 08:04:44 +03:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" })
|
|
|
|
</div>
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
<h3><a href="#">NZBsRus</a></h3>
|
2011-12-01 08:04:44 +03:00
|
|
|
<div class="indexerPanel">
|
2012-04-14 09:44:34 +03:00
|
|
|
<div class="warningBox">NZBsRus does not support backlog searching</div>
|
2011-12-01 08:04:44 +03:00
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 03:35:52 +03:00
|
|
|
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 08:04:44 +03:00
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span>
|
2012-02-24 19:22:13 +03:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsrusUId)</span>
|
2011-12-01 08:04:44 +03: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 19:22:13 +03:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.NzbsrusHash)</span>
|
2011-12-01 08:04:44 +03:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
|
|
|
|
</div>
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
<h3><a href="#">Newznab</a></h3>
|
2011-12-01 08:04:44 +03:00
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NewznabEnabled)</span>
|
|
|
|
</label>
|
2012-02-23 03:35:52 +03:00
|
|
|
@Html.CheckBoxFor(m => m.NewznabEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
2011-12-01 08:04:44 +03:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<p>
|
|
|
|
</p>
|
2012-02-25 02:27:45 +03:00
|
|
|
<a id="addNewznab" href="@Url.Action("AddNewznabProvider", "Settings")">
|
2011-12-01 08:04:44 +03:00
|
|
|
<img src="../../Content/Images/Plus.png" alt="Add Newznab Provider" width="20px"
|
2012-02-24 19:22:13 +03:00
|
|
|
height="20px" />
|
2011-12-01 08:04:44 +03:00
|
|
|
Add Newznab Provider</a>
|
|
|
|
<div id="newznabProviders">
|
|
|
|
@foreach (var provider in Model.NewznabDefinitions)
|
|
|
|
{
|
|
|
|
Html.RenderAction("GetNewznabProviderView", provider);
|
|
|
|
}
|
2011-11-26 07:02:29 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
<h3><a href="#">Womble's Index</a></h3>
|
|
|
|
<div class="indexerPanel">
|
|
|
|
<div class="warningBox">Womble's Index does not support backlog searching</div>
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.WomblesEnabled)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.WomblesEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3><a href="#">File Sharing Talk</a></h3>
|
|
|
|
<div class="indexerPanel">
|
|
|
|
<div class="warningBox">File Sharing Talk does not support backlog searching</div>
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.FileSharingTalkEnabled)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.FileSharingTalkEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.FileSharingTalkUid)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.FileSharingTalkUid)</span>
|
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.FileSharingTalkUid)</span>
|
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.FileSharingTalkUid, new { @class = "inputClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.FileSharingTalkSecret)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.FileSharingTalkSecret)</span>
|
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.FileSharingTalkSecret)</span>
|
|
|
|
</label>
|
2012-04-14 10:46:42 +03:00
|
|
|
@Html.TextBoxFor(m => m.FileSharingTalkSecret, new { @class = "inputClass" })
|
2012-04-14 09:44:34 +03:00
|
|
|
</div>
|
2012-04-15 03:04:08 +03:00
|
|
|
|
|
|
|
<h3><a href="#">NzbIndex</a></h3>
|
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbIndexEnabled)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.NzbIndexEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3><a href="#">NzbClub</a></h3>
|
|
|
|
<div class="indexerPanel">
|
|
|
|
<label class="labelClass">
|
|
|
|
Enable <span class="small">@Html.DescriptionFor(m => m.NzbClubEnabled)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.NzbClubEnabled, new { @class = "inputClass checkClass enabledCheck" })
|
|
|
|
</div>
|
2011-12-01 08:04:44 +03:00
|
|
|
</div>
|
2012-02-17 12:32:33 +03:00
|
|
|
|
2012-10-07 22:16:43 +03:00
|
|
|
<div class="indexer-global-settings">
|
2012-02-17 12:32:33 +03:00
|
|
|
@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>
|
2012-02-26 00:21:41 +03:00
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.Retention)</span>
|
2012-02-17 12:32:33 +03:00
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.Retention, new { @class = "inputClass" })
|
2012-10-07 22:16:43 +03:00
|
|
|
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.RssSyncInterval)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.RssSyncInterval)</span>
|
|
|
|
<span class="small">@Html.ValidationMessageFor(m => m.RssSyncInterval)</span>
|
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.RssSyncInterval, new { @class = "inputClass" })
|
2012-02-17 12:32:33 +03:00
|
|
|
</div>
|
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
<button type="submit" class="save_button" disabled="disabled">Save</button>
|
2011-12-01 08:04:44 +03:00
|
|
|
}
|
|
|
|
</div>
|
2012-02-24 19:22:13 +03:00
|
|
|
|
2012-10-15 03:50:01 +03:00
|
|
|
@section Scripts
|
|
|
|
{
|
|
|
|
<script type="text/javascript">
|
2012-02-23 22:16:11 +03:00
|
|
|
$(document).ready(function () {
|
2012-02-24 19:22:13 +03:00
|
|
|
//Allow unobstrusive validation of the AJAX loaded form
|
|
|
|
$.validator.unobtrusive.parse("#IndexersForm");
|
|
|
|
|
|
|
|
//Make the buttons
|
|
|
|
$('.indexerStatusButton').button();
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
//Validator Settings
|
|
|
|
var settings = $.data($('#IndexersForm')[0], 'validator').settings;
|
|
|
|
settings.ignore = [];
|
|
|
|
settings.focusInvalid = false;
|
|
|
|
settings.onfocusout = function (element) { $(element).valid(); };
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
var oldHighlight = settings.highlight;
|
|
|
|
var oldUnhighlight = settings.unhighlight;
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
settings.highlight = function (element, errorClass, validClass) {
|
|
|
|
oldHighlight(element, errorClass, validClass);
|
2012-02-26 00:21:41 +03:00
|
|
|
$(element).parents('div.ui-accordion-content').prev('h3.ui-accordion-header').addClass('validation-error');
|
2012-02-24 19:22:13 +03:00
|
|
|
};
|
|
|
|
settings.unhighlight = function (element, errorClass, validClass) {
|
|
|
|
oldUnhighlight(element, errorClass, validClass);
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-26 00:21:41 +03:00
|
|
|
var container = $(element).parents('div.ui-accordion-content');
|
2012-02-24 19:22:13 +03:00
|
|
|
if ($(container).children('.' + errorClass).length == 0)
|
|
|
|
$(container).prev('h3.ui-accordion-header').removeClass('validation-error');
|
|
|
|
};
|
2012-02-23 22:16:11 +03:00
|
|
|
});
|
|
|
|
|
2012-02-26 00:21:41 +03:00
|
|
|
$(document).on('change', '.enabledCheck', function () {
|
2012-02-24 19:22:13 +03:00
|
|
|
var id = $(this).prop('id');
|
|
|
|
var checked = $(this).prop('checked');
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-23 22:16:11 +03:00
|
|
|
if (id == 'NzbMatrixEnabled')
|
2012-02-24 19:22:13 +03:00
|
|
|
$('#nzbMatrixStatus').prop('checked', checked);
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-23 22:16:11 +03:00
|
|
|
if (id == 'NzbsRUsEnabled')
|
2012-02-24 19:22:13 +03:00
|
|
|
$('#nzbsRusStatus').prop('checked', checked);
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-23 22:16:11 +03:00
|
|
|
if (id == 'NewznabEnabled')
|
2012-02-24 19:22:13 +03:00
|
|
|
$('#newznabStatus').prop('checked', checked);
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
if (id == 'WomblesEnabled')
|
|
|
|
$('#womblesStatus').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'FileSharingTalkEnabled')
|
|
|
|
$('#fileSharingTalkStatus').prop('checked', checked);
|
2012-04-15 03:04:08 +03:00
|
|
|
|
|
|
|
if (id == 'NzbIndexEnabled')
|
|
|
|
$('#nzbIndexStatus').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'NzbClubEnabled')
|
|
|
|
$('#nzbClubStatus').prop('checked', checked);
|
2012-02-24 19:22:13 +03:00
|
|
|
|
|
|
|
$('.indexerStatusButton').button("refresh");
|
|
|
|
reValidate();
|
|
|
|
});
|
|
|
|
|
2012-02-26 00:21:41 +03:00
|
|
|
$(document).on('change', '.indexerStatusButton', function () {
|
2012-02-24 19:22:13 +03:00
|
|
|
var id = $(this).prop('id');
|
|
|
|
var checked = $(this).prop('checked');
|
2012-05-04 01:08:35 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
if (id == 'nzbMatrixStatus')
|
|
|
|
$('#NzbMatrixEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'nzbsRusStatus')
|
|
|
|
$('#NzbsRUsEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'newznabStatus')
|
|
|
|
$('#NewznabEnabled').prop('checked', checked);
|
2012-04-14 09:44:34 +03:00
|
|
|
|
|
|
|
if (id == 'womblesStatus')
|
|
|
|
$('#WomblesEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'fileSharingTalkStatus')
|
2012-04-14 10:46:42 +03:00
|
|
|
$('#FileSharingTalkEnabled').prop('checked', checked);
|
2012-04-15 03:04:08 +03:00
|
|
|
|
|
|
|
if (id == 'nzbIndexStatus')
|
|
|
|
$('#NzbIndexEnabled').prop('checked', checked);
|
|
|
|
|
|
|
|
if (id == 'nzbClubStatus')
|
|
|
|
$('#NzbClubEnabled').prop('checked', checked);
|
2012-02-24 19:22:13 +03:00
|
|
|
|
|
|
|
reValidate();
|
2012-02-23 22:16:11 +03:00
|
|
|
});
|
2012-02-23 03:35:52 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
function reValidate() {
|
|
|
|
$("#IndexersForm").validate().form();
|
|
|
|
|
2012-02-26 00:21:41 +03:00
|
|
|
var container = $('div.ui-accordion-content');
|
2012-02-24 19:22:13 +03:00
|
|
|
if ($(container).children('.input-validation-error').length == 0)
|
|
|
|
$(container).prev('h3.ui-accordion-header').removeClass('validation-error');
|
|
|
|
}
|
|
|
|
|
|
|
|
//Newznab
|
2012-02-25 02:27:45 +03:00
|
|
|
$("#addNewznab").on('click', function (event) {
|
2012-02-23 22:16:11 +03:00
|
|
|
$.ajax({
|
|
|
|
url: this.href,
|
|
|
|
cache: false,
|
|
|
|
success: function (html) {
|
|
|
|
$("#newznabProviders").append(html);
|
|
|
|
}
|
2012-02-23 03:35:52 +03:00
|
|
|
});
|
2012-02-25 02:27:45 +03:00
|
|
|
event.preventDefault();
|
|
|
|
//event.stopPropagation();
|
2012-02-23 22:16:11 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
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 19:22:13 +03:00
|
|
|
$("#provider_" + id).remove();
|
2012-02-23 22:16:11 +03:00
|
|
|
}
|
2011-11-13 23:51:15 +03:00
|
|
|
});
|
2012-02-23 22:16:11 +03:00
|
|
|
}
|
2011-11-13 23:51:15 +03:00
|
|
|
|
2012-02-23 22:16:11 +03:00
|
|
|
function getProviderId(obj) {
|
|
|
|
var parentProviderSection = $(obj).parents('.providerSection');
|
|
|
|
return parentProviderSection.children('.newznabProviderId').val();
|
|
|
|
}
|
2011-11-13 23:51:15 +03:00
|
|
|
|
2012-02-24 19:22:13 +03:00
|
|
|
$(".providerName_textbox").on('keyup', function () {
|
2012-02-23 22:16:11 +03:00
|
|
|
var value = $(this).val();
|
|
|
|
var profileId = getProviderId(this);
|
|
|
|
$("#title_" + profileId).text(value);
|
|
|
|
}).keyup();
|
2012-02-24 19:22:13 +03:00
|
|
|
</script>
|
2012-10-15 03:50:01 +03:00
|
|
|
}
|