1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 16:02:29 +01:00
Sonarr/NzbDrone.Web/Views/AddSeries/AddNew.cshtml

46 lines
1.6 KiB
Plaintext
Raw Normal View History

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