Cleaned up Indexers.cshtml. Indexers is the new default Settings page.pull/2/head
parent
f6578bd535
commit
f27c1d89f6
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,16 @@
|
|||||||
|
@model NzbDrone.Core.Repository.RootDir
|
||||||
|
|
||||||
|
@{
|
||||||
|
Layout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="rootDirSection" id="rootDir_@(Model.Id)" style="padding: 7px; padding-left: 3px;">
|
||||||
|
<fieldset style="padding: 5px; height: 40px;">
|
||||||
|
@Html.TextBoxFor(m => m.Path, new { @class = "root_dir_text", id = "path_" + Model.Id })
|
||||||
|
<a href="#" class="deleteRow" onclick="deleteRootDir('@ViewData["RootDirId"]')">
|
||||||
|
<img src="../../Content/Images/X.png" alt="Delete" width="20px" height="20px" style="vertical-align: middle; margin-top: 7px;"/></a>
|
||||||
|
<input type="button" value="Save" style="padding: 2px 10px 2px 10px; vertical-align: middle; margin: 0px; margin-top: 7px;" onclick="saveRootDir(@Model.Id)"/>
|
||||||
|
|
||||||
|
@Html.HiddenFor(x => x.Id, new { id = "id_" + Model.Id })
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
@ -1,88 +0,0 @@
|
|||||||
@model NzbDrone.Web.Models.SettingsModel
|
|
||||||
|
|
||||||
<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', '');
|
|
||||||
|
|
||||||
$(".root_dir_text").autocomplete({ url: '@Url.Action("AutoCompletePath", "Settings")', paramName: 'path', minChars: 3, delay: 300, maxCacheLength: 1 });
|
|
||||||
|
|
||||||
$(".root_dir_text").autocomplete({
|
|
||||||
source: '@Url.Action("JsonAutoCompletePath", "Settings")',
|
|
||||||
minLength: 3
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
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>
|
|
||||||
|
|
||||||
@using (Html.BeginForm("SaveGeneral", "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>General</legend>
|
|
||||||
|
|
||||||
<div style="padding-top: 10px;">
|
|
||||||
<div style="padding-left: 7px; margin-bottom: 5px;">
|
|
||||||
<a id="addItem" style="text-decoration:none;" href="@Url.Action("AddRootDir", "Settings")">
|
|
||||||
<img src="../../Content/Images/Plus.png" alt="Add New Profile" />
|
|
||||||
<h4 style="margin-left: 3px; display: inline; color: Black;">Add New Root Directory</h4></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="root-dirs">
|
|
||||||
@foreach (var item in Model.Directories)
|
|
||||||
{
|
|
||||||
Html.RenderAction("GetRootDirView", item);
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="submit" id="save_button" value="Save" disabled="disabled" />
|
|
||||||
</fieldset>
|
|
||||||
}
|
|
||||||
<div id="result" class="hiddenResult"></div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
$("#addItem").click(function () {
|
|
||||||
$.ajax({
|
|
||||||
url: this.href,
|
|
||||||
cache: false,
|
|
||||||
success: function (html) { $("#root-dirs").append(html); }
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
var deleteRootDirUrl = '@Url.Action("DeleteRootDir", "Settings")';
|
|
||||||
|
|
||||||
function deleteRootDir(id) {
|
|
||||||
sendToServer(id);
|
|
||||||
$("#div_" + id).remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendToServer(id) {
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: deleteRootDirUrl,
|
|
||||||
data: jQuery.param({ rootDirId: id }),
|
|
||||||
error: function (req, status, error) {
|
|
||||||
alert("Sorry! We could not delete your Root Directory at this time. " + error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,35 +0,0 @@
|
|||||||
@model NzbDrone.Core.Repository.RootDir
|
|
||||||
@using NzbDrone.Web.Helpers;
|
|
||||||
|
|
||||||
@{
|
|
||||||
Layout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
.root_dir_text
|
|
||||||
{
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@using (Html.BeginCollectionItem("Directories"))
|
|
||||||
{
|
|
||||||
var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_');
|
|
||||||
|
|
||||||
|
|
||||||
<div class="rootDirSection" id="div_@(ViewData["RootDirId"])">
|
|
||||||
<fieldset>
|
|
||||||
<div class="ui-widget">
|
|
||||||
@Html.TextBoxFor(m => m.Path, new { @class = "root_dir_text" })
|
|
||||||
<a href="#" class="deleteRow" onclick="deleteRootDir('@ViewData["RootDirId"]')">
|
|
||||||
<img src="../../Content/Images/X.png" alt="Delete" /></a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
@Html.ValidationMessageFor(m => m.Path)
|
|
||||||
</div>
|
|
||||||
<div class="hiddenProfileDetails">
|
|
||||||
@Html.TextBoxFor(x => x.Id, new { @style = "display:none" })
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
}
|
|
Loading…
Reference in new issue