From 3d944b32a8fb6e6bad4c3688586007dd80b17a32 Mon Sep 17 00:00:00 2001 From: Drewster727 Date: Sun, 27 Mar 2016 16:54:54 -0500 Subject: [PATCH 01/23] fix up sorting on the request page --- PlexRequests.UI/Content/requests.js | 79 +++++++++++---------- PlexRequests.UI/Models/RequestViewModel.cs | 2 + PlexRequests.UI/Modules/RequestsModule.cs | 4 ++ PlexRequests.UI/Views/Requests/Index.cshtml | 7 +- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/PlexRequests.UI/Content/requests.js b/PlexRequests.UI/Content/requests.js index 3872da2c2..bbca674af 100644 --- a/PlexRequests.UI/Content/requests.js +++ b/PlexRequests.UI/Content/requests.js @@ -9,6 +9,16 @@ var searchSource = $("#search-template").html(); var searchTemplate = Handlebars.compile(searchSource); var movieTimer = 0; var tvimer = 0; +var mixItUpDefault = { + animation: { enable: true }, + load: { + filter: 'all', + sort: 'default:asc' + }, + layout: { + display: 'block' + } +}; movieLoad(); tvLoad(); @@ -17,40 +27,26 @@ tvLoad(); $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { var target = $(e.target).attr('href'); var activeState = ""; - if (target === "#TvShowTab") { - if ($('#movieList').mixItUp('isLoaded')) { - activeState = $('#movieList').mixItUp('getState'); - $('#movieList').mixItUp('destroy'); - } - if (!$('#tvList').mixItUp('isLoaded')) { - $('#tvList').mixItUp({ - load: { - filter: activeState.activeFilter || 'all', - sort: activeState.activeSort || 'default:asc' - }, - layout: { - display: 'block' - } - }); + var $ml = $('#movieList'); + var $tvl = $('#tvList'); + + if (target === "#TvShowTab") { + + if ($ml.mixItUp('isLoaded')) { + activeState = $ml.mixItUp('getState'); + $ml.mixItUp('destroy'); } + if ($tvl.mixItUp('isLoaded')) $tvl.mixItUp('destroy'); + $tvl.mixItUp(mixItUpConfig(activeState)); // init or reinit } if (target === "#MoviesTab") { - if ($('#tvList').mixItUp('isLoaded')) { - activeState = $('#tvList').mixItUp('getState'); - $('#tvList').mixItUp('destroy'); - } - if (!$('#movieList').mixItUp('isLoaded')) { - $('#movieList').mixItUp({ - load: { - filter: activeState.activeFilter || 'all', - sort: activeState.activeSort || 'default:asc' - }, - layout: { - display: 'block' - } - }); + if ($tvl.mixItUp('isLoaded')) { + activeState = $tvl.mixItUp('getState'); + $tvl.mixItUp('destroy'); } + if ($ml.mixItUp('isLoaded')) $ml.mixItUp('destroy'); + $ml.mixItUp(mixItUpConfig(activeState)); // init or reinit } }); @@ -315,24 +311,26 @@ $(document).on("click", ".change", function (e) { }); +function mixItUpConfig(activeState) { + var conf = mixItUpDefault; + + if (activeState) { + if (activeState.activeFilter) conf['load']['filter'] = activeState.activeFilter; + if (activeState.activeSort) conf['load']['sort'] = activeState.activeSort; + } + return conf; +}; + function movieLoad() { $("#movieList").html(""); $.ajax("/requests/movies/").success(function (results) { results.forEach(function (result) { var context = buildRequestContext(result, "movie"); - var html = searchTemplate(context); $("#movieList").append(html); }); - $('#movieList').mixItUp({ - layout: { - display: 'block' - }, - load: { - filter: 'all' - } - }); + $('#movieList').mixItUp(mixItUpConfig()); }); }; @@ -345,6 +343,7 @@ function tvLoad() { var html = searchTemplate(context); $("#tvList").append(html); }); + $('#tvList').mixItUp(mixItUpConfig()); }); }; @@ -359,9 +358,11 @@ function buildRequestContext(result, type) { type: type, status: result.status, releaseDate: result.releaseDate, + releaseDateTicks: result.releaseDateTicks, approved: result.approved, requestedBy: result.requestedBy, requestedDate: result.requestedDate, + requestedDateTicks: result.requestedDateTicks, available: result.available, admin: result.admin, issues: result.issues, @@ -376,7 +377,7 @@ function buildRequestContext(result, type) { } function startFilter(elementId) { - $('#'+element).mixItUp({ + $('#' + element).mixItUp({ load: { filter: activeState.activeFilter || 'all', sort: activeState.activeSort || 'default:asc' diff --git a/PlexRequests.UI/Models/RequestViewModel.cs b/PlexRequests.UI/Models/RequestViewModel.cs index 011b9977d..5ee389be9 100644 --- a/PlexRequests.UI/Models/RequestViewModel.cs +++ b/PlexRequests.UI/Models/RequestViewModel.cs @@ -37,11 +37,13 @@ namespace PlexRequests.UI.Models public string Title { get; set; } public string PosterPath { get; set; } public string ReleaseDate { get; set; } + public long ReleaseDateTicks { get; set; } public RequestType Type { get; set; } public string Status { get; set; } public bool Approved { get; set; } public string RequestedBy { get; set; } public string RequestedDate { get; set; } + public long RequestedDateTicks { get; set; } public string ReleaseYear { get; set; } public bool Available { get; set; } public bool Admin { get; set; } diff --git a/PlexRequests.UI/Modules/RequestsModule.cs b/PlexRequests.UI/Modules/RequestsModule.cs index a951e0db8..47dcf3369 100644 --- a/PlexRequests.UI/Modules/RequestsModule.cs +++ b/PlexRequests.UI/Modules/RequestsModule.cs @@ -90,7 +90,9 @@ namespace PlexRequests.UI.Modules Id = movie.Id, PosterPath = movie.PosterPath, ReleaseDate = movie.ReleaseDate.Humanize(), + ReleaseDateTicks = movie.ReleaseDate.Ticks, RequestedDate = movie.RequestedDate.Humanize(), + RequestedDateTicks = movie.RequestedDate.Ticks, Approved = movie.Approved, Title = movie.Title, Overview = movie.Overview, @@ -119,7 +121,9 @@ namespace PlexRequests.UI.Modules Id = tv.Id, PosterPath = tv.PosterPath, ReleaseDate = tv.ReleaseDate.Humanize(), + ReleaseDateTicks = tv.ReleaseDate.Ticks, RequestedDate = tv.RequestedDate.Humanize(), + RequestedDateTicks = tv.RequestedDate.Ticks, Approved = tv.Approved, Title = tv.Title, Overview = tv.Overview, diff --git a/PlexRequests.UI/Views/Requests/Index.cshtml b/PlexRequests.UI/Views/Requests/Index.cshtml index cd73d64d9..bf79ac7dd 100644 --- a/PlexRequests.UI/Views/Requests/Index.cshtml +++ b/PlexRequests.UI/Views/Requests/Index.cshtml @@ -43,7 +43,10 @@ @if (Model.SearchForMovies) @@ -78,7 +81,7 @@ \ No newline at end of file diff --git a/PlexRequests.UI/Views/Admin/PushoverNotifications.cshtml b/PlexRequests.UI/Views/Admin/PushoverNotifications.cshtml index 0877739d0..b5fcab7f5 100644 --- a/PlexRequests.UI/Views/Admin/PushoverNotifications.cshtml +++ b/PlexRequests.UI/Views/Admin/PushoverNotifications.cshtml @@ -36,6 +36,12 @@ +
+
+ +
+
+
@@ -70,5 +76,28 @@ } }); }); + + $('#testPushover').click(function (e) { + e.preventDefault(); + + var $form = $("#mainForm"); + $.ajax({ + type: $form.prop("method"), + data: $form.serialize(), + url: '/admin/testpushovernotification', + dataType: "json", + success: function (response) { + if (response.result === true) { + generateNotify(response.message, "success"); + } else { + generateNotify(response.message, "warning"); + } + }, + error: function (e) { + console.log(e); + generateNotify("Something went wrong!", "danger"); + } + }); + }); }); \ No newline at end of file From eddce77ff5347ad91a243a260e65359d6afa6401 Mon Sep 17 00:00:00 2001 From: Drewster727 Date: Mon, 28 Mar 2016 14:53:35 -0500 Subject: [PATCH 13/23] UI - increase icon size of nav menu (they were too small before) --- PlexRequests.UI/Content/custom.css | 7 +++++++ PlexRequests.UI/Content/custom.min.css | 2 +- PlexRequests.UI/Content/custom.scss | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/PlexRequests.UI/Content/custom.css b/PlexRequests.UI/Content/custom.css index 7ff72e7f4..cb9a400b5 100644 --- a/PlexRequests.UI/Content/custom.css +++ b/PlexRequests.UI/Content/custom.css @@ -45,6 +45,13 @@ label { .nav-tabs > li.active > a:focus { background: #4e5d6c; } +.navbar .nav a .fa { + font-size: 130%; + top: 1px; + position: relative; + display: inline-block; + margin-right: 5px; } + .btn-danger-outline { color: #d9534f !important; background-color: transparent; diff --git a/PlexRequests.UI/Content/custom.min.css b/PlexRequests.UI/Content/custom.min.css index 2a046eb7d..2966b6610 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;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.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;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.navbar .nav a .fa{font-size:130%;top:1px;position:relative;display:inline-block;margin-right:5px;}.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 diff --git a/PlexRequests.UI/Content/custom.scss b/PlexRequests.UI/Content/custom.scss index 029748ecd..96afda8e8 100644 --- a/PlexRequests.UI/Content/custom.scss +++ b/PlexRequests.UI/Content/custom.scss @@ -71,6 +71,14 @@ label { background: #4e5d6c; } +.navbar .nav a .fa { + font-size: 130%; + top: 1px; + position: relative; + display: inline-block; + margin-right: 5px; +} + .btn-danger-outline { color: $danger-colour $i; background-color: transparent; From a2cbcaa4f1f02eaae761021da3c628a8eceb6a2a Mon Sep 17 00:00:00 2001 From: Drewster727 Date: Mon, 28 Mar 2016 20:50:18 -0500 Subject: [PATCH 14/23] fix notification tests --- .../Notification/NotificationService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PlexRequests.Services/Notification/NotificationService.cs b/PlexRequests.Services/Notification/NotificationService.cs index 8477a2159..35e52fd7d 100644 --- a/PlexRequests.Services/Notification/NotificationService.cs +++ b/PlexRequests.Services/Notification/NotificationService.cs @@ -67,8 +67,14 @@ namespace PlexRequests.Services.Notification private static async Task NotifyAsync(INotification notification, NotificationModel model) { - - await NotifyAsync(notification, model, null); + try + { + await notification.NotifyAsync(model).ConfigureAwait(false); + } + catch (Exception ex) + { + Log.Error(ex, $"Notification '{notification.NotificationName}' failed with exception"); + } } From 855689d0b95a60245fd4ff976a96b9f7df22e13a Mon Sep 17 00:00:00 2001 From: Drewster727 Date: Mon, 28 Mar 2016 21:51:48 -0500 Subject: [PATCH 15/23] add some "no results" feedback to the searching + minor UI improvements --- PlexRequests.UI/Content/custom.css | 15 +++++++++- PlexRequests.UI/Content/custom.min.css | 2 +- PlexRequests.UI/Content/custom.scss | 35 +++++++++++++++++------ PlexRequests.UI/Content/search.js | 8 ++++++ PlexRequests.UI/Views/Search/Index.cshtml | 2 +- 5 files changed, 51 insertions(+), 11 deletions(-) diff --git a/PlexRequests.UI/Content/custom.css b/PlexRequests.UI/Content/custom.css index cb9a400b5..51130e9e9 100644 --- a/PlexRequests.UI/Content/custom.css +++ b/PlexRequests.UI/Content/custom.css @@ -22,7 +22,9 @@ .form-control-custom { background-color: #4e5d6c !important; - color: white !important; } + color: white !important; + border-radius: 0; + box-shadow: 0 0 0 !important; } h1 { font-size: 3.5rem !important; @@ -138,3 +140,14 @@ label { #tvList .mix { display: none; } +.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; } + diff --git a/PlexRequests.UI/Content/custom.min.css b/PlexRequests.UI/Content/custom.min.css index 2966b6610..9e3d7e793 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;}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.navbar .nav a .fa{font-size:130%;top:1px;position:relative;display:inline-block;margin-right:5px;}.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;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.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{background:#4e5d6c;}.navbar .nav a .fa{font-size:130%;top:1px;position:relative;display:inline-block;margin-right:5px;}.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-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;} \ No newline at end of file diff --git a/PlexRequests.UI/Content/custom.scss b/PlexRequests.UI/Content/custom.scss index 96afda8e8..f2703ee4a 100644 --- a/PlexRequests.UI/Content/custom.scss +++ b/PlexRequests.UI/Content/custom.scss @@ -5,7 +5,9 @@ $info-colour: #5bc0de; $warning-colour: #f0ad4e; $danger-colour: #d9534f; $success-colour: #5cb85c; -$i:!important; +$i: +!important +; @media (min-width: 768px ) { .row { @@ -42,6 +44,8 @@ $i:!important; .form-control-custom { background-color: $form-color $i; color: white $i; + border-radius: 0; + box-shadow: 0 0 0 !important; } @@ -65,8 +69,8 @@ label { font-size: 16px $i; } -.nav-tabs > li.active > a, -.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { background: #4e5d6c; } @@ -170,9 +174,24 @@ label { border-color: $success-colour $i; } -#movieList .mix{ - display: none; +#movieList .mix { + display: none; +} + +#tvList .mix { + display: none; +} + +.no-search-results { + text-align: center; +} + +.no-search-results .no-search-results-icon { + font-size: 10em; + color: $form-color; +} + +.no-search-results .no-search-results-text { + margin: 20px 0; + color: #ccc; } -#tvList .mix{ - display: none; -} \ No newline at end of file diff --git a/PlexRequests.UI/Content/search.js b/PlexRequests.UI/Content/search.js index cea4eca66..4d7b001bb 100644 --- a/PlexRequests.UI/Content/search.js +++ b/PlexRequests.UI/Content/search.js @@ -7,6 +7,8 @@ var searchSource = $("#search-template").html(); var searchTemplate = Handlebars.compile(searchSource); +var noResultsHtml = "
" + + "
Sorry, we didn't find any results!
"; var movieTimer = 0; var tvimer = 0; @@ -124,6 +126,9 @@ function movieSearch() { $("#movieList").append(html); }); } + else { + $("#movieList").html(noResultsHtml); + } $('#movieSearchButton').attr("class","fa fa-search"); }); }; @@ -140,6 +145,9 @@ function tvSearch() { $("#tvList").append(html); }); } + else { + $("#tvList").html(noResultsHtml); + } $('#tvSearchButton').attr("class", "fa fa-search"); }); }; diff --git a/PlexRequests.UI/Views/Search/Index.cshtml b/PlexRequests.UI/Views/Search/Index.cshtml index 4356c069a..5006a58c2 100644 --- a/PlexRequests.UI/Views/Search/Index.cshtml +++ b/PlexRequests.UI/Views/Search/Index.cshtml @@ -1,6 +1,7 @@ 

Search

Want to watch something that is not currently on Plex?! No problem! Just search for it below and request it!

+
-