1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

Adding "master" dropbox for changing quality for add series.

This commit is contained in:
Mark McDowall 2011-04-07 16:49:18 -07:00
parent a30a62f824
commit 0330bb1577
3 changed files with 33 additions and 2 deletions

View File

@ -63,6 +63,12 @@ public ActionResult AddExisting()
{
var unmappedList = new List<String>();
var profiles = _qualityProvider.GetAllProfiles();
var defaultQuality = Convert.ToInt32(_configProvider.DefaultQualityProfile);
var selectList = new SelectList(profiles, "QualityProfileId", "Name", defaultQuality);
ViewData["qualities"] = selectList;
foreach (var folder in _rootFolderProvider.GetAll())
{
unmappedList.AddRange(_syncProvider.GetUnmappedFolders(folder.Path));

View File

@ -9,11 +9,36 @@
<%
if (Model.Count() == 0)
Html.DisplayText("No Series to Add");
%>
<%: Html.DropDownList("masterDropbox", (SelectList)ViewData["qualities"], new { style = "width: 100px;", id = "masterDropboxId" })%>
<%: @Html.Telerik().DropDownList().Name("tester").BindTo((SelectList)ViewData["qualities"]).HtmlAttributes(new { style = "width: 100px", @class = "qualityDropbox" })%>
<%
foreach (var path in Model)
{
Html.RenderAction("RenderPartial", "AddSeries", new { path });
}
%>
</asp:Content>
<script type="text/javascript">
$("#masterDropboxId").change(function () {
var selectedQuality = $('#masterDropboxId').get(0).selectedIndex;
//$(".qualityDropbox").data("tComboBox").value(selectedQuality);
//$(".qualityDropbox").data("tDropDownList").val(selectedQuality);
var comboBox = $(".qualityDropbox").data("tDropDownList");
comboBox.select(selectedQuality);
});
</script>
</asp:Content>

View File

@ -12,7 +12,7 @@
.HighlightFirstMatch(true)
.HtmlAttributes(new { style = "width: 300px;" })
.Render();}
@Html.Telerik().DropDownList().Name("qualityList_" + ViewData["guid"].ToString()).BindTo((SelectList)ViewData["quality"]).HtmlAttributes(new { style = "width: 100px;" })
@Html.Telerik().DropDownList().Name("qualityList_" + ViewData["guid"].ToString()).BindTo((SelectList)ViewData["quality"]).HtmlAttributes(new { style = "width: 100px", @class = "qualityDropbox" })
<button class="listButton" onclick="addSeries('@ViewData["guid"]','@ViewData["javaPath"].ToString()' )">
Add</button>
</div>