commit
25007c7807
After Width: | Height: | Size: 1.1 KiB |
@ -1,70 +0,0 @@
|
||||
@model IEnumerable<String>
|
||||
|
||||
<script type="text/javascript" src="../../Scripts/2011.1.315/telerik.window.min.js"></script>
|
||||
|
||||
@section TitleContent{
|
||||
Add Series
|
||||
}
|
||||
|
||||
@section MainContent{
|
||||
|
||||
@{ Html.Telerik().Window()
|
||||
.Name("Window")
|
||||
.Title("Add New Series")
|
||||
.Modal(true)
|
||||
.Buttons(b => b.Close())
|
||||
.Width(500)
|
||||
.Height(200)
|
||||
.Visible(false)
|
||||
.Draggable(true)
|
||||
.Resizable(resizing => resizing.Enabled(false))
|
||||
.LoadContentFrom("AddNew", "AddSeries")
|
||||
.Render();
|
||||
}
|
||||
|
||||
@if (Model.Count() == 0)
|
||||
{
|
||||
@Html.DisplayText("No Series to Add");
|
||||
}
|
||||
|
||||
@Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes(
|
||||
new {style = "width: 100px; margin-left:5px;"}).ClientEvents(events => events.OnChange("masterChanged"))
|
||||
|
||||
<button onclick="openAddNewSeries(); return false;" class="listButton" style="margin-left:210px">Add New</button>
|
||||
|
||||
@foreach (var path in Model)
|
||||
{
|
||||
Html.RenderAction("RenderPartial", "AddSeries", new {path});
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function openAddNewSeries() {
|
||||
var windowElement = $('#Window');
|
||||
|
||||
windowElement.data('tWindow').center().open();
|
||||
}
|
||||
|
||||
function closeAddNewSeries() {
|
||||
var window = $('#Window').data("tWindow");
|
||||
window.close();
|
||||
}
|
||||
|
||||
function masterChanged() {
|
||||
var masterQuality = $('#masterDropbox').data("tDropDownList").value();
|
||||
|
||||
var qualityDropbox = $(".qualityDropbox");
|
||||
|
||||
qualityDropbox.each(function () {
|
||||
var child = $(this).children("[id^='qualityList']");
|
||||
var comboBox = child.data("tDropDownList");
|
||||
comboBox.value(masterQuality);
|
||||
});
|
||||
}
|
||||
|
||||
function testValue() {
|
||||
var comboBox = $('#qualityList_tester').data("tDropDownList");
|
||||
comboBox.value('2');
|
||||
}
|
||||
</script>
|
@ -0,0 +1,15 @@
|
||||
@model IEnumerable<String>
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
@if (Model.Count() == 0)
|
||||
{
|
||||
@Html.DisplayText("No Series to Add");
|
||||
}
|
||||
|
||||
@foreach (var path in Model)
|
||||
{
|
||||
Html.RenderAction("RenderPartial", "AddSeries", new {path});
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
@model List<RootDir>
|
||||
@using NzbDrone.Core.Repository
|
||||
|
||||
<script type="text/javascript" src="../../Scripts/2011.1.315/telerik.window.min.js"></script>
|
||||
|
||||
<style>
|
||||
.root_dir_text
|
||||
{
|
||||
width: 300px;
|
||||
margin-top: 8px;
|
||||
margin-left: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
||||
@section TitleContent{
|
||||
Add Series
|
||||
}
|
||||
|
||||
@section MainContent{
|
||||
|
||||
@{ Html.Telerik().Window()
|
||||
.Name("Window")
|
||||
.Title("Add New Series")
|
||||
.Modal(true)
|
||||
.Buttons(b => b.Close())
|
||||
.Width(500)
|
||||
.Height(200)
|
||||
.Visible(false)
|
||||
.Draggable(true)
|
||||
.Resizable(resizing => resizing.Enabled(false))
|
||||
.LoadContentFrom("AddNew", "AddSeries")
|
||||
.Render();
|
||||
}
|
||||
|
||||
@{ Html.Telerik().PanelBar()
|
||||
.Name("RootDirPanel")
|
||||
.HtmlAttributes(new { style = "margin: 0px;" })
|
||||
.ExpandMode(PanelBarExpandMode.Multiple)
|
||||
.Items(panelItem =>
|
||||
{
|
||||
panelItem.Add()
|
||||
.Text("Root Directories")
|
||||
.ImageUrl("~/Content/Images/VideoFolder.png")
|
||||
.Content(@<text>
|
||||
<div style="padding-top: 10px;">
|
||||
<div style="padding-left: 7px; margin-bottom: 5px;">
|
||||
<a id="addItem" style="text-decoration:none;" href="@Url.Action("AddRootDir", "AddSeries")">
|
||||
<img src="../../Content/Images/Plus.png" alt="Add New Profile" width="20px" height="20px" />
|
||||
<h4 style="margin-left: 3px; display: inline; color: Black;">Add New Root Directory</h4></a>
|
||||
</div>
|
||||
|
||||
<div id="root-dirs">
|
||||
@foreach (var root in Model)
|
||||
{
|
||||
Html.RenderAction("GetRootDirView", root);
|
||||
}
|
||||
</div>
|
||||
<button onclick="reloadExistingSeries()" style="padding: 2px 10px 2px 10px; margin: 5px; margin-bottom: 10px;">Refresh Unmapped</button>
|
||||
</div>
|
||||
</text>);
|
||||
}).Render();
|
||||
}
|
||||
|
||||
<div style="padding-bottom: 10px; padding-top: 15px;">
|
||||
<button onclick="openAddNewSeries(); return false;" class="listButton" style="margin-left:5px">Add New</button>
|
||||
|
||||
@Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes(
|
||||
new {style = "width: 100px; margin-left:224px;"}).ClientEvents(events => events.OnChange("masterChanged"))
|
||||
|
||||
</div>
|
||||
|
||||
<div id="existingSeries">
|
||||
@{ Html.RenderAction("AddExisting", "AddSeries"); }
|
||||
</div>
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
function openAddNewSeries() {
|
||||
var windowElement = $('#Window');
|
||||
|
||||
windowElement.data('tWindow').center().open();
|
||||
}
|
||||
|
||||
function closeAddNewSeries() {
|
||||
var window = $('#Window').data("tWindow");
|
||||
window.close();
|
||||
}
|
||||
|
||||
function masterChanged() {
|
||||
var masterQuality = $('#masterDropbox').data("tDropDownList").value();
|
||||
|
||||
var qualityDropbox = $(".qualityDropbox");
|
||||
|
||||
qualityDropbox.each(function () {
|
||||
var child = $(this).children("[id^='qualityList']");
|
||||
var comboBox = child.data("tDropDownList");
|
||||
comboBox.value(masterQuality);
|
||||
});
|
||||
}
|
||||
|
||||
var addSeriesUrl = '@Url.Action("AddSeries", "AddSeries")';
|
||||
|
||||
function addSeries(guid, path) {
|
||||
var seriesComboBox = $("#seriesList_" + guid).data("tComboBox");
|
||||
var qualityComboBox = $("#qualityList_" + guid).data("tDropDownList");
|
||||
sendToServer(seriesComboBox.value(), path, qualityComboBox.value());
|
||||
$("#div_" + guid).hide();
|
||||
}
|
||||
|
||||
function sendToServer(id, path, quality) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: addSeriesUrl,
|
||||
data: jQuery.param({ path: path, seriesId: id, qualityProfileId: quality }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not add " + path + " at this time. " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#addItem").click(function () {
|
||||
$.ajax({
|
||||
url: this.href,
|
||||
cache: false,
|
||||
success: function (html) { $("#root-dirs").append(html); }
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
var deleteRootDirUrl = '@Url.Action("DeleteRootDir", "AddSeries")';
|
||||
|
||||
function deleteRootDir(id) {
|
||||
sendToServer(id);
|
||||
}
|
||||
|
||||
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);
|
||||
},
|
||||
success: function () {
|
||||
$("#rootDir_" + id).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var saveRootDirUrl = '@Url.Action("SaveRootDir", "AddSeries")';
|
||||
|
||||
function saveRootDir(id) {
|
||||
var path = $('#path_' + id).val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: saveRootDirUrl,
|
||||
data: jQuery.param({ id: id, path: path }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not save " + path + " at this time. " + error);
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data != 'ok')
|
||||
alert("An error occurred while saving Root Directory: " + path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reloadExistingSeries() {
|
||||
$('#existingSeries').load('@Url.Action("AddExisting", "AddSeries")');
|
||||
}
|
||||
</script>
|
@ -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>
|
||||
<button style="padding: 2px 10px 2px 10px; vertical-align: middle; margin: 0px; margin-top: 7px;" onclick="saveRootDir(@Model.Id)">Save</button>
|
||||
|
||||
@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