2011-07-08 03:27:11 +00:00
|
|
|
@using System.Collections
|
|
|
|
@using NzbDrone.Web.Models
|
|
|
|
@{ Layout = null; }
|
2011-05-28 07:16:16 +00:00
|
|
|
<div>
|
2011-07-27 22:59:48 +00: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 07:16:16 +00:00
|
|
|
Add</button>
|
|
|
|
</div>
|
2011-07-27 22:59:48 +00: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 07:16:16 +00:00
|
|
|
|
2011-07-27 22:59:48 +00:00
|
|
|
$('#saveNewSeries').click(function () {
|
2011-06-28 02:24:42 +00:00
|
|
|
|
2011-07-27 22:59:48 +00:00
|
|
|
var addSeriesUrl = '@Url.Action("AddNewSeries", "AddSeries")';
|
|
|
|
var seriesTitle = $("#newSeriesLookup").val();
|
|
|
|
var qualityId = $("#qualityList").val();
|
|
|
|
var path = $('#newSeriesPath').val();
|
2011-05-28 07:16:16 +00:00
|
|
|
|
2011-06-28 02:24:42 +00:00
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2011-07-27 22:59:48 +00:00
|
|
|
url: addSeriesUrl,
|
|
|
|
data: jQuery.param({ path: path, seriesName: seriesTitle, qualityProfileId: qualityId }),
|
2011-06-28 02:24:42 +00:00
|
|
|
error: function (req, status, error) {
|
2011-07-27 22:59:48 +00:00
|
|
|
alert("Sorry! We could not add " + path + " at this time. " + error);
|
2011-06-28 02:24:42 +00:00
|
|
|
},
|
2011-07-27 22:59:48 +00:00
|
|
|
success: function () {
|
|
|
|
$("#newSeriesLookup").val("");
|
|
|
|
$('#newSeriesPath').val("");
|
2011-06-28 02:24:42 +00:00
|
|
|
}
|
|
|
|
});
|
2011-07-27 22:59:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|