diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index de6583347..19a062476 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -65,6 +65,7 @@ namespace NzbDrone.Core.Test [TestCase(@"D:\shares\TV Shows\Battlestar Galactica (2003)\Season 2\S02E21.avi", 2, 21)] [TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", 4, 5)] [TestCase(@"P:\TV Shows\House\Season 6\S06E13 - 5 to 9 - 720p BluRay.mkv", 6, 13)] + [TestCase(@"S:\TV Drop\House - 10x11 - Title [SDTV]\1011 - Title.avi", 10, 11)] public void PathParse_tests(string path, int season, int episode) { var result = Parser.ParsePath(path); diff --git a/NzbDrone.Core.Test/ProviderTests/LogProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/LogProviderTest.cs index a5b877c76..5d21994fe 100644 --- a/NzbDrone.Core.Test/ProviderTests/LogProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/LogProviderTest.cs @@ -266,4 +266,4 @@ namespace NzbDrone.Core.Test.ProviderTests logs.TotalItems.Should().Be(100); } } -} \ No newline at end of file +} diff --git a/NzbDrone.Core.Test/ProviderTests/SeriesProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/SeriesProviderTest.cs index cbff7b31e..517e56ab2 100644 --- a/NzbDrone.Core.Test/ProviderTests/SeriesProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/SeriesProviderTest.cs @@ -628,5 +628,51 @@ namespace NzbDrone.Core.Test.ProviderTests series.Should().HaveCount(1); series[0].NextAiring.Should().Be(DateTime.Today.AddMonths(1)); } + + [Test] + public void SearchForSeries_should_return_results_that_start_with_query() + { + var mocker = new AutoMoqer(MockBehavior.Strict); + var db = MockLib.GetEmptyDatabase(); + mocker.SetConstant(db); + + var fakeQuality = Builder.CreateNew().Build(); + var fakeSeries = Builder.CreateListOfSize(10) + .WhereAll() + .Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) + .Build(); + + db.InsertMany(fakeSeries); + db.Insert(fakeQuality); + + //Act + var series = mocker.Resolve().SearchForSeries("Titl"); + + //Assert + series.Should().HaveCount(10); + } + + [Test] + public void SearchForSeries_should_not_return_results_that_do_not_start_with_query() + { + var mocker = new AutoMoqer(MockBehavior.Strict); + var db = MockLib.GetEmptyDatabase(); + mocker.SetConstant(db); + + var fakeQuality = Builder.CreateNew().Build(); + var fakeSeries = Builder.CreateListOfSize(10) + .WhereAll() + .Have(e => e.QualityProfileId = fakeQuality.QualityProfileId) + .Build(); + + db.InsertMany(fakeSeries); + db.Insert(fakeQuality); + + //Act + var series = mocker.Resolve().SearchForSeries("NotATitle"); + + //Assert + series.Should().HaveCount(0); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index ab4e64ed4..a5e37785a 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -39,8 +39,12 @@ namespace NzbDrone.Core new Regex(@"^(?.*?)(?:\W?S?(?<season>\d{1,2}(?!\d+))(?:(?:\-|[ex]|\s)+(?<episode>\d+))+)+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports 1103/1113 naming + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{2})(?<episode>\d{2}))+\W?(?!\\)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports 103/113 naming - new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d+)(?<episode>\d{2}))+\W?(?!\\)", + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{1})(?<episode>\d{2}))+\W?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports Season only releases diff --git a/NzbDrone.Core/Providers/PostDownloadProvider.cs b/NzbDrone.Core/Providers/PostDownloadProvider.cs index e6050b7eb..b80771930 100644 --- a/NzbDrone.Core/Providers/PostDownloadProvider.cs +++ b/NzbDrone.Core/Providers/PostDownloadProvider.cs @@ -114,8 +114,7 @@ namespace NzbDrone.Core.Providers //Rename the Directory so it's not processed again. _diskProvider.MoveDirectory(subfolderInfo.FullName, - Path.Combine(subfolderInfo.Parent.FullName, - "_NzbDrone_InvalidSeries_" + subfolderInfo.Name)); + GetNewFolderNameWithPostDownloadStatus(subfolderInfo, PostDownloadStatusType.InvalidSeries)); return; } @@ -132,9 +131,8 @@ namespace NzbDrone.Core.Providers if (importedFiles.Count == 0) { Logger.Warn("Unable to Import new download [{0}], unable to parse episode file(s).", subfolderInfo.FullName); - _diskProvider.MoveDirectory(subfolderInfo.FullName, - Path.Combine(subfolderInfo.Parent.FullName, - "_NzbDrone_ParseError_" + subfolderInfo.Name)); + _diskProvider.MoveDirectory(subfolderInfo.FullName, + GetNewFolderNameWithPostDownloadStatus(subfolderInfo, PostDownloadStatusType.ParseError)); } //Unknown Error Importing (Possibly a lesser quality than episode currently on disk) @@ -142,9 +140,7 @@ namespace NzbDrone.Core.Providers { Logger.Warn("Unable to Import new download [{0}].", subfolderInfo.FullName); - _diskProvider.MoveDirectory(subfolderInfo.FullName, - Path.Combine(subfolderInfo.Parent.FullName, - "_NzbDrone_" + subfolderInfo.Name)); + _diskProvider.MoveDirectory(subfolderInfo.FullName, GetNewFolderNameWithPostDownloadStatus(subfolderInfo, PostDownloadStatusType.Unknown)); } } } diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs index c87e4b91e..56aa435fa 100644 --- a/NzbDrone.Core/Providers/SeriesProvider.cs +++ b/NzbDrone.Core/Providers/SeriesProvider.cs @@ -186,6 +186,21 @@ namespace NzbDrone.Core.Providers return false; } + public virtual List<Series> SearchForSeries(string title) + { + var query = String.Format(@"SELECT * FROM Series + INNER JOIN QualityProfiles ON Series.QualityProfileId = QualityProfiles.QualityProfileId + WHERE Title LIKE '{0}%'", title); + +// var series = _database.Fetch<Series, QualityProfile>(@"SELECT * FROM Series +// INNER JOIN QualityProfiles ON Series.QualityProfileId = QualityProfiles.QualityProfileId +// WHERE Title LIKE '@0%'", title); + + var series = _database.Fetch<Series, QualityProfile>(query); + + return series; + } + /// <summary> /// Cleans up the AirsTime Component from TheTVDB since it can be garbage that comes in. /// </summary> diff --git a/NzbDrone.Web/Content/NzbDrone.css b/NzbDrone.Web/Content/NzbDrone.css index 58d512762..5b452186e 100644 --- a/NzbDrone.Web/Content/NzbDrone.css +++ b/NzbDrone.Web/Content/NzbDrone.css @@ -235,4 +235,11 @@ select, button, input[type="button"], input[type="submit"], input[type="reset"] { min-width: 60px; width: auto; +} + +#quickAdd +{ + position: fixed; + top: 30px; + right: 15px; } \ No newline at end of file diff --git a/NzbDrone.Web/Content/Slider.css b/NzbDrone.Web/Content/Slider.css new file mode 100644 index 000000000..aa76fce7b --- /dev/null +++ b/NzbDrone.Web/Content/Slider.css @@ -0,0 +1,67 @@ +.top-slider { + position: absolute; + opacity: 0.85; + width: 300px; +} + +.sliderButton { + border: 0; +} + +.sliderContent { + background-color:#333333; + text-align:center; + width: 100%; + color:#FFFFFF; + font-weight:bold; + margin: 0px; + display: none; + + @*Rounded Edges*@ + border:1px solid #444444; + -moz-border-radius-bottomright: 8px; + -webkit-border-bottom-right-radius: 8px; + -moz-border-radius-bottomleft: 8px; + -webkit-border-bottom-left-radius: 8px; +} + +.openCloseWrapper { + width: 100%; + text-align: center; + font-size:12px; + font-weight:bold; + color:#FFFFFF; +} + +.sliderButtonContainer { + width: 70px; + margin-left:auto; + margin-right:auto; + background-color:#333333; + cursor:pointer; + + @*Rounded Edges*@ + border: 1px solid #444444; + border-top: 0px; + -moz-border-radius-bottomright: 10px; + -webkit-border-bottom-right-radius: 10px; + -moz-border-radius-bottomleft: 10px; + -webkit-border-bottom-left-radius: 10px; +} + +.sliderImage { + width: 16px; + height: 16px; + display: inline-block; + margin-bottom: -3px; + margin-right: -5px; + margin-left: 2px; +} + +.sliderClosed { + background:url('../../Content/Images/ui-icons_2e83ff_256x240.png') -64px -16px no-repeat; +} + +.sliderOpened { + background:url('../../Content/Images/ui-icons_2e83ff_256x240.png') 0px -16px no-repeat; +} \ No newline at end of file diff --git a/NzbDrone.Web/Controllers/AddSeriesController.cs b/NzbDrone.Web/Controllers/AddSeriesController.cs index 429de70f7..0487b540f 100644 --- a/NzbDrone.Web/Controllers/AddSeriesController.cs +++ b/NzbDrone.Web/Controllers/AddSeriesController.cs @@ -53,9 +53,7 @@ namespace NzbDrone.Web.Controllers var defaultQuality = _configProvider.DefaultQualityProfile; var qualityProfiles = _qualityProvider.All(); - ViewData["qualityList"] = qualityProfiles; - - ViewData["quality"] = new SelectList( + ViewData["qualityProfiles"] = new SelectList( qualityProfiles, "QualityProfileId", "Name", @@ -132,6 +130,19 @@ namespace NzbDrone.Web.Controllers } } + [HttpPost] + public JsonResult QuickAddNewSeries(string seriesName, int seriesId, int qualityProfileId) + { + var path = _rootFolderProvider.GetMostFreeRootDir(); + path = Path.Combine(path, MediaFileProvider.CleanFilename(seriesName)); + + //Create the folder for the new series + //Use the created folder name when adding the series + path = _diskProvider.CreateDirectory(path); + + return AddExistingSeries(path, seriesName, seriesId, qualityProfileId); + } + public JsonResult AddSeries(string path, int seriesId, int qualityProfileId) { //Get TVDB Series Name @@ -145,6 +156,21 @@ namespace NzbDrone.Web.Controllers return new JsonResult { Data = "ok" }; } + [ChildActionOnly] + public ActionResult QuickAdd() + { + var defaultQuality = _configProvider.DefaultQualityProfile; + var qualityProfiles = _qualityProvider.All(); + + ViewData["qualityProfiles"] = new SelectList( + qualityProfiles, + "QualityProfileId", + "Name", + defaultQuality); + + return PartialView(); + } + //Root Directory [HttpPost] diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 52a7ebc99..b18e1acfa 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -98,25 +98,17 @@ namespace NzbDrone.Web.Controllers } } - public ActionResult SearchForSeries(string seriesName) + public JsonResult LocalSearch(string term) { - var model = new List<SeriesSearchResultModel>(); + //Get Results from the local DB and return - //Get Results from TvDb and convert them to something we can use. - foreach (var tvdbSearchResult in _tvDbProvider.SearchSeries(seriesName)) - { - model.Add(new SeriesSearchResultModel - { - TvDbId = tvdbSearchResult.Id, - TvDbName = tvdbSearchResult.SeriesName, - FirstAired = tvdbSearchResult.FirstAired - }); - } + var results = _seriesProvider.SearchForSeries(term).Select(s => new SeriesSearchResultModel + { + Id = s.SeriesId, + Title = s.Title + }).ToList(); - //model.Add(new SeriesSearchResultModel{ TvDbId = 12345, TvDbName = "30 Rock", FirstAired = DateTime.Today }); - //model.Add(new SeriesSearchResultModel { TvDbId = 65432, TvDbName = "The Office (US)", FirstAired = DateTime.Today.AddDays(-100) }); - - return PartialView("SeriesSearchResults", model); + return Json(results, JsonRequestBehavior.AllowGet); } [HttpPost] diff --git a/NzbDrone.Web/Controllers/SharedController.cs b/NzbDrone.Web/Controllers/SharedController.cs index 38181f2f4..5be4a95ab 100644 --- a/NzbDrone.Web/Controllers/SharedController.cs +++ b/NzbDrone.Web/Controllers/SharedController.cs @@ -25,5 +25,11 @@ namespace NzbDrone.Web.Controllers ViewData["RssTimer"] = _jobProvider.NextScheduledRun(typeof(RssSyncJob)).ToString("yyyyMMddHHmmss"); return PartialView(); } + + [ChildActionOnly] + public ActionResult LocalSearch() + { + return PartialView(); + } } } \ No newline at end of file diff --git a/NzbDrone.Web/Models/SeriesSearchResultModel.cs b/NzbDrone.Web/Models/SeriesSearchResultModel.cs index 3c9a1672a..43258be11 100644 --- a/NzbDrone.Web/Models/SeriesSearchResultModel.cs +++ b/NzbDrone.Web/Models/SeriesSearchResultModel.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Web.Models { public class SeriesSearchResultModel { - public int TvDbId { get; set; } - public string TvDbName { get; set; } + public int Id { get; set; } + public string Title { get; set; } public DateTime FirstAired { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 26b93e43c..01ceb302c 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -328,6 +328,7 @@ <Content Include="Content\2011.2.712\Windows7\slider-v.gif" /> <Content Include="Content\2011.2.712\Windows7\sprite-vertical.png" /> <Content Include="Content\2011.2.712\Windows7\sprite.png" /> + <Content Include="Content\Slider.css" /> <Content Include="Content\Grid.css" /> <Content Include="Content\Images\close.png" /> <Content Include="Content\Images\Downloading.png" /> @@ -676,6 +677,7 @@ <Content Include="Scripts\2011.2.712\telerik.window.min.js" /> <Content Include="Scripts\AutoComplete.js" /> <Content Include="Scripts\addSeries.js" /> + <Content Include="Scripts\slider.js" /> <Content Include="Scripts\Plugins\jquery-1.6.3-vsdoc.js" /> <Content Include="Scripts\Plugins\jquery-1.6.3.js" /> <Content Include="Scripts\Plugins\jquery-1.6.3.min.js" /> @@ -722,7 +724,6 @@ <Content Include="Views\Upcoming\Index.cshtml" /> <Content Include="Views\Series\Details.cshtml" /> <Content Include="Views\Series\Index.cshtml" /> - <Content Include="Views\Series\SeriesSearchResults.cshtml" /> <Content Include="Views\Shared\Error.cshtml" /> <Content Include="Views\Settings\QualityProfileItem.cshtml" /> <Content Include="Views\System\Indexers.cshtml" /> @@ -928,6 +929,12 @@ <ItemGroup> <Content Include="Views\Settings\System.cshtml" /> </ItemGroup> + <ItemGroup> + <Content Include="Views\Shared\QuickAdd.cshtml" /> + </ItemGroup> + <ItemGroup> + <Content Include="Views\Shared\LocalSearch.cshtml" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/NzbDrone.Web/Scripts/AutoComplete.js b/NzbDrone.Web/Scripts/AutoComplete.js index 9aac1d28f..d6ade9fef 100644 --- a/NzbDrone.Web/Scripts/AutoComplete.js +++ b/NzbDrone.Web/Scripts/AutoComplete.js @@ -5,6 +5,7 @@ bindFolderAutoComplete(".folderLookup"); bindSeriesAutoComplete(".seriesLookup"); + bindLocalSeriesAutoComplete(".localSeriesLookup"); }); function bindFolderAutoComplete(selector) { @@ -51,4 +52,24 @@ function bindSeriesAutoComplete(selector) { .appendTo(ul); }; }); +} + +function bindLocalSeriesAutoComplete(selector) { + + $(selector).each(function (index, element) { + $(element).autocomplete({ + source: "/Series/LocalSearch", + minLength: 3, + delay: 500, + select: function (event, ui) { + window.location = "../Series/Details?seriesId=" + ui.item.Id; + } + }) + .data("autocomplete")._renderItem = function (ul, item) { + return $("<li></li>") + .data("item.autocomplete", item) + .append("<a><strong>" + item.Title + "</strong><br>" + "</a>") + .appendTo(ul); + }; + }); } \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/addSeries.js b/NzbDrone.Web/Scripts/addSeries.js index 85d53ca07..a00814c0d 100644 --- a/NzbDrone.Web/Scripts/addSeries.js +++ b/NzbDrone.Web/Scripts/addSeries.js @@ -1,6 +1,7 @@ //URLs var addSeriesUrl = '../AddSeries/AddExistingSeries'; var addNewSeriesUrl = '../AddSeries/AddNewSeries'; +var quickAddNewSeriesUrl = '../AddSeries/QuickAddNewSeries'; var existingSeriesUrl = '../AddSeries/ExistingSeries'; var addNewUrl = '../AddSeries/AddNew'; @@ -105,6 +106,26 @@ function reloadAddNew() { } +//QuickAddNew +$('#quickAddNew').live('click', function () { + var seriesTitle = $("#newSeriesLookup").val(); + var seriesId = $("#newSeriesId").val(); + var qualityId = $("#qualityList").val(); + + $.ajax({ + type: "POST", + url: quickAddNewSeriesUrl, + data: jQuery.param({ seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId }), + error: function (req, status, error) { + alert("Sorry! We could not add " + path + " at this time. " + error); + }, + success: function () { + $("#newSeriesLookup").val(""); + //$('#newSeriesPath').val(""); + } + }); +}); + //On load jQuery(document).ready(function () { //RootDir diff --git a/NzbDrone.Web/Scripts/slider.js b/NzbDrone.Web/Scripts/slider.js new file mode 100644 index 000000000..ce6af3880 --- /dev/null +++ b/NzbDrone.Web/Scripts/slider.js @@ -0,0 +1,13 @@ +$(document).ready(function () { + $(".sliderButtonContainer").live('click', function () { + sliderToggle(); + }); +}); + +function sliderToggle() { + $('.sliderContent').slideToggle('slow'); + $(".sliderButtonContainer").children('.sliderImage').toggleClass('sliderOpened sliderClosed'); + + //Prevent the Address Bar from changing + return false; +} \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml index c902a0396..6f0e2f0b0 100644 --- a/NzbDrone.Web/Views/AddSeries/AddNew.cshtml +++ b/NzbDrone.Web/Views/AddSeries/AddNew.cshtml @@ -7,7 +7,7 @@ @Html.Hidden("newSeriesId", 0, new { @class = "seriesId" }) </div> @Html.DropDownList("newSeriesPath", new SelectList((IList)ViewData["RootDirs"]), new { style = "width: 406px; margin-left: 0px;" }) - @Html.DropDownList("qualityList", new SelectList((IList)ViewData["QualityList"], "QualityProfileId", "Name"), new { @class = "qualitySelector" }) + @Html.DropDownList("qualityList", (SelectList)ViewData["QualityProfiles"], new { @class = "qualitySelector" }) <button id="saveNewSeries"> Add</button> </div> diff --git a/NzbDrone.Web/Views/AddSeries/Index.cshtml b/NzbDrone.Web/Views/AddSeries/Index.cshtml index bd5289ebe..5956ef715 100644 --- a/NzbDrone.Web/Views/AddSeries/Index.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Index.cshtml @@ -3,10 +3,6 @@ Add Series } -@section HeaderContent{ - <script src="../../Scripts/addSeries.js" type="text/javascript"></script> -} - @section MainContent{ <h2>Add New Series</h2> <div id="addNewSeries"> diff --git a/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml b/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml deleted file mode 100644 index ee5f5297b..000000000 --- a/NzbDrone.Web/Views/Series/SeriesSearchResults.cshtml +++ /dev/null @@ -1,30 +0,0 @@ -@model List<NzbDrone.Web.Models.SeriesSearchResultModel> - -<div id="searchResults"> - <fieldset> - <legend>Search Results</legend> - @if (Model.Count == 0) - { - <b>No results found for the series name</b> - } - - @{var open = "(";} - @{var close = ")";} - @{int r = 0;} - @foreach (var result in Model) - { - @Html.RadioButton("selectedSeries", result.TvDbId, r == 0, - new {@class = "searchRadio examplePart", id = "searchRadio_" + r}) - - - <b>@result.TvDbName</b> @open @result.FirstAired.ToShortDateString() @close - - - <br/> - - @Html.TextBox(result.TvDbName + "_text", result.TvDbName, new { id = result.TvDbId + "_text", style = "display:none" }) - r++; - } - - </fieldset> -</div> diff --git a/NzbDrone.Web/Views/Settings/Test.cshtml b/NzbDrone.Web/Views/Settings/Test.cshtml index 9c75a02d7..9cfd89666 100644 --- a/NzbDrone.Web/Views/Settings/Test.cshtml +++ b/NzbDrone.Web/Views/Settings/Test.cshtml @@ -1,33 +1,30 @@ -<style> - .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } +@{ Layout = null; } + +<style type="text/css"> + @*Specific to each slider*@ + #seriesSearchSlider { + right: 150px; + } + + .sliderContent .localSeriesLookup { + width: 94%; + } + + .sliderContent { + height: 53px; + } + </style> -<script> - $(function () { - $("#birds").autocomplete({ - source: "/Settings/TestResults", - minLength: 3, - delay: 500, - select: function (event, ui) { - $(this).val(ui.item.Title); - return false; - } - }) - .data("autocomplete")._renderItem = function (ul, item) { - return $("<li></li>") - .data("item.autocomplete", item) - .append("<a><strong>" + item.Title + "</strong><br>" + item.FirstAired + "</a>") - .appendTo(ul); - }; - }); -</script> - -<div class="demo"> - -<div class="ui-widget"> - <label for="birds">Birds: </label> - <input id="birds" /> +<div id="seriesSearchSlider" class="top-slider"> + <div class="sliderContent"> + Local Series Search + <input class="localSeriesLookup" type="text" /> + </div> + <div class="openCloseWrapper"> + <div class="sliderButtonContainer"> + Search<div class="sliderImage sliderClosed"></div> + </div> + </div> </div> - -</div><!-- End demo --> \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/LocalSearch.cshtml b/NzbDrone.Web/Views/Shared/LocalSearch.cshtml new file mode 100644 index 000000000..b06f5700e --- /dev/null +++ b/NzbDrone.Web/Views/Shared/LocalSearch.cshtml @@ -0,0 +1,29 @@ +@{ + Layout = null; +} + +<style> + #localSeriesSlider { + right: 150px; + } + + .sliderContent .localSeriesLookup { + width: 94%; + } + + .sliderContent { + height: 53px; + } +</style> + +<div id="localSeriesSlider" class="top-slider"> + <div class="sliderContent"> + Local Series Search + <input class="localSeriesLookup" type="text" /> + </div> + <div class="openCloseWrapper"> + <div class="sliderButtonContainer"> + Search<div class="sliderImage sliderClosed"></div> + </div> + </div> +</div> \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/QuickAdd.cshtml b/NzbDrone.Web/Views/Shared/QuickAdd.cshtml new file mode 100644 index 000000000..fe420a935 --- /dev/null +++ b/NzbDrone.Web/Views/Shared/QuickAdd.cshtml @@ -0,0 +1,15 @@ +@using System.Collections +@using NzbDrone.Core +<div id="quickAdd"> + <input id="quickSeriesLookup" class="seriesLookup" type="text" style="width: 400px" /> + @Html.Hidden("newSeriesId", 0, new { @class = "seriesId" }) + @Html.DropDownList("qualityList", (SelectList)ViewData["QualityProfiles"], new { @class = "qualitySelector" }) + <button id="quickAddNew">Add</button> +</div> + +<script type="text/javascript"> + jQuery(document).ready(function () { + //AddNew + $('#quickSeriesLookup').watermark('Title of the series you want to add...'); + }); +</script> \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/_Layout.cshtml b/NzbDrone.Web/Views/Shared/_Layout.cshtml index 673827d6b..029e1a298 100644 --- a/NzbDrone.Web/Views/Shared/_Layout.cshtml +++ b/NzbDrone.Web/Views/Shared/_Layout.cshtml @@ -15,6 +15,7 @@ <link type="text/css" rel="stylesheet" href="/Content/ActionButton.css" /> <link type="text/css" rel="stylesheet" href="/Content/overrides.css" /> <link type="text/css" rel="stylesheet" href="/Content/Menu.css" /> + <link type="text/css" rel="stylesheet" href="/Content/Slider.css" /> <script type="text/javascript" src="/Scripts/Plugins/jquery-1.6.3.min.js"></script> <script type="text/javascript" src="/Scripts/Plugins/jquery-ui-1.8.16.min.js"></script> @@ -27,12 +28,15 @@ <script type="text/javascript" src="/Scripts/Plugins/doTimeout.js"></script> <script type="text/javascript" src="/Scripts/episodeSearch.js"></script> <script type="text/javascript" src="/Scripts/autocomplete.js"></script> + <script type="text/javascript" src="/Scripts/addSeries.js"></script> + <script type="text/javascript" src="/Scripts/slider.js"></script> @MvcMiniProfiler.MiniProfiler.RenderIncludes() @RenderSection("HeaderContent", required: false) </head> <body> <div class="container"> + @{Html.RenderAction("LocalSearch", "Shared");} <div id="menu" class="span-24 last prepend-top append-bottom"> <ul> @MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series")) diff --git a/SharedLiveTemplates.xml b/SharedLiveTemplates.xml new file mode 100644 index 000000000..da03090c5 --- /dev/null +++ b/SharedLiveTemplates.xml @@ -0,0 +1 @@ +<TemplatesExport /> \ No newline at end of file