From f7c33d48f4ab9856a951dbb497edca95fb7c35df Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 30 Mar 2016 13:59:13 +0100 Subject: [PATCH] Added a scroll to the top thingy and a bit more work on headphones --- .../SettingModels/HeadphonesSettings.cs | 2 +- .../SettingModels/PlexRequestSettings.cs | 2 + PlexRequests.Store/RequestedModel.cs | 3 +- PlexRequests.UI/Content/custom.css | 36 ++++++++++++++++ PlexRequests.UI/Content/custom.min.css | 2 +- PlexRequests.UI/Content/custom.scss | 43 ++++++++++++++++++- PlexRequests.UI/Modules/AdminModule.cs | 10 ++--- PlexRequests.UI/Modules/UserLoginModule.cs | 2 +- PlexRequests.UI/Program.cs | 2 +- PlexRequests.UI/Views/Admin/Settings.cshtml | 29 +++++++++++++ PlexRequests.UI/Views/Shared/_Layout.cshtml | 33 +++++++++++++- 11 files changed, 151 insertions(+), 13 deletions(-) diff --git a/PlexRequests.Core/SettingModels/HeadphonesSettings.cs b/PlexRequests.Core/SettingModels/HeadphonesSettings.cs index 0da4971d7..e77abca47 100644 --- a/PlexRequests.Core/SettingModels/HeadphonesSettings.cs +++ b/PlexRequests.Core/SettingModels/HeadphonesSettings.cs @@ -33,7 +33,7 @@ namespace PlexRequests.Core.SettingModels { public class HeadphonesSettings : Settings { - public string Enabled { get; set; } + public bool Enabled { get; set; } public string Ip { get; set; } public int Port { get; set; } public int ApiKey { get; set; } diff --git a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs index 51a6413fd..9c2811d0d 100644 --- a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs +++ b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs @@ -32,8 +32,10 @@ namespace PlexRequests.Core.SettingModels public bool SearchForMovies { get; set; } public bool SearchForTvShows { get; set; } + public bool SearchForMusic { get; set; } public bool RequireMovieApproval { get; set; } public bool RequireTvShowApproval { get; set; } + public bool RequireMusicApproval { get; set; } public int WeeklyRequestLimit { get; set; } } } diff --git a/PlexRequests.Store/RequestedModel.cs b/PlexRequests.Store/RequestedModel.cs index 18ef216af..836a2abfa 100644 --- a/PlexRequests.Store/RequestedModel.cs +++ b/PlexRequests.Store/RequestedModel.cs @@ -32,7 +32,8 @@ namespace PlexRequests.Store public enum RequestType { Movie, - TvShow + TvShow, + Album } public enum IssueState diff --git a/PlexRequests.UI/Content/custom.css b/PlexRequests.UI/Content/custom.css index a517cc508..b7f9c9f33 100644 --- a/PlexRequests.UI/Content/custom.css +++ b/PlexRequests.UI/Content/custom.css @@ -126,3 +126,39 @@ label { #tvList .mix { display: none; } +.scroll-top-wrapper { + position: fixed; + opacity: 0; + visibility: hidden; + overflow: hidden; + text-align: center; + z-index: 99999999; + background-color: #4e5d6c; + color: #eeeeee; + width: 50px; + height: 48px; + line-height: 48px; + right: 30px; + bottom: 30px; + padding-top: 2px; + border-top-left-radius: 10px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + border-bottom-left-radius: 10px; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; } + +.scroll-top-wrapper:hover { + background-color: #637689; } + +.scroll-top-wrapper.show { + visibility: visible; + cursor: pointer; + opacity: 1.0; } + +.scroll-top-wrapper i.fa { + line-height: inherit; } + diff --git a/PlexRequests.UI/Content/custom.min.css b/PlexRequests.UI/Content/custom.min.css index 45dc19440..72cc0ebe2 100644 --- a/PlexRequests.UI/Content/custom.min.css +++ b/PlexRequests.UI/Content/custom.min.css @@ -1 +1 @@ -@media(min-width:768px){.row{position:relative;}.bottom-align-text{position:absolute;bottom:0;right:0;}}@media(max-width:48em){.home{padding-top:1rem;}}@media(min-width:48em){.home{padding-top:4rem;}}.btn{border-radius:.25rem !important;}.multiSelect{background-color:#4e5d6c;}.form-control-custom{background-color:#4e5d6c !important;color:#fff !important;}h1{font-size:3.5rem !important;font-weight:600 !important;}.request-title{margin-top:0 !important;font-size:1.9rem !important;}p{font-size:1.1rem !important;}label{display:inline-block !important;margin-bottom:.5rem !important;font-size:16px !important;}.btn-danger-outline{color:#d9534f !important;background-color:transparent;background-image:none;border-color:#d9534f !important;}.btn-danger-outline:focus,.btn-danger-outline.focus,.btn-danger-outline:active,.btn-danger-outline.active,.btn-danger-outline:hover,.open>.btn-danger-outline.dropdown-toggle{color:#fff !important;background-color:#d9534f !important;border-color:#d9534f !important;}.btn-primary-outline{color:#ff761b !important;background-color:transparent;background-image:none;border-color:#ff761b !important;}.btn-primary-outline:focus,.btn-primary-outline.focus,.btn-primary-outline:active,.btn-primary-outline.active,.btn-primary-outline:hover,.open>.btn-primary-outline.dropdown-toggle{color:#fff !important;background-color:#df691a !important;border-color:#df691a !important;}.btn-info-outline{color:#5bc0de !important;background-color:transparent;background-image:none;border-color:#5bc0de !important;}.btn-info-outline:focus,.btn-info-outline.focus,.btn-info-outline:active,.btn-info-outline.active,.btn-info-outline:hover,.open>.btn-info-outline.dropdown-toggle{color:#fff !important;background-color:#5bc0de !important;border-color:#5bc0de !important;}.btn-warning-outline{color:#f0ad4e !important;background-color:transparent;background-image:none;border-color:#f0ad4e !important;}.btn-warning-outline:focus,.btn-warning-outline.focus,.btn-warning-outline:active,.btn-warning-outline.active,.btn-warning-outline:hover,.open>.btn-warning-outline.dropdown-toggle{color:#fff !important;background-color:#f0ad4e !important;border-color:#f0ad4e !important;}.btn-success-outline{color:#5cb85c !important;background-color:transparent;background-image:none;border-color:#5cb85c !important;}.btn-success-outline:focus,.btn-success-outline.focus,.btn-success-outline:active,.btn-success-outline.active,.btn-success-outline:hover,.open>.btn-success-outline.dropdown-toggle{color:#fff !important;background-color:#5cb85c !important;border-color:#5cb85c !important;}#movieList .mix{display:none;}#tvList .mix{display:none;} \ No newline at end of file +@media(min-width:768px){.row{position:relative;}.bottom-align-text{position:absolute;bottom:0;right:0;}}@media(max-width:48em){.home{padding-top:1rem;}}@media(min-width:48em){.home{padding-top:4rem;}}.btn{border-radius:.25rem !important;}.multiSelect{background-color:#4e5d6c;}.form-control-custom{background-color:#4e5d6c !important;color:#fff !important;}h1{font-size:3.5rem !important;font-weight:600 !important;}.request-title{margin-top:0 !important;font-size:1.9rem !important;}p{font-size:1.1rem !important;}label{display:inline-block !important;margin-bottom:.5rem !important;font-size:16px !important;}.btn-danger-outline{color:#d9534f !important;background-color:transparent;background-image:none;border-color:#d9534f !important;}.btn-danger-outline:focus,.btn-danger-outline.focus,.btn-danger-outline:active,.btn-danger-outline.active,.btn-danger-outline:hover,.open>.btn-danger-outline.dropdown-toggle{color:#fff !important;background-color:#d9534f !important;border-color:#d9534f !important;}.btn-primary-outline{color:#ff761b !important;background-color:transparent;background-image:none;border-color:#ff761b !important;}.btn-primary-outline:focus,.btn-primary-outline.focus,.btn-primary-outline:active,.btn-primary-outline.active,.btn-primary-outline:hover,.open>.btn-primary-outline.dropdown-toggle{color:#fff !important;background-color:#df691a !important;border-color:#df691a !important;}.btn-info-outline{color:#5bc0de !important;background-color:transparent;background-image:none;border-color:#5bc0de !important;}.btn-info-outline:focus,.btn-info-outline.focus,.btn-info-outline:active,.btn-info-outline.active,.btn-info-outline:hover,.open>.btn-info-outline.dropdown-toggle{color:#fff !important;background-color:#5bc0de !important;border-color:#5bc0de !important;}.btn-warning-outline{color:#f0ad4e !important;background-color:transparent;background-image:none;border-color:#f0ad4e !important;}.btn-warning-outline:focus,.btn-warning-outline.focus,.btn-warning-outline:active,.btn-warning-outline.active,.btn-warning-outline:hover,.open>.btn-warning-outline.dropdown-toggle{color:#fff !important;background-color:#f0ad4e !important;border-color:#f0ad4e !important;}.btn-success-outline{color:#5cb85c !important;background-color:transparent;background-image:none;border-color:#5cb85c !important;}.btn-success-outline:focus,.btn-success-outline.focus,.btn-success-outline:active,.btn-success-outline.active,.btn-success-outline:hover,.open>.btn-success-outline.dropdown-toggle{color:#fff !important;background-color:#5cb85c !important;border-color:#5cb85c !important;}#movieList .mix{display:none;}#tvList .mix{display:none;}.scroll-top-wrapper{position:fixed;opacity:0;visibility:hidden;overflow:hidden;text-align:center;z-index:99999999;background-color:#4e5d6c;color:#eee;width:50px;height:48px;line-height:48px;right:30px;bottom:30px;padding-top:2px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;}.scroll-top-wrapper:hover{background-color:#637689;}.scroll-top-wrapper.show{visibility:visible;cursor:pointer;opacity:1;}.scroll-top-wrapper i.fa{line-height:inherit;} \ No newline at end of file diff --git a/PlexRequests.UI/Content/custom.scss b/PlexRequests.UI/Content/custom.scss index df29fcfc8..2f6593c23 100644 --- a/PlexRequests.UI/Content/custom.scss +++ b/PlexRequests.UI/Content/custom.scss @@ -1,4 +1,5 @@ $form-color: #4e5d6c; +$form-color-lighter: #637689; $primary-colour: #df691a; $primary-colour-outline: #ff761b; $info-colour: #5bc0de; @@ -161,4 +162,44 @@ label { } #tvList .mix{ display: none; -} \ No newline at end of file +} + +$border-radius: 10px; + +.scroll-top-wrapper { + position: fixed; + opacity: 0; + visibility: hidden; + overflow: hidden; + text-align: center; + z-index: 99999999; + background-color: $form-color; + color: #eeeeee; + width: 50px; + height: 48px; + line-height: 48px; + right: 30px; + bottom: 30px; + padding-top: 2px; + border-top-left-radius: $border-radius; + border-top-right-radius: $border-radius; + border-bottom-right-radius: $border-radius; + border-bottom-left-radius: $border-radius; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; +} +.scroll-top-wrapper:hover { + background-color: $form-color-lighter; +} +.scroll-top-wrapper.show { + visibility:visible; + cursor:pointer; + opacity: 1.0; +} +.scroll-top-wrapper i.fa { + line-height: inherit; +} + \ No newline at end of file diff --git a/PlexRequests.UI/Modules/AdminModule.cs b/PlexRequests.UI/Modules/AdminModule.cs index e62b8b97b..9d5a21c99 100644 --- a/PlexRequests.UI/Modules/AdminModule.cs +++ b/PlexRequests.UI/Modules/AdminModule.cs @@ -58,7 +58,7 @@ namespace PlexRequests.UI.Modules { public class AdminModule : NancyModule { - private ISettingsService RpService { get; } + private ISettingsService PrService { get; } private ISettingsService CpService { get; } private ISettingsService AuthService { get; } private ISettingsService PlexService { get; } @@ -77,7 +77,7 @@ namespace PlexRequests.UI.Modules private INotificationService NotificationService { get; } private static Logger Log = LogManager.GetCurrentClassLogger(); - public AdminModule(ISettingsService rpService, + public AdminModule(ISettingsService prService, ISettingsService cpService, ISettingsService auth, ISettingsService plex, @@ -95,7 +95,7 @@ namespace PlexRequests.UI.Modules INotificationService notify, ISettingsService headphones) : base("admin") { - RpService = rpService; + PrService = prService; CpService = cpService; AuthService = auth; PlexService = plex; @@ -182,7 +182,7 @@ namespace PlexRequests.UI.Modules private Negotiator Admin() { - var settings = RpService.GetSettings(); + var settings = PrService.GetSettings(); Log.Trace("Getting Settings:"); Log.Trace(settings.DumpJson()); @@ -193,7 +193,7 @@ namespace PlexRequests.UI.Modules { var model = this.Bind(); - RpService.SaveSettings(model); + PrService.SaveSettings(model); return Context.GetRedirect("~/admin"); diff --git a/PlexRequests.UI/Modules/UserLoginModule.cs b/PlexRequests.UI/Modules/UserLoginModule.cs index cfadd2b8f..bd6643071 100644 --- a/PlexRequests.UI/Modules/UserLoginModule.cs +++ b/PlexRequests.UI/Modules/UserLoginModule.cs @@ -170,7 +170,7 @@ namespace PlexRequests.UI.Modules var users = Api.GetUsers(authToken); Log.Debug("Plex Users: "); Log.Debug(users.DumpJson()); - var allUsers = users.User?.Where(x => !string.IsNullOrEmpty(x.Username)); + var allUsers = users?.User?.Where(x => !string.IsNullOrEmpty(x.Username)); return allUsers != null && allUsers.Any(x => x.Username.Equals(username, StringComparison.CurrentCultureIgnoreCase)); } diff --git a/PlexRequests.UI/Program.cs b/PlexRequests.UI/Program.cs index c8f863f40..5f07f7436 100644 --- a/PlexRequests.UI/Program.cs +++ b/PlexRequests.UI/Program.cs @@ -69,7 +69,7 @@ namespace PlexRequests.UI if (port == -1) port = GetStartupPort(); - var options = new StartOptions(Debugger.IsAttached ? $"http://localhost:{port}" : $"http://+:{port}") + var options = new StartOptions( $"http://+:{port}") { ServerFactory = "Microsoft.Owin.Host.HttpListener" }; diff --git a/PlexRequests.UI/Views/Admin/Settings.cshtml b/PlexRequests.UI/Views/Admin/Settings.cshtml index edbe6009c..a7ed52268 100644 --- a/PlexRequests.UI/Views/Admin/Settings.cshtml +++ b/PlexRequests.UI/Views/Admin/Settings.cshtml @@ -52,6 +52,20 @@ +
+
+ +
+
+
+
+ +
+
+ @*
diff --git a/PlexRequests.UI/Views/Shared/_Layout.cshtml b/PlexRequests.UI/Views/Shared/_Layout.cshtml index 5245bdbdd..6b133fb86 100644 --- a/PlexRequests.UI/Views/Shared/_Layout.cshtml +++ b/PlexRequests.UI/Views/Shared/_Layout.cshtml @@ -87,8 +87,37 @@
-
- @RenderBody() +
+ @RenderBody() +
+
+ + +
+ \ No newline at end of file