2011-05-31 22:50:19 +02:00
|
|
|
@model List<RootDir>
|
2011-05-31 08:13:46 +02:00
|
|
|
@using NzbDrone.Core.Repository
|
2011-07-01 22:59:25 +02:00
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/3.3.0/build/yui/yui-min.js"></script>
|
|
|
|
}
|
|
|
|
|
2011-05-28 09:16:16 +02:00
|
|
|
@section TitleContent{
|
2011-06-28 04:24:42 +02:00
|
|
|
Add Series
|
2011-05-28 09:16:16 +02:00
|
|
|
}
|
|
|
|
@section MainContent{
|
2011-06-25 00:49:23 +02:00
|
|
|
@{ Html.Telerik().Window()
|
2011-05-28 09:16:16 +02:00
|
|
|
.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();
|
2011-06-28 04:24:42 +02:00
|
|
|
}
|
2011-05-31 08:46:24 +02:00
|
|
|
<div style="padding-bottom: 10px; padding-top: 15px;">
|
2011-06-28 04:24:42 +02:00
|
|
|
<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"))
|
2011-05-31 08:46:24 +02:00
|
|
|
</div>
|
2011-07-01 22:59:25 +02:00
|
|
|
|
|
|
|
@{Html.RenderAction("RootDir");}
|
2011-05-31 22:50:19 +02:00
|
|
|
<div id="existingSeries">
|
|
|
|
@{ Html.RenderAction("AddExisting", "AddSeries"); }
|
|
|
|
</div>
|
2011-05-28 09:16:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-01 22:59:25 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
@section Scripts
|
|
|
|
{
|
|
|
|
<script type="text/javascript">
|
|
|
|
function openAddNewSeries() {
|
|
|
|
var window = $('#Window').data('tWindow');
|
|
|
|
window.center().open();
|
|
|
|
window.refresh();
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
}
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
function closeAddNewSeries() {
|
|
|
|
var window = $('#Window').data("tWindow");
|
|
|
|
window.close();
|
|
|
|
}
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
function masterChanged() {
|
|
|
|
var masterQuality = $('#masterDropbox').data("tDropDownList").value();
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
var qualityDropbox = $(".qualityDropbox");
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-05-31 08:13:46 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
function reloadExistingSeries() {
|
|
|
|
$('#reloadAjax').show();
|
|
|
|
$('#existingSeries').load('@Url.Action("AddExisting", "AddSeries")',
|
2011-06-16 08:18:19 +02:00
|
|
|
function (responseText, textStatus, XMLHttpRequest) {
|
|
|
|
$('#reloadAjax').hide();
|
|
|
|
});
|
2011-06-28 04:24:42 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
}
|