1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00: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 @@ namespace NzbDrone.Web.Controllers
{ {
var unmappedList = new List<String>(); 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()) foreach (var folder in _rootFolderProvider.GetAll())
{ {
unmappedList.AddRange(_syncProvider.GetUnmappedFolders(folder.Path)); unmappedList.AddRange(_syncProvider.GetUnmappedFolders(folder.Path));

View file

@ -9,11 +9,36 @@
<% <%
if (Model.Count() == 0) if (Model.Count() == 0)
Html.DisplayText("No Series to Add"); 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) foreach (var path in Model)
{ {
Html.RenderAction("RenderPartial", "AddSeries", new { path }); Html.RenderAction("RenderPartial", "AddSeries", new { path });
} }
%> %>
<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> </asp:Content>

View file

@ -12,7 +12,7 @@
.HighlightFirstMatch(true) .HighlightFirstMatch(true)
.HtmlAttributes(new { style = "width: 300px;" }) .HtmlAttributes(new { style = "width: 300px;" })
.Render();} .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()' )"> <button class="listButton" onclick="addSeries('@ViewData["guid"]','@ViewData["javaPath"].ToString()' )">
Add</button> Add</button>
</div> </div>