/
Indexers.ascx
135 lines (131 loc) · 3.79 KB
/
Indexers.ascx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NzbDrone.Web.Models.IndexerSettingsModel>" %>
<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) {
$("#result").empty().html(responseText);
$("#form :input").attr("disabled", false);
}
</script>
<style type="text/css">
#sortable
{
list-style-type: none;
margin: 0;
padding: 0;
width: 30%;
}
#sortable li
{
margin: 0 5px 5px 5px;
padding: 5px;
font-size: 1.2em;
height: 1.5em;
}
#sortable li
{
height: 1.5em;
line-height: 1.2em;
}
.ui-state-highlight
{
height: 1.5em;
line-height: 1.2em;
}
</style>
<script type="text/javascript">
$(function () {
$("#sortable").sortable({
placeholder: "ui-state-highlight"
});
$("#sortable").disableSelection();
});
</script>
<%
using (Html.BeginForm("SaveIndexers", "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>Indexers</legend>
<ul id="sortable">
<%
for (int i = 0; i < Model.Indexers.Count(); i++)
{%>
<li class="ui-state-default" id="<%=Model.Indexers[i].Id%>">
<%=Html.CheckBoxFor(c => c.Indexers[i].Enable)%><%=Html.DisplayTextFor(c => c.Indexers[i].Name)%></li>
<%
}%>
</ul>
<%
for (int i = 0; i < Model.Indexers.Count(); i++)
{%>
<%
}%>
<%--NZBMatrix--%>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbMatrixUsername)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbMatrixUsername)%>
<%=Html.ValidationMessageFor(m => m.NzbMatrixUsername)%>
</div>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbMatrixApiKey)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbMatrixApiKey)%>
<%=Html.ValidationMessageFor(m => m.NzbMatrixApiKey)%>
</div>
<br />
<%--NZBs.Org--%>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbsOrgUId)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbsOrgUId)%>
<%=Html.ValidationMessageFor(m => m.NzbsOrgUId)%>
</div>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbsOrgHash)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbsOrgHash)%>
<%=Html.ValidationMessageFor(m => m.NzbsOrgHash)%>
</div>
<br />
<%--NZBsrus--%>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbsrusUId)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbsrusUId)%>
<%=Html.ValidationMessageFor(m => m.NzbsrusUId)%>
</div>
<div class="editor-label">
<%=Html.LabelFor(m => m.NzbsrusHash)%>
</div>
<div class="editor-field">
<%=Html.TextBoxFor(m => m.NzbsrusHash)%>
<%=Html.ValidationMessageFor(m => m.NzbsrusHash)%>
</div>
<br />
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</fieldset>
<%
}%>
<div id="result">
</div>