From 46f7a0769e85fafff848d11883b2ca73d0691c6a Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 8 Jun 2016 22:06:38 +0100 Subject: [PATCH] styling for #298 done, just need to wire up the model and do the actual status check --- .../SettingModels/LandingPageSettings.cs | 1 + PlexRequests.UI.Tests/UserLoginModuleTests.cs | 3 +- PlexRequests.UI/Content/base.css | 15 +++++- PlexRequests.UI/Content/base.min.css | 2 +- PlexRequests.UI/Content/base.scss | 18 ++++++- PlexRequests.UI/Content/images/logo.png | Bin 0 -> 8653 bytes .../Models/LandingPageViewModel.cs | 36 +++++++++++++ PlexRequests.UI/Modules/LandingPageModule.cs | 17 ++++++- PlexRequests.UI/Modules/UserLoginModule.cs | 48 ++++++++++++++---- PlexRequests.UI/PlexRequests.UI.csproj | 4 ++ .../Views/Admin/LandingPage.cshtml | 14 ++++- PlexRequests.UI/Views/Landing/Index.cshtml | 40 ++++++++++++++- PlexRequests.UI/Views/Shared/Blank.cshtml | 3 +- PlexRequests.UI/Views/UserLogin/Index.cshtml | 2 +- 14 files changed, 180 insertions(+), 23 deletions(-) create mode 100644 PlexRequests.UI/Content/images/logo.png create mode 100644 PlexRequests.UI/Models/LandingPageViewModel.cs diff --git a/PlexRequests.Core/SettingModels/LandingPageSettings.cs b/PlexRequests.Core/SettingModels/LandingPageSettings.cs index ae8973081..e3ca5a88e 100644 --- a/PlexRequests.Core/SettingModels/LandingPageSettings.cs +++ b/PlexRequests.Core/SettingModels/LandingPageSettings.cs @@ -31,6 +31,7 @@ namespace PlexRequests.Core.SettingModels public class LandingPageSettings : Settings { public bool Enabled { get; set; } + public bool BeforeLogin { get; set; } public bool NoticeEnable { get; set; } public string NoticeMessage { get; set; } public bool EnabledNoticeTime { get; set; } diff --git a/PlexRequests.UI.Tests/UserLoginModuleTests.cs b/PlexRequests.UI.Tests/UserLoginModuleTests.cs index 18e3081c5..2d90f105d 100644 --- a/PlexRequests.UI.Tests/UserLoginModuleTests.cs +++ b/PlexRequests.UI.Tests/UserLoginModuleTests.cs @@ -64,6 +64,7 @@ namespace PlexRequests.UI.Tests PlexRequestMock = new Mock>(); PlexRequestMock.Setup(x => x.GetSettings()).Returns(new PlexRequestSettings()); PlexRequestMock.Setup(x => x.GetSettingsAsync()).Returns(Task.FromResult(new PlexRequestSettings())); + LandingPageMock.Setup(x => x.GetSettings()).Returns(new LandingPageSettings()); Bootstrapper = new ConfigurableBootstrapper(with => { with.Module(); @@ -81,8 +82,6 @@ namespace PlexRequests.UI.Tests var expectedSettings = new AuthenticationSettings { UserAuthentication = false, PlexAuthToken = "abc" }; AuthMock.Setup(x => x.GetSettings()).Returns(expectedSettings); - - Bootstrapper.WithSession(new Dictionary()); var browser = new Browser(Bootstrapper); diff --git a/PlexRequests.UI/Content/base.css b/PlexRequests.UI/Content/base.css index 7c573a958..d3297218a 100644 --- a/PlexRequests.UI/Content/base.css +++ b/PlexRequests.UI/Content/base.css @@ -298,9 +298,22 @@ label { background-color: #4e5d6c; } .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after { - border-bottom: 6px solid #df691a !important; } + border-bottom: 6px solid #4e5d6c !important; } .bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { color: #fff !important; } +img.center { + display: block; + margin: 0 auto; } + +div.landing-block { + background: #424242 !important; + padding-bottom: 30px; + padding-top: 15px; } + +span.landing-title { + font-size: 32px; + font-weight: 600; } + diff --git a/PlexRequests.UI/Content/base.min.css b/PlexRequests.UI/Content/base.min.css index a6aa3d500..c8c60fe01 100644 --- a/PlexRequests.UI/Content/base.min.css +++ b/PlexRequests.UI/Content/base.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;}}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fff;}hr{border:1px dashed #777;}.btn{border-radius:.25rem !important;}.btn-group-separated .btn,.btn-group-separated .btn+.btn{margin-left:3px;}.multiSelect{background-color:#4e5d6c;}.form-control-custom{background-color:#4e5d6c !important;color:#fff !important;border-radius:0;box-shadow:0 0 0 !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;}.nav-tabs>li{font-size:13px;line-height:21px;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.nav-tabs>li>a>.fa{padding:3px 5px 3px 3px;}.nav-tabs>li.nav-tab-right{float:right;}.nav-tabs>li.nav-tab-right a{margin-right:0;margin-left:2px;}.nav-tabs>li.nav-tab-icononly .fa{padding:3px;}.navbar .nav a .fa,.dropdown-menu a .fa{font-size:130%;top:1px;position:relative;display:inline-block;margin-right:5px;}.dropdown-menu a .fa{top:2px;}.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-search-results{text-align:center;}.no-search-results .no-search-results-icon{font-size:10em;color:#4e5d6c;}.no-search-results .no-search-results-text{margin:20px 0;color:#ccc;}.form-control-search{padding:13px 105px 13px 16px;height:100%;}.form-control-withbuttons{padding-right:105px;}.input-group-addon .btn-group{position:absolute;right:45px;z-index:3;top:10px;box-shadow:0 0 0;}.input-group-addon .btn-group .btn{border:1px solid rgba(255,255,255,.7) !important;padding:3px 12px;color:rgba(255,255,255,.7) !important;}.btn-split .btn{border-radius:0 !important;}.btn-split .btn:not(.dropdown-toggle){border-radius:.25rem 0 0 .25rem !important;}.btn-split .btn.dropdown-toggle{border-radius:0 .25rem .25rem 0 !important;padding:12px 8px;}#updateAvailable{background-color:#df691a;text-align:center;font-size:15px;padding:3px 0;}.checkbox label{display:inline-block;cursor:pointer;position:relative;padding-left:25px;margin-right:15px;font-size:13px;margin-bottom:10px;}.checkbox label:before{content:"";display:inline-block;width:18px;height:18px;margin-right:10px;position:absolute;left:0;bottom:1px;border:2px solid #eee;border-radius:3px;}.checkbox input[type=checkbox]{display:none;}.checkbox input[type=checkbox]:checked+label:before{content:"✓";font-size:13px;color:#fafafa;text-align:center;line-height:13px;}.input-group-sm{padding-top:2px;padding-bottom:2px;}.tab-pane .form-horizontal .form-group{margin-right:15px;margin-left:15px;}.bootstrap-datetimepicker-widget.dropdown-menu{background-color:#4e5d6c;}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-bottom:6px solid #df691a !important;}.bootstrap-datetimepicker-widget table td.active,.bootstrap-datetimepicker-widget table td.active:hover{color:#fff !important;} \ 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;}}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fff;}hr{border:1px dashed #777;}.btn{border-radius:.25rem !important;}.btn-group-separated .btn,.btn-group-separated .btn+.btn{margin-left:3px;}.multiSelect{background-color:#4e5d6c;}.form-control-custom{background-color:#4e5d6c !important;color:#fff !important;border-radius:0;box-shadow:0 0 0 !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;}.nav-tabs>li{font-size:13px;line-height:21px;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.nav-tabs>li>a>.fa{padding:3px 5px 3px 3px;}.nav-tabs>li.nav-tab-right{float:right;}.nav-tabs>li.nav-tab-right a{margin-right:0;margin-left:2px;}.nav-tabs>li.nav-tab-icononly .fa{padding:3px;}.navbar .nav a .fa,.dropdown-menu a .fa{font-size:130%;top:1px;position:relative;display:inline-block;margin-right:5px;}.dropdown-menu a .fa{top:2px;}.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-search-results{text-align:center;}.no-search-results .no-search-results-icon{font-size:10em;color:#4e5d6c;}.no-search-results .no-search-results-text{margin:20px 0;color:#ccc;}.form-control-search{padding:13px 105px 13px 16px;height:100%;}.form-control-withbuttons{padding-right:105px;}.input-group-addon .btn-group{position:absolute;right:45px;z-index:3;top:10px;box-shadow:0 0 0;}.input-group-addon .btn-group .btn{border:1px solid rgba(255,255,255,.7) !important;padding:3px 12px;color:rgba(255,255,255,.7) !important;}.btn-split .btn{border-radius:0 !important;}.btn-split .btn:not(.dropdown-toggle){border-radius:.25rem 0 0 .25rem !important;}.btn-split .btn.dropdown-toggle{border-radius:0 .25rem .25rem 0 !important;padding:12px 8px;}#updateAvailable{background-color:#df691a;text-align:center;font-size:15px;padding:3px 0;}.checkbox label{display:inline-block;cursor:pointer;position:relative;padding-left:25px;margin-right:15px;font-size:13px;margin-bottom:10px;}.checkbox label:before{content:"";display:inline-block;width:18px;height:18px;margin-right:10px;position:absolute;left:0;bottom:1px;border:2px solid #eee;border-radius:3px;}.checkbox input[type=checkbox]{display:none;}.checkbox input[type=checkbox]:checked+label:before{content:"✓";font-size:13px;color:#fafafa;text-align:center;line-height:13px;}.input-group-sm{padding-top:2px;padding-bottom:2px;}.tab-pane .form-horizontal .form-group{margin-right:15px;margin-left:15px;}.bootstrap-datetimepicker-widget.dropdown-menu{background-color:#4e5d6c;}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-bottom:6px solid #4e5d6c !important;}.bootstrap-datetimepicker-widget table td.active,.bootstrap-datetimepicker-widget table td.active:hover{color:#fff !important;}img.center{display:block;margin:0 auto;}div.landing-block{background:#424242 !important;padding-bottom:30px;padding-top:15px;}span.landing-title{font-size:32px;font-weight:600;} \ No newline at end of file diff --git a/PlexRequests.UI/Content/base.scss b/PlexRequests.UI/Content/base.scss index 49f59674d..471a7204f 100644 --- a/PlexRequests.UI/Content/base.scss +++ b/PlexRequests.UI/Content/base.scss @@ -354,7 +354,7 @@ $border-radius: 10px; text-align: center; line-height: 13px; } -.input-group-sm{form +.input-group-sm{ padding-top: 2px; padding-bottom: 2px; } @@ -374,4 +374,20 @@ $border-radius: 10px; .bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover { color: #fff !important; +} + +img.center { + display: block; + margin: 0 auto; +} + +div.landing-block{ + background: #424242 !important; + padding-bottom:30px; + padding-top:15px; +} + +span.landing-title{ + font-size:32px; + font-weight:600; } \ No newline at end of file diff --git a/PlexRequests.UI/Content/images/logo.png b/PlexRequests.UI/Content/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..68df0f5cdb570bf168f13c87f960ba67b21b6043 GIT binary patch literal 8653 zcmch6^;=Zm7w#bxP#Ob~Zlt7R=ui*@6e%g`9(w3d5GjX}7+MgJ?if-@>5?u18Da(y z2I;|j_uCIkRfNYpr*$9i^l7l)YVj80swv#0N@c2-vn2T z?quVGKM%ZA4ZU<-ZM}RfJZu0(YgbDfW_1?}JDZm_7S?|5{WdZHz~ZW|qWH>p9<$^W zYh@SIchF%mg`XU)S1efato%f^paj2%SM0t(zrT_Lum9Ww;(lvEBZxEpTXysu`$Hx1 z*%2r-W6)RW$H(vk&J3Gc!rt4T?%6+ZRl;XUo__HH6tkvZa-R1Rt^eq~_|P_%iOE$a zd;Nj=sHeb6+;8Nph}^L!JSaH$YE&wY7&Q6++Y>sgHbw|)TbF>eh&Z$t@bfkM9sZ6w z|LRloUJtb7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TUxa_eJ2K9k^-7AdM-P3=Z=yMo_pp0lgMiy-!I%%v@&(e#`hsIkGPutpN z{B~dUubo|rp28YC_W1r1ey01mw0uH8w(>vD;Ley%pNRn4O@EK7&JI zKO+ggoj+mTSi%$c3Ki77<-m-6D0UkzeiEqdwNi8p9Ycww-@`o{BTOS~HtQY4e*)m4|(#`hm9|RsD`QWP+qB=$hKg%$);TM`` z)$2^y<1gqp8KXoBA8~Du!d*sUd1;9^YzY&N|9I`oOms1>-Z$9un`rIjCU3SvkaRkW zKuH87*0AG`>ysHa#ug?e{ms#eB#}Z+p7^Z9QIXvbtt!I|Z)v`icQbZunq-_E2wg2% ztq3buOsDE1i{9N7+0qg&s=azl?*8R?#zo0ai_SK~zLEexFT`be%N`VRvo}peGa63y z@cf4=8Ry>5muA>Ft@QTll-|G`u^0$qis8N4;>%{UW&UzueV>3GYz3ho*K)Aj-tp&A zRe4G0eX3_(wrP%`+1f5j3#B=`m7|}hg-|*R|5_Ol;sqX{KDDdk2K<}VQKtr7g$Xy0Uu?I&FbLTemJt)TEsNZ;bftSk^I zG%&0Xi`;zr6Z;Yt=Q0s$m@sWvUKkKC(doNxjz+ N)K#@qDwN*5`#-LTRj~j7 literal 0 HcmV?d00001 diff --git a/PlexRequests.UI/Models/LandingPageViewModel.cs b/PlexRequests.UI/Models/LandingPageViewModel.cs new file mode 100644 index 000000000..300f49762 --- /dev/null +++ b/PlexRequests.UI/Models/LandingPageViewModel.cs @@ -0,0 +1,36 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: LandingPageViewModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion + +using PlexRequests.Core.SettingModels; + +namespace PlexRequests.UI.Models +{ + public class LandingPageViewModel : LandingPageSettings + { + public string ContinueUrl { get; set; } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/Modules/LandingPageModule.cs b/PlexRequests.UI/Modules/LandingPageModule.cs index 92a7bf72e..4564e32ef 100644 --- a/PlexRequests.UI/Modules/LandingPageModule.cs +++ b/PlexRequests.UI/Modules/LandingPageModule.cs @@ -33,6 +33,7 @@ using Nancy.Responses.Negotiation; using PlexRequests.Api.Interfaces; using PlexRequests.Core; using PlexRequests.Core.SettingModels; +using PlexRequests.UI.Models; namespace PlexRequests.UI.Modules { @@ -57,8 +58,20 @@ namespace PlexRequests.UI.Modules private async Task Index() { - var model = await LandingSettings.GetSettingsAsync(); - return View["Index", model]; + var s = await LandingSettings.GetSettingsAsync(); + var model = new LandingPageViewModel + { + Enabled = s.Enabled, + Id = s.Id, + EnabledNoticeTime = s.EnabledNoticeTime, + NoticeEnable = s.NoticeEnable, + NoticeEnd = s.NoticeEnd, + NoticeMessage = s.NoticeMessage, + NoticeStart = s.NoticeStart, + ContinueUrl = s.BeforeLogin ? $"userlogin" : $"search" + }; + + return View["Landing/Index", model]; } private async Task CheckStatus() diff --git a/PlexRequests.UI/Modules/UserLoginModule.cs b/PlexRequests.UI/Modules/UserLoginModule.cs index f87201a79..1f4b6d4c2 100644 --- a/PlexRequests.UI/Modules/UserLoginModule.cs +++ b/PlexRequests.UI/Modules/UserLoginModule.cs @@ -71,9 +71,25 @@ namespace PlexRequests.UI.Modules if (landingCheck) { var landingSettings = await LandingPageSettings.GetSettingsAsync(); + if (landingSettings.Enabled) { - return View["Landing/Index", landingSettings]; + if (landingSettings.BeforeLogin) + { + var model = new LandingPageViewModel + { + Enabled = landingSettings.Enabled, + Id = landingSettings.Id, + EnabledNoticeTime = landingSettings.EnabledNoticeTime, + NoticeEnable = landingSettings.NoticeEnable, + NoticeEnd = landingSettings.NoticeEnd, + NoticeMessage = landingSettings.NoticeMessage, + NoticeStart = landingSettings.NoticeStart, + ContinueUrl = landingSettings.BeforeLogin ? $"userlogin" : $"search" + }; + + return View["Landing/Index", model]; + } } } var settings = await AuthService.GetSettingsAsync(); @@ -84,7 +100,7 @@ namespace PlexRequests.UI.Modules { var dateTimeOffset = Request.Form.DateTimeOffset; var username = Request.Form.username.Value; - Log.Debug("Username \"{0}\" attempting to login",username); + Log.Debug("Username \"{0}\" attempting to login", username); if (string.IsNullOrWhiteSpace(username)) { return Response.AsJson(new JsonResponseModel { Result = false, Message = "Incorrect User or Password" }); @@ -107,7 +123,7 @@ namespace PlexRequests.UI.Modules password = Request.Form.password.Value; } - + if (settings.UserAuthentication && settings.UsePassword) // Authenticate with Plex { Log.Debug("Need to auth and also provide pass"); @@ -127,7 +143,7 @@ namespace PlexRequests.UI.Modules } } } - else if(settings.UserAuthentication) // Check against the users in Plex + else if (settings.UserAuthentication) // Check against the users in Plex { Log.Debug("Need to auth"); authenticated = CheckIfUserIsInPlexFriends(username, settings.PlexAuthToken); @@ -138,7 +154,7 @@ namespace PlexRequests.UI.Modules } Log.Debug("Friends list result = {0}", authenticated); } - else if(!settings.UserAuthentication) // No auth, let them pass! + else if (!settings.UserAuthentication) // No auth, let them pass! { Log.Debug("No need to auth"); authenticated = true; @@ -153,12 +169,22 @@ namespace PlexRequests.UI.Modules Session[SessionKeys.ClientDateTimeOffsetKey] = (int)dateTimeOffset; - return Response.AsJson(authenticated - ? new JsonResponseModel { Result = true } - : new JsonResponseModel { Result = false, Message = "Incorrect User or Password"}); + if (!authenticated) + { + return Response.AsJson(new JsonResponseModel {Result = false, Message = "Incorrect User or Password"}); + } + + var landingSettings = LandingPageSettings.GetSettings(); + + if (landingSettings.Enabled) + { + if (!landingSettings.BeforeLogin) + return Response.AsJson(new JsonResponseModel { Result = true, Message = "landing" }); + } + return Response.AsJson(new JsonResponseModel {Result = true, Message = "search" }); } - + private Response Logout() { @@ -167,8 +193,8 @@ namespace PlexRequests.UI.Modules { Session.Delete(SessionKeys.UsernameKey); } - return Context.GetRedirect(!string.IsNullOrEmpty(BaseUrl) - ? $"~/{BaseUrl}/userlogin" + return Context.GetRedirect(!string.IsNullOrEmpty(BaseUrl) + ? $"~/{BaseUrl}/userlogin" : "~/userlogin"); } diff --git a/PlexRequests.UI/PlexRequests.UI.csproj b/PlexRequests.UI/PlexRequests.UI.csproj index bfa1654d9..cbe10833a 100644 --- a/PlexRequests.UI/PlexRequests.UI.csproj +++ b/PlexRequests.UI/PlexRequests.UI.csproj @@ -179,6 +179,7 @@ + @@ -331,6 +332,9 @@ PreserveNewest + + PreserveNewest + diff --git a/PlexRequests.UI/Views/Admin/LandingPage.cshtml b/PlexRequests.UI/Views/Admin/LandingPage.cshtml index 562759a66..54f252daf 100644 --- a/PlexRequests.UI/Views/Admin/LandingPage.cshtml +++ b/PlexRequests.UI/Views/Admin/LandingPage.cshtml @@ -9,7 +9,6 @@
- @if (Model.Enabled) { @@ -21,6 +20,19 @@
If enabled then all users will be redirected to the landing page instead of the login page.
+
+
+ @if (Model.BeforeLogin) + { + + } + else + { + + } +
+ If enabled then this will show the landing page before the login page, if this is disabled the user will log in first and then see the landing page. +

diff --git a/PlexRequests.UI/Views/Landing/Index.cshtml b/PlexRequests.UI/Views/Landing/Index.cshtml index 09d431a65..8e93f3da3 100644 --- a/PlexRequests.UI/Views/Landing/Index.cshtml +++ b/PlexRequests.UI/Views/Landing/Index.cshtml @@ -1,3 +1,41 @@ -@inherits PlexRequests.UI.Helpers.EmptyViewBase + +@inherits PlexRequests.UI.Helpers.EmptyViewBase + + +
+ @if (Model.NoticeEnable) + { +
+
+ +
+
+ Notice +
+ @Model.NoticeMessage +
+ 6/27/2016 @@ 9:00PM CST to 6/27/2016 @@ 9:00PM CST +
+
+
+
+
+
+ } +
+
+ +
+
+ Currently Online +
+ The Plex server is currently online (check this page for continuous status updates) + +
+
+
+ \ No newline at end of file diff --git a/PlexRequests.UI/Views/Shared/Blank.cshtml b/PlexRequests.UI/Views/Shared/Blank.cshtml index bbb31e108..d5b1f73eb 100644 --- a/PlexRequests.UI/Views/Shared/Blank.cshtml +++ b/PlexRequests.UI/Views/Shared/Blank.cshtml @@ -23,9 +23,8 @@ -
@RenderBody() -
+ diff --git a/PlexRequests.UI/Views/UserLogin/Index.cshtml b/PlexRequests.UI/Views/UserLogin/Index.cshtml index eefe4929e..ff2d574ff 100644 --- a/PlexRequests.UI/Views/UserLogin/Index.cshtml +++ b/PlexRequests.UI/Views/UserLogin/Index.cshtml @@ -54,7 +54,7 @@ console.log(response); if (response.result === true) { - window.location.replace(url); + location.replace(response.message); } else { generateNotify(response.message, "warning");