1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-24 08:44:46 +00:00

JquerySimpleDropdown menu added, not sure of full usage yet.

Fixed SettingsController for Quality Config.
This commit is contained in:
markus101 2011-02-03 10:28:14 -08:00
parent 9f0e512f5f
commit 764f67f8e8
11 changed files with 119 additions and 51 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,12 @@
/*
Name: jQuery Simple Drop Down Plugin Stylesheet
Author: Etienne Fardet
Version: 1.2
-- Fixes for IE --
*/
¨* {zoom:1;}
.drop ul, .drop ul li {width:134px;}
.drop ul li a, .drop ul li a:hover {padding:8px;}
.drop ul li a:hover {background-color:#06f;}

View file

@ -0,0 +1,34 @@
/*
Name: jQuery Simple Drop Down Plugin Stylesheet
Author: Etienne Fardet
Version: 1.2
*/
/* Demo common styles - Not needed to make the plugin work */
/*
body {font-family:Verdana, Geneva, sans-serif; font-size:14px;width:40%;margin:0 auto;}
a {text-decoration:none;color:#039;}
h3 {clear:both;color: #039;}
pre {border:1px solid black; padding:8px;width:700px; margin:20px;}
strong {color: #093;}
.requirements {list-style:square;}
.author {color: #003;font-size: 12px;font-weight: bold;font-style: italic;}
*/
/* Demo divs - Lists need to be placed in a div with an assigned ID that will be called within the page as a parameter for the main plugin function */
/*
#dropdown1 {position:relative;z-index:2;}
#dropdown2 {position:relative;z-index:1;}
#dropdown3 {position:relative;z-index:0;margin-left:170px;}
*/
/* Necessary Styles to make the demo work - Change background colors and colors to match your needs */
.dropdown {background:url(./images/arrow.png) no-repeat 10px 8px #D9D6D5;color:#D9D6D5;-khtml-border-radius:8px;border-radius:8px;-moz-border-radius:8px;-webkit-border-radius:8px;cursor:pointer;margin:0;padding:0;position:absolute;}
.dropdown a {text-decoration:none; color:#000;}
.dropdown {list-style-type:none;margin:0;padding:0;width:120;margin:0 auto;}
.drop ul {list-style-type:none;margin:0;padding:0;}
.drop ul li:first-child {border-top:1px solid #D9D6D5;}
.drop ul li {display:none; -moz-border-radius:0;-webkit-border-radius:0;background-color:#D9D6D5;padding:0px; padding-left:4px; padding-right:4px}
.drop ul li:last-child {display:none;-khtml-border-radius:0 0 8px 8px;border-radius:0 0 8px 8px;-moz-border-radius:0 0 8px 8px;-webkit-border-radius:0 0 8px 8px;}
.selected {padding:4px;color:#000;}
.drop ul li:hover {background-color:#06f;}

View file

@ -1,41 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading;
//using System.Web;
//using System.Web.Mvc;
//using NzbDrone.Core.Providers;
//using NzbDrone.Web.Models;
//namespace NzbDrone.Web.Controllers
//{
// [HandleError]
// public class SettingsController : Controller
// {
// //
// // GET: /Settings/
// private IConfigProvider _configProvider;
// public SettingsController(IConfigProvider configProvider)
// {
// _configProvider = configProvider;
// }
// public ActionResult Index()
// {
// return View(new SettingsModel() { TvFolder = _configProvider.SeriesRoot });
// }
// [HttpPost]
// public ActionResult Index(SettingsModel model)
// {
// if (ModelState.IsValid)
// {
// _configProvider.SeriesRoot = model.TvFolder;
// //return RedirectToAction("index");
// }
// return RedirectToAction("index", "series");
// }
// }
//}

View file

@ -95,7 +95,7 @@ namespace NzbDrone.Web.Controllers
public ActionResult Quality()
{
ViewData["viewName"] = "Downloads";
ViewData["viewName"] = "Quality";
var userProfiles = _qualityProvider.GetProfiles().Where(q => q.UserProfile).ToList();
var profiles = _qualityProvider.GetProfiles().Where(q => q.UserProfile == false).ToList();

View file

@ -2,11 +2,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository;

View file

@ -73,7 +73,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\Copy of SettingsController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\LogController.cs" />
<Compile Include="Controllers\NotificationController.cs" />
@ -103,6 +102,8 @@
<Content Include="Content\Default\treeview-nodes-rtl.png" />
<Content Include="Content\Forest\treeview-nodes-rtl.png" />
<Content Include="Content\Hay\treeview-nodes-rtl.png" />
<Content Include="Content\ie.css" />
<Content Include="Content\Images\arrow.png" />
<Content Include="Content\Images\spin.gif" />
<Content Include="Content\Black\editor.png" />
<Content Include="Content\Black\loading.gif" />
@ -144,6 +145,7 @@
<Content Include="Content\Images\ui-icons_888888_256x240.png" />
<Content Include="Content\Images\ui-icons_cd0a0a_256x240.png" />
<Content Include="Content\Images\ui-icons_ffffff_256x240.png" />
<Content Include="Content\jquery-simpledropdown.css" />
<Content Include="Content\jquery-ui-1.8.8.custom.css" />
<Content Include="Content\jquery-ui.css" />
<Content Include="Content\jquery-ui.custom.css" />
@ -253,6 +255,7 @@
<Content Include="Scripts\jquery.form.js" />
<Content Include="Scripts\jquery.jgrowl.js" />
<Content Include="Scripts\jquery-tgc-countdown-1.0.js" />
<Content Include="Scripts\jquery.simpledropdown.js" />
<Content Include="Scripts\Notification.js" />
<Content Include="Views\Log\Index.aspx" />
<Content Include="Views\Series\Details.aspx" />

View file

@ -0,0 +1,32 @@
/*
Name: jQuery Simple Drop Down Plugin
Author: Etienne Fardet
Version: 1.2
*/
(function($){
$.simpledropdown = function(selector) {
$(selector).children("ul").addClass("dropdown");
$("ul.dropdown>li:first-child").addClass("selected");
$("ul.dropdown>li").not(".dropdown>li:first-child").addClass("drop");
$("ul.dropdown").click(function() {
var subitems = $(this).find(".drop ul li");
var selecteditem = $(this).find(".selected");
subitems.slideToggle("fast", function() {
subitems.click(function() {
var selection = $(this).text();
selecteditem.text(selection).fadeOut(5, function() {
if (jQuery.browser.msie) {
$(this).fadeIn(100);
} else {
$(this).fadeIn(400);
}
});
});
});
});
};
})(jQuery);

View file

@ -1,4 +1,4 @@
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NzbDrone.Web.Models.SettingsModel>" %>
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Settings
@ -11,5 +11,5 @@
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% Html.RenderPartial(ViewData["viewName"].ToString(), Model); %>
<% Html.RenderPartial(ViewData["viewName"].ToString()); %>
</asp:Content>

View file

@ -11,6 +11,8 @@
resetForm: false
};
$('#form').ajaxForm(options);
$.simpledropdown("#dropdown1");
});
function saveOrder(jqForm, options) {
@ -57,5 +59,34 @@
});
</script>
<% using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "form", name = "form" }))
{%>
<%: Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.") %>
<div id="dropdown1">
<ul>
<li>Quality</li>
<li>
<ul>
<li><a href="#">Argentina</a></li>
<li><a href="#">Brazil</a></li>
<li><a href="#">Uruguay</a></li>
<li><a href="#">France</a></li>
<li><a href="#">United Kingdon</a></li>
</ul>
</li>
</ul>
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<%}%>
<div id="result"></div>

View file

@ -17,6 +17,7 @@
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-simpledropdown.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-ui-1.8.8.min.js"></script>
<asp:ContentPlaceHolder ID="headerContent" runat="server"></asp:ContentPlaceHolder>
@ -55,7 +56,8 @@
.Add("jquery.form.js")
.Add("jquery.jgrowl.js")
.Add("Notification.js")
.Add("jquery-tgc-countdown-1.0.js"))
.Add("jquery-tgc-countdown-1.0.js")
.Add("jquery.simpledropdown.js"))
.Render();
%>
</html>