1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 18:42:42 +01:00

Indexers settings page now uses jQueryUI accordion

This commit is contained in:
kay.one 2011-11-25 20:02:29 -08:00
parent 596056289e
commit deecc08982
2 changed files with 106 additions and 139 deletions

View File

@ -1,11 +1,8 @@
@using NzbDrone.Web.Helpers @using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.IndexerSettingsModel @model NzbDrone.Web.Models.IndexerSettingsModel
@section HeaderContent{ @section HeaderContent{
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" /> <link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
<link rel="stylesheet" type="text/css" href="../../Content/IndexerSettings.css" /> <style>
<style>
.indexerPanel .indexerPanel
{ {
padding-top: 20px; padding-top: 20px;
@ -21,155 +18,118 @@
} }
</style> </style>
} }
@section TitleContent{ @section TitleContent{
Settings Settings
} }
@section ActionMenu{ @section ActionMenu{
@{Html.RenderPartial("SubMenu");} @{Html.RenderPartial("SubMenu");}
} }
@section MainContent{ @section MainContent{
<div id="stylized"> <div id="stylized">
<div class="additionalInfo">
<div class="additionalInfo"> NzbDrone checks all Indexers every 15 minutes
NzbDrone checks all Indexers every 15 minutes </div>
</div>
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" })) @using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
{ {
<h1>Indexers</h1> <h1>
<p></p> Indexers</h1>
<p>
</p>
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") @Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
<div> <div id="accordion">
@{ Html.Telerik().PanelBar() <h3>
.Name("PanelBar") <a href="#">First header</a></h3>
//.HtmlAttributes(new { style = "width: 500px; margin: 10px;" }) <div class="indexerPanel clearfix">
.ExpandMode(PanelBarExpandMode.Single) <label class="labelClass">
.SelectedIndex(0) Enable <span class="small">@Html.DescriptionFor(m => m.NzbsOrgEnabled)</span>
.Items(indexerItem => </label>
{ @Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "inputClass checkClass" })
indexerItem.Add() <label class="labelClass">@Html.LabelFor(m => m.NzbsOrgUId)
.Text("NZBs.org") <span class="small">@Html.DescriptionFor(m => m.NzbsOrgUId)</span>
.ImageUrl("~/Content/Images/Indexers/Nzbs.org.png") </label>
.Content(@<text> @Html.TextBoxFor(m => m.NzbsOrgUId, new { @class = "inputClass" })
<div class="indexerPanel clearfix"> <label class="labelClass">@Html.LabelFor(m => m.NzbsOrgHash)
<label class="labelClass">Enable <span class="small">@Html.DescriptionFor(m => m.NzbsOrgHash)</span>
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgEnabled)</span> </label>
</label> @Html.TextBoxFor(m => m.NzbsOrgHash, new { @class = "inputClass" })
@Html.CheckBoxFor(m => m.NzbsOrgEnabled, new { @class = "inputClass checkClass" }) </div>
<h3>
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgUId) <a href="#">First header</a></h3>
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgUId)</span> <div class="indexerPanel clearfix">
</label> <label class="labelClass">
@Html.TextBoxFor(m => m.NzbsOrgUId, new { @class = "inputClass" }) Enable <span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span>
</label>
<label class="labelClass">@Html.LabelFor(m => m.NzbsOrgHash) @Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass" })
<span class="small">@Html.DescriptionFor(m => m.NzbsOrgHash)</span> <label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername)
</label> <span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span>
@Html.TextBoxFor(m => m.NzbsOrgHash, new { @class = "inputClass" }) </label>
</div> @Html.TextBoxFor(m => m.NzbMatrixUsername, new { @class = "inputClass" })
</text>); <label class="labelClass">@Html.LabelFor(m => m.NzbMatrixApiKey)
indexerItem.Add() <span class="small">@Html.DescriptionFor(m => m.NzbMatrixApiKey)</span>
.Text("NZB Matrix") </label>
.ImageUrl("~/Content/Images/Indexers/NzbMatrix.png") @Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" })
.Content(@<text> </div>
<div class="indexerPanel clearfix"> <h3>
<label class="labelClass">Enable <a href="#">First header</a></h3>
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixEnabled)</span> <div class="indexerPanel clearfix">
</label> <label class="labelClass">
@Html.CheckBoxFor(m => m.NzbMatrixEnabled, new { @class = "inputClass checkClass" }) Enable <span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span>
</label>
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixUsername) @Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass" })
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixUsername)</span> <label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId)
</label> <span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span>
@Html.TextBoxFor(m => m.NzbMatrixUsername, new { @class = "inputClass" }) </label>
@Html.TextBoxFor(m => m.NzbsrusUId, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbMatrixApiKey) <label class="labelClass">@Html.LabelFor(m => m.NzbsrusHash)
<span class="small">@Html.DescriptionFor(m => m.NzbMatrixApiKey)</span> <span class="small">@Html.DescriptionFor(m => m.NzbsrusHash)</span>
</label> </label>
@Html.TextBoxFor(m => m.NzbMatrixApiKey, new { @class = "inputClass" }) @Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" })
</div> </div>
</text>); <h3>
indexerItem.Add() <a href="#">First header</a></h3>
.Text("NZBsRus") <div class="indexerPanel clearfix">
.ImageUrl("~/Content/Images/Indexers/NzbsRus.png") <label class="labelClass">
.Content(@<text> Enable <span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span>
<div class="indexerPanel clearfix"> </label>
<label class="labelClass">Enable @Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass" })
<span class="small">@Html.DescriptionFor(m => m.NzbsRUsEnabled)</span> <label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername)
</label> <span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span>
@Html.CheckBoxFor(m => m.NzbsRUsEnabled, new { @class = "inputClass checkClass" }) </label>
@Html.TextBoxFor(m => m.NewzbinUsername, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusUId) <label class="labelClass">@Html.LabelFor(m => m.NewzbinPassword)
<span class="small">@Html.DescriptionFor(m => m.NzbsrusUId)</span> <span class="small">@Html.DescriptionFor(m => m.NewzbinPassword)</span>
</label> </label>
@Html.TextBoxFor(m => m.NzbsrusUId, new { @class = "inputClass" }) @Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass" })
</div>
<label class="labelClass">@Html.LabelFor(m => m.NzbsrusHash) <h3><a href="#">First header</a></h3>
<span class="small">@Html.DescriptionFor(m => m.NzbsrusHash)</span> <div class="indexerPanel clearfix">
</label> <label class="labelClass">
@Html.TextBoxFor(m => m.NzbsrusHash, new { @class = "inputClass" }) Enable <span class="small">@Html.DescriptionFor(m => m.NewznabEnabled)</span>
</div> </label>
</text>); @Html.CheckBoxFor(m => m.NewznabEnabled, new { @class = "inputClass checkClass" })
indexerItem.Add() <p>
.Text("Newzbin") </p>
.ImageUrl("~/Content/Images/Indexers/Newzbin.png") <a id="addItem" href="@Url.Action("AddNewznabProvider", "Settings")">
.Content(@<text> <img src="../../Content/Images/Plus.png" alt="Add Newznab Provider" width="20px"
<div class="indexerPanel clearfix"> height="20px" />
<label class="labelClass">Enable Add Newznab Provider</a>
<span class="small">@Html.DescriptionFor(m => m.NewzbinEnabled)</span> <div id="newznabProviders">
</label> @foreach (var provider in Model.NewznabDefinitions)
@Html.CheckBoxFor(m => m.NewzbinEnabled, new { @class = "inputClass checkClass" }) {
Html.RenderAction("GetNewznabProviderView", provider);
<label class="labelClass">@Html.LabelFor(m => m.NewzbinUsername) }
<span class="small">@Html.DescriptionFor(m => m.NewzbinUsername)</span> </div>
</label> </div>
@Html.TextBoxFor(m => m.NewzbinUsername, new { @class = "inputClass" }) </div>
<br />
<label class="labelClass">@Html.LabelFor(m => m.NewzbinPassword) <button type="submit" id="save_button" disabled="disabled">
<span class="small">@Html.DescriptionFor(m => m.NewzbinPassword)</span> Save</button>
</label>
@Html.TextBoxFor(m => m.NewzbinPassword, new { @class = "inputClass" })
</div>
</text>);
indexerItem.Add()
.Text("Newznzb")
.ImageUrl("~/Content/Images/Indexers/Newznab.png")
.Content(@<text>
<div class="indexerPanel clearfix">
<label class="labelClass">Enable
<span class="small">@Html.DescriptionFor(m => m.NewznabEnabled)</span>
</label>
@Html.CheckBoxFor(m => m.NewznabEnabled, new { @class = "inputClass checkClass" })
</div>
<p></p>
<a id="addItem" href="@Url.Action("AddNewznabProvider", "Settings")">
<img src="../../Content/Images/Plus.png" alt="Add Newznab Provider" width="20px" height="20px" />
Add Newznab Provider</a>
<div id="newznabProviders">
@foreach (var provider in Model.NewznabDefinitions)
{
Html.RenderAction("GetNewznabProviderView", provider);
}
</div>
</text>);
}).Render();
} }
</div>
<br/>
<button type="submit" id="save_button" disabled="disabled">Save</button>
}
</div> </div>
} }
@section Scripts{ @section Scripts{
<script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script> <script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$("#addItem").live('click', function () { $("#addItem").live('click', function () {
$.ajax({ $.ajax({
@ -182,6 +142,13 @@
return false; return false;
}); });
$(function () {
$("#accordion").accordion({
autoHeight: false });
});
var deleteNewznabProviderUrl = '@Url.Action("DeleteNewznabProvider", "Settings")'; var deleteNewznabProviderUrl = '@Url.Action("DeleteNewznabProvider", "Settings")';
function deleteProvider(id) { function deleteProvider(id) {
@ -216,4 +183,4 @@
}).keyup(); }).keyup();
</script> </script>
} }

View File

@ -85,7 +85,7 @@
@section Scripts{ @section Scripts{
<script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script> <script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script>
<script> <script type="text/javascript">
$(function () { $(function () {
$("#tabs").tabs(); $("#tabs").tabs();
}); });