2011-07-08 06:27:11 +03:00
|
|
|
@using System.Collections
|
|
|
|
@using NzbDrone.Web.Models
|
|
|
|
@{ Layout = null; }
|
2011-05-28 10:16:16 +03:00
|
|
|
<div>
|
2011-07-28 01:59:48 +03:00
|
|
|
<div>
|
|
|
|
<input id="newSeriesLookup" class="seriesLookup" type="text" style="width: 400px" />
|
|
|
|
</div>
|
|
|
|
<input id="newSeriesPath" class="folderLookup" type="text" style="width: 400px" />
|
|
|
|
@Html.DropDownList("qualityList", new SelectList((IList)ViewData["QualityList"], "QualityProfileId", "Name"), new { @class = "qualitySelector" })
|
|
|
|
<button id="saveNewSeries">
|
2011-05-28 10:16:16 +03:00
|
|
|
Add</button>
|
|
|
|
</div>
|
2011-07-28 01:59:48 +03:00
|
|
|
<br />
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
jQuery(document).ready(function () {
|
|
|
|
|
|
|
|
$('#newSeriesPath').watermark('Path for the new series...');
|
|
|
|
$('#newSeriesLookup').watermark('Title of the series you want to add...');
|
2011-05-28 10:16:16 +03:00
|
|
|
|
2011-07-28 01:59:48 +03:00
|
|
|
$('#saveNewSeries').click(function () {
|
2011-06-28 05:24:42 +03:00
|
|
|
|
2011-07-28 01:59:48 +03:00
|
|
|
var addSeriesUrl = '@Url.Action("AddNewSeries", "AddSeries")';
|
|
|
|
var seriesTitle = $("#newSeriesLookup").val();
|
|
|
|
var qualityId = $("#qualityList").val();
|
|
|
|
var path = $('#newSeriesPath').val();
|
2011-05-28 10:16:16 +03:00
|
|
|
|
2011-06-28 05:24:42 +03:00
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2011-07-28 01:59:48 +03:00
|
|
|
url: addSeriesUrl,
|
|
|
|
data: jQuery.param({ path: path, seriesName: seriesTitle, qualityProfileId: qualityId }),
|
2011-06-28 05:24:42 +03:00
|
|
|
error: function (req, status, error) {
|
2011-07-28 01:59:48 +03:00
|
|
|
alert("Sorry! We could not add " + path + " at this time. " + error);
|
2011-06-28 05:24:42 +03:00
|
|
|
},
|
2011-07-28 01:59:48 +03:00
|
|
|
success: function () {
|
|
|
|
$("#newSeriesLookup").val("");
|
|
|
|
$('#newSeriesPath').val("");
|
2011-06-28 05:24:42 +03:00
|
|
|
}
|
|
|
|
});
|
2011-07-28 01:59:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|