You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/NzbDrone.Web/Views/AddSeries/AddNew.cshtml

46 lines
1.6 KiB

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