1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/Views/AddSeries/AddNew.cshtml

46 lines
1.6 KiB
Plaintext
Raw Normal View History

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