parent
c65b0a68b0
commit
9deea44c87
File diff suppressed because it is too large
Load Diff
@ -1,44 +1,52 @@
|
||||
@using NzbDrone.Web.Models
|
||||
@model IEnumerable<String>
|
||||
@{
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<div>
|
||||
<input id="rootDirInput" type="text" style="width: 400px" />
|
||||
<button id="saveDir">
|
||||
Add</button>
|
||||
</div>
|
||||
<div id="rootDirs">
|
||||
@foreach (var root in Model)
|
||||
{
|
||||
<div class="actionButton delete">
|
||||
<img src="/Content/Images/x_16.png" alt="delete" id='@root'/>
|
||||
<span>@root</span>
|
||||
</div>
|
||||
}
|
||||
@{Html.RenderAction("RootList");}
|
||||
</div>
|
||||
<br />
|
||||
<label for="ac-input">
|
||||
Enter a GitHub username:</label>
|
||||
<input id="rootDirInput" type="text" style="width: 100px" />
|
||||
<button id="saveDir">
|
||||
Save</button>
|
||||
@(Html.Telerik().ScriptRegistrar().DefaultGroup(c => c.Add("http://ajax.googleapis.com/ajax/libs/yui/3.3.0/build/yui/yui-min.js")
|
||||
.Add("AutoComplete.js")
|
||||
).OnDocumentReady("bindFolderAutoComplete('#rootDirInput')"))
|
||||
|
||||
@(Html.Telerik().ScriptRegistrar().OnDocumentReady("onRootReady()"))
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
function onRootReady() {
|
||||
|
||||
$('#rootDirInput').watermark('Start typing to add new root folder...');
|
||||
|
||||
$('#rootDirs .actionButton img').live('click',
|
||||
function (image) {
|
||||
var path = $(image.srcElement).attr('id');
|
||||
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function () {
|
||||
refreshRoot();
|
||||
});
|
||||
});
|
||||
|
||||
$('#saveDir').click(saveRootDir);
|
||||
|
||||
function saveRootDir() {
|
||||
var path = $("#rootDirInput").val();
|
||||
$.post("/AddSeries/SaveRootDir", { Path: path });
|
||||
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function () {
|
||||
refreshRoot();
|
||||
$("#rootDirInput").val('');
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#rootDirs .actionButton img').live('click',
|
||||
function (image) {
|
||||
var path = $(image.srcElement).attr('id');
|
||||
$.post("/AddSeries/DeleteRootDir", { Path: path });
|
||||
function refreshRoot() {
|
||||
$.get('@Url.Action("RootList", "AddSeries")', function (data) {
|
||||
$('#rootDirs').html(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -0,0 +1,14 @@
|
||||
@model IEnumerable<String>
|
||||
@if (Model.Count() == 0)
|
||||
{
|
||||
<div class="actionButton delete">
|
||||
<span>You have no root folders added.</span>
|
||||
</div>
|
||||
}
|
||||
@foreach (var root in Model)
|
||||
{
|
||||
<div class="actionButton delete">
|
||||
<img src="/Content/Images/x_16.png" alt="delete" id='@root'/>
|
||||
<span>@root</span>
|
||||
</div>
|
||||
}
|
Loading…
Reference in new issue