From 99f2b07a115bb4ca2b2ce0a76baf38d66a6c5cef Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 4 May 2014 00:11:43 -0700 Subject: [PATCH] Bootstrap 3 New: Updated UI New: Mobile browser support Fixed: /favicon.ico will return the favicon now --- Gruntfile.js | 8 +- .../Frontend/Mappers/FaviconMapper.cs | 30 +++ .../Frontend/Mappers/StaticResourceMapper.cs | 3 +- src/NzbDrone.Api/NzbDrone.Api.csproj | 1 + .../PageModel/PageBase.cs | 13 +- src/NzbDrone.Core/NzbDrone.Core.csproj | 1 + src/UI/AddSeries/AddSeriesLayoutTemplate.html | 32 +-- src/UI/AddSeries/AddSeriesViewTemplate.html | 11 +- .../RootFolders/RootFolderLayoutTemplate.html | 14 +- .../RootFolderSelectionPartial.html | 23 +- .../StartingSeasonSelectionPartial.html | 2 +- .../AddSeries/SearchResultViewTemplate.html | 76 +++--- src/UI/AddSeries/addSeries.less | 44 +--- src/UI/Calendar/CalendarFeedViewTemplate.html | 46 ++-- src/UI/Calendar/CalendarLayoutTemplate.html | 4 +- src/UI/Calendar/CalendarView.js | 79 ++++-- src/UI/Cells/EpisodeActionsCellTemplate.html | 6 +- src/UI/Cells/SeriesActionsCell.js | 4 +- src/UI/Cells/cells.less | 13 +- src/UI/Content/Backgrid/paginator.less | 4 + src/UI/Content/Images/logos/128.png | Bin 0 -> 7233 bytes src/UI/Content/Images/logos/32.png | Bin 0 -> 1631 bytes src/UI/Content/Images/logos/48.png | Bin 0 -> 2547 bytes .../Content/Images/{logo.png => logos/64.png} | Bin src/UI/Content/Messenger/messenger.css | 47 ++-- ...essenger.future.css => messenger.flat.css} | 176 ++++++-------- src/UI/Content/Overrides/bootstrap.less | 90 ++++--- .../Overrides/bootstrap.toggle-switch.less | 3 + src/UI/Content/Overrides/fullcalendar.less | 12 +- src/UI/Content/Overrides/messenger.less | 18 ++ src/UI/Content/bootstrap.less | 2 + src/UI/Content/form.less | 45 +++- src/UI/Content/menu.less | 161 ------------- src/UI/Content/navbar.less | 227 ++++++++++++++++++ src/UI/Content/progress-bars.less | 9 +- src/UI/Content/theme.less | 33 ++- src/UI/Content/typeahead.less | 152 ++++++++++++ src/UI/Content/utilities.less | 19 ++ .../EpisodeActivityLayoutTemplate.html | 2 +- .../Episode/EpisodeDetailsLayoutTemplate.html | 58 ++--- .../Episode/Search/ManualLayoutTemplate.html | 2 +- src/UI/Form/CheckboxTemplate.html | 32 +-- src/UI/Form/FormHelpPartial.html | 15 +- src/UI/Form/PasswordTemplate.html | 12 +- src/UI/Form/PathTemplate.html | 12 +- src/UI/Form/SelectTemplate.html | 12 +- src/UI/Form/TextboxTemplate.html | 8 +- src/UI/Handlebars/Helpers/Episode.js | 12 + src/UI/Handlebars/Helpers/Quality.js | 2 +- src/UI/Health/HealthView.js | 6 +- .../Blacklist/BlacklistLayoutTemplate.html | 2 +- .../Details/HistoryDetailsViewTemplate.html | 149 ++++++------ src/UI/History/Queue/QueueLayoutTemplate.html | 2 +- src/UI/History/Table/HistoryTableLayout.js | 4 +- .../Table/HistoryTableLayoutTemplate.html | 2 +- src/UI/JsLibraries/messenger.js | 69 ++++-- src/UI/Mixins/AsFilteredCollection.js | 8 +- src/UI/Mixins/AutoComplete.js | 42 +++- src/UI/Navbar/NavbarLayoutTemplate.html | 119 ++++----- src/UI/Navbar/NavbarView.js | 7 +- src/UI/Navbar/Search.js | 42 ++-- .../QualityProfileSelectionPartial.html | 2 +- .../Rename/RenamePreviewLayoutTemplate.html | 49 ++-- .../Series/Delete/DeleteSeriesTemplate.html | 68 +++--- src/UI/Series/Details/InfoViewTemplate.html | 59 ++--- .../Series/Details/SeasonLayoutTemplate.html | 2 +- .../Series/Details/SeriesDetailsTemplate.html | 6 +- src/UI/Series/Edit/EditSeriesView.js | 1 - .../Series/Edit/EditSeriesViewTemplate.html | 144 +++++------ .../Organize/OrganizeFilesViewTemplate.html | 46 ++-- .../SeriesEditorFooterViewTemplate.html | 55 +++-- .../Editor/SeriesEditorLayoutTemplate.html | 2 +- .../Series/Index/EpisodeProgressPartial.html | 15 +- .../SeriesOverviewItemViewTemplate.html | 22 +- .../SeriesPostersItemViewTemplate.html | 4 +- src/UI/Series/Index/SeriesIndexLayout.js | 1 + .../Index/SeriesIndexLayoutTemplate.html | 2 +- src/UI/Series/series.less | 73 ++++-- ...wnloadClientAddCollectionViewTemplate.html | 24 +- .../DownloadClientAddItemViewTemplate.html | 14 +- .../DownloadClientDeleteViewTemplate.html | 24 +- .../DownloadClientCollectionViewTemplate.html | 2 +- .../DownloadClient/DownloadClientItemView.js | 13 +- .../DownloadClientItemViewTemplate.html | 8 +- .../Edit/DownloadClientEditViewTemplate.html | 106 ++++---- .../FailedDownloadHandlingViewTemplate.html | 126 +++++----- .../DownloadClientOptionsViewTemplate.html | 32 +-- .../DownloadClient/downloadclient.less | 16 +- .../Settings/General/GeneralViewTemplate.html | 201 +++++++++------- .../Settings/Indexers/DeleteViewTemplate.html | 24 +- src/UI/Settings/Indexers/EditTemplate.html | 102 ++++---- src/UI/Settings/Indexers/ItemTemplate.html | 2 +- .../Options/IndexerOptionsViewTemplate.html | 35 ++- src/UI/Settings/Indexers/indexers.less | 19 +- .../FileManagementViewTemplate.html | 106 ++++---- .../Naming/Basic/BasicNamingViewTemplate.html | 116 +++++---- .../Naming/NamingViewTemplate.html | 151 ++++++------ .../Permissions/PermissionsViewTemplate.html | 86 ++++--- .../Sorting/SortingViewTemplate.html | 58 ++--- .../Metadata/MetadataEditViewTemplate.html | 70 +++--- .../Metadata/MetadataItemViewTemplate.html | 2 +- src/UI/Settings/Metadata/metadata.less | 2 +- .../Notifications/AddItemTemplate.html | 14 +- .../Settings/Notifications/AddTemplate.html | 24 +- .../Settings/Notifications/CollectionView.js | 2 +- .../Notifications/DeleteTemplate.html | 24 +- .../Settings/Notifications/ItemTemplate.html | 23 -- .../Notifications/NotificationEditView.js | 3 +- .../NotificationEditViewTemplate.html | 198 +++++++-------- .../NotificationItemViewTemplate.html | 19 ++ .../{ItemView.js => NotificationsItemView.js} | 15 +- .../Settings/Notifications/notifications.less | 25 +- .../QualityDefinitionCollectionTemplate.html | 8 +- .../Definition/QualityDefinitionTemplate.html | 8 +- .../Definition/QualityDefinitionView.js | 8 +- .../Quality/Profile/AllowedLabeler.js | 4 +- ...eteView.js => DeleteQualityProfileView.js} | 2 +- .../DeleteQualityProfileViewTemplate.html | 15 ++ .../Quality/Profile/DeleteTemplate.html | 11 - .../Profile/Edit/EditQualityProfileLayout.js | 48 +++- .../EditQualityProfileLayoutTemplate.html | 56 +++-- .../Edit/EditQualityProfileViewTemplate.html | 20 +- .../Quality/Profile/QualityProfileView.js | 37 +-- .../Profile/QualityProfileViewTemplate.html | 10 +- src/UI/Settings/Quality/quality.less | 19 +- src/UI/Settings/SettingsLayoutTemplate.html | 38 +-- src/UI/Settings/settings.less | 17 +- src/UI/Settings/thingy.less | 6 + src/UI/Shared/Grid/PagerTemplate.html | 3 +- src/UI/Shared/SignalRBroadcaster.js | 2 +- .../Toolbar/Button/ButtonCollectionView.js | 19 +- src/UI/Shared/Toolbar/ToolbarLayout.js | 8 +- .../Shared/Toolbar/ToolbarLayoutTemplate.html | 4 +- .../Logs/Files/LogFileLayoutTemplate.html | 4 +- src/UI/System/Logs/LogsLayoutTemplate.html | 20 +- .../Table/Details/LogDetailsViewTemplate.html | 37 +-- src/UI/System/Logs/Table/LogTimeCell.js | 1 + .../Logs/Table/LogsTableLayoutTemplate.html | 4 +- src/UI/System/SystemLayoutTemplate.html | 4 +- .../System/Update/UpdateItemViewTemplate.html | 4 +- src/UI/Wanted/Cutoff/CutoffUnmetLayout.js | 11 +- .../Cutoff/CutoffUnmetLayoutTemplate.html | 2 +- src/UI/Wanted/Missing/MissingLayout.js | 7 +- .../Wanted/Missing/MissingLayoutTemplate.html | 2 +- src/UI/app.js | 7 +- src/UI/index.html | 20 +- src/UI/jQuery/jquery.spin.js | 1 + src/UI/jQuery/jquery.validation.js | 14 +- 148 files changed, 2691 insertions(+), 2054 deletions(-) create mode 100644 src/NzbDrone.Api/Frontend/Mappers/FaviconMapper.cs create mode 100644 src/UI/Content/Images/logos/128.png create mode 100644 src/UI/Content/Images/logos/32.png create mode 100644 src/UI/Content/Images/logos/48.png rename src/UI/Content/Images/{logo.png => logos/64.png} (100%) rename src/UI/Content/Messenger/{messenger.future.css => messenger.flat.css} (56%) create mode 100644 src/UI/Content/bootstrap.less delete mode 100644 src/UI/Content/menu.less create mode 100644 src/UI/Content/navbar.less create mode 100644 src/UI/Content/typeahead.less create mode 100644 src/UI/Content/utilities.less delete mode 100644 src/UI/Settings/Notifications/ItemTemplate.html create mode 100644 src/UI/Settings/Notifications/NotificationItemViewTemplate.html rename src/UI/Settings/Notifications/{ItemView.js => NotificationsItemView.js} (50%) rename src/UI/Settings/Quality/Profile/{DeleteView.js => DeleteQualityProfileView.js} (86%) create mode 100644 src/UI/Settings/Quality/Profile/DeleteQualityProfileViewTemplate.html delete mode 100644 src/UI/Settings/Quality/Profile/DeleteTemplate.html diff --git a/Gruntfile.js b/Gruntfile.js index 8956b314f..fc75499ec 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,7 +27,7 @@ module.exports = function (grunt) { }, bootstrap: { - src : srcContent + 'Bootstrap/bootstrap.less', + src : srcContent + 'bootstrap.less', dest: destContent + 'bootstrap.css' }, general : { @@ -118,7 +118,7 @@ module.exports = function (grunt) { requirejs: { compile:{ options: { - mainConfigFile: "src/UI/app.js", + mainConfigFile: 'src/UI/app.js', fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/, preserveLicenseComments: false, dir: outputDir, @@ -139,11 +139,11 @@ module.exports = function (grunt) { nospawn: false }, bootstrap : { - files: [ srcContent + 'Bootstrap/**', srcContent + 'FontAwesome/**'], + files: [ srcContent + 'Bootstrap/**', srcContent + 'FontAwesome/**', srcContent + 'bootstrap.less'], tasks: ['less:bootstrap','less:general'] }, generalLess: { - files: [ srcRoot + '**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**'], + files: [ srcRoot + '**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**', '!' + srcContent + '/bootstrap.less'], tasks: ['less:general'] }, handlebars : { diff --git a/src/NzbDrone.Api/Frontend/Mappers/FaviconMapper.cs b/src/NzbDrone.Api/Frontend/Mappers/FaviconMapper.cs new file mode 100644 index 000000000..e3c810a8d --- /dev/null +++ b/src/NzbDrone.Api/Frontend/Mappers/FaviconMapper.cs @@ -0,0 +1,30 @@ +using System.IO; +using NLog; +using NzbDrone.Common.Disk; +using NzbDrone.Common.EnvironmentInfo; + +namespace NzbDrone.Api.Frontend.Mappers +{ + public class FaviconMapper : StaticResourceMapperBase + { + private readonly IAppFolderInfo _appFolderInfo; + + public FaviconMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, Logger logger) + : base(diskProvider, logger) + { + _appFolderInfo = appFolderInfo; + } + + protected override string Map(string resourceUrl) + { + var path = Path.Combine("Content", "Images", "favicon.ico"); + + return Path.Combine(_appFolderInfo.StartUpFolder, "UI", path); + } + + public override bool CanHandle(string resourceUrl) + { + return resourceUrl.Equals("/favicon.ico"); + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Api/Frontend/Mappers/StaticResourceMapper.cs b/src/NzbDrone.Api/Frontend/Mappers/StaticResourceMapper.cs index a55fafc71..a81bb4ab7 100644 --- a/src/NzbDrone.Api/Frontend/Mappers/StaticResourceMapper.cs +++ b/src/NzbDrone.Api/Frontend/Mappers/StaticResourceMapper.cs @@ -1,6 +1,5 @@ using System.IO; using NLog; -using NzbDrone.Common; using NzbDrone.Common.Disk; using NzbDrone.Common.EnvironmentInfo; @@ -29,7 +28,7 @@ public override bool CanHandle(string resourceUrl) return resourceUrl.StartsWith("/Content") || resourceUrl.EndsWith(".js") || resourceUrl.EndsWith(".css") || - resourceUrl.EndsWith(".ico") || + (resourceUrl.EndsWith(".ico") && !resourceUrl.Equals("/favicon.ico")) || resourceUrl.EndsWith(".swf"); } } diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index dd8950919..d0c5875ca 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -128,6 +128,7 @@ + diff --git a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs index 032d14426..b8e56a44d 100644 --- a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs +++ b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs @@ -13,6 +13,7 @@ public class PageBase public PageBase(RemoteWebDriver driver) { _driver = driver; + driver.Manage().Window.Maximize(); } public IWebElement FindByClass(string className, int timeout = 5) @@ -52,7 +53,7 @@ public IWebElement SeriesNavIcon { get { - return Find(By.LinkText("Series")); + return FindByClass("x-series-nav"); } } @@ -60,7 +61,7 @@ public IWebElement CalendarNavIcon { get { - return Find(By.LinkText("Calendar")); + return FindByClass("x-calendar-nav"); } } @@ -68,7 +69,7 @@ public IWebElement HistoryNavIcon { get { - return Find(By.LinkText("History")); + return FindByClass("x-history-nav"); } } @@ -76,7 +77,7 @@ public IWebElement WantedNavIcon { get { - return Find(By.LinkText("Wanted")); + return FindByClass("x-wanted-nav"); } } @@ -84,7 +85,7 @@ public IWebElement SettingNavIcon { get { - return Find(By.LinkText("Settings")); + return FindByClass("x-settings-nav"); } } @@ -92,7 +93,7 @@ public IWebElement SystemNavIcon { get { - return Find(By.PartialLinkText("System")); + return FindByClass("x-system-nav"); } } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 5e81c437d..997d904f4 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -194,6 +194,7 @@ + diff --git a/src/UI/AddSeries/AddSeriesLayoutTemplate.html b/src/UI/AddSeries/AddSeriesLayoutTemplate.html index 070ce8c01..401847f7f 100644 --- a/src/UI/AddSeries/AddSeriesLayoutTemplate.html +++ b/src/UI/AddSeries/AddSeriesLayoutTemplate.html @@ -1,23 +1,17 @@ -
-
-
- - Import existing series on disk +
+
+
+ +
- -
- - - - -
-
+
+
+
+
+
diff --git a/src/UI/AddSeries/AddSeriesViewTemplate.html b/src/UI/AddSeries/AddSeriesViewTemplate.html index ec6e6cff3..829527ddc 100644 --- a/src/UI/AddSeries/AddSeriesViewTemplate.html +++ b/src/UI/AddSeries/AddSeriesViewTemplate.html @@ -1,12 +1,13 @@ {{#if folder.path}} -
-
+
+
{{folder.path}}
{{/if}} -