Radarr/NzbDrone.Web/Views/AddSeries/AddNew.cshtml

46 lines
1.6 KiB
Plaintext
Raw Normal View History

2011-07-08 03:27:11 +00:00
@using System.Collections
@using NzbDrone.Web.Models
@{ Layout = null; }
<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">
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-07-27 22:59:48 +00:00
$('#saveNewSeries').click(function () {
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();
$.ajax({
type: "POST",
2011-07-27 22:59:48 +00:00
url: addSeriesUrl,
data: jQuery.param({ path: path, seriesName: seriesTitle, qualityProfileId: qualityId }),
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-07-27 22:59:48 +00:00
success: function () {
$("#newSeriesLookup").val("");
$('#newSeriesPath').val("");
}
});
2011-07-27 22:59:48 +00:00
});
});
</script>