2011-04-04 03:31:27 +02:00
|
|
|
@using NzbDrone.Core.Repository.Quality
|
|
|
|
@model SelectList
|
2011-04-05 04:48:46 +02:00
|
|
|
<div style="padding:3px" id="div_@(ViewData["guid"])">
|
2011-04-04 03:31:27 +02:00
|
|
|
<fieldset>
|
|
|
|
<legend>@ViewData["path"].ToString()</legend>
|
|
|
|
<div>
|
|
|
|
@{Html.Telerik().ComboBox()
|
|
|
|
.Name("seriesList_" + ViewData["guid"].ToString())
|
2011-04-01 08:36:34 +02:00
|
|
|
.BindTo(Model)
|
2011-04-04 03:31:27 +02:00
|
|
|
.DataBinding(binding => binding.Ajax().Select("_textLookUp", "AddSeries").Delay(400).Cache(false))
|
2011-04-01 08:36:34 +02:00
|
|
|
.Filterable(f => f.FilterMode(AutoCompleteFilterMode.Contains))
|
|
|
|
.HighlightFirstMatch(true)
|
2011-04-04 03:31:27 +02:00
|
|
|
.HtmlAttributes(new { style = "width: 300px;" })
|
2011-04-05 04:48:46 +02:00
|
|
|
.Render();}
|
2011-04-04 03:31:27 +02:00
|
|
|
@Html.Telerik().DropDownList().Name("qualityList_" + ViewData["guid"].ToString()).BindTo((SelectList)ViewData["quality"]).HtmlAttributes(new { style = "width: 100px;" })
|
|
|
|
<button class="listButton" onclick="addSeries('@ViewData["guid"]','@ViewData["javaPath"].ToString()' )">
|
|
|
|
Add</button>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2011-04-01 08:36:34 +02:00
|
|
|
</div>
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
2011-04-02 01:55:20 +02:00
|
|
|
var addSeriesUrl = '@Url.Action("AddSeries", "AddSeries")';
|
2011-04-01 08:36:34 +02:00
|
|
|
|
|
|
|
function addSeries(guid, path) {
|
2011-04-04 03:31:27 +02:00
|
|
|
var seriesComboBox = $("#seriesList_" + guid).data("tComboBox");
|
|
|
|
var qualityComboBox = $("#qualityList_" + guid).data("tDropDownList");
|
|
|
|
sendToServer(seriesComboBox.value(), path, qualityComboBox.value());
|
2011-04-01 08:36:34 +02:00
|
|
|
$("#div_" + guid).hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendToServer(id, path, quality) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: addSeriesUrl,
|
|
|
|
data: jQuery.param({ path: path, seriesId: id, qualityProfileId: quality }),
|
|
|
|
error: function (req, status, error) {
|
2011-04-04 03:31:27 +02:00
|
|
|
alert("Sorry! We could not add " + path + " at this time. " + error);
|
2011-04-01 08:36:34 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|