diff --git a/src/UI/Episode/Search/EpisodeSearchLayout.js b/src/UI/Episode/Search/EpisodeSearchLayout.js index 20767ebd1..a5d400625 100644 --- a/src/UI/Episode/Search/EpisodeSearchLayout.js +++ b/src/UI/Episode/Search/EpisodeSearchLayout.js @@ -8,8 +8,9 @@ define( 'Release/ReleaseCollection', 'Series/SeriesCollection', 'Commands/CommandController', - 'Shared/LoadingView' - ], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView) { + 'Shared/LoadingView', + 'Episode/Search/NoResultsView' + ], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView, NoResultsView) { return Marionette.Layout.extend({ template: 'Episode/Search/EpisodeSearchLayoutTemplate', @@ -73,7 +74,14 @@ define( }, _showSearchResults: function () { - this.mainView = new ManualSearchLayout({ collection: this.releaseCollection }); + if (this.releaseCollection.length === 0) { + this.mainView = new NoResultsView(); + } + + else { + this.mainView = new ManualSearchLayout({ collection: this.releaseCollection }); + } + this._showMainView(); } }); diff --git a/src/UI/Episode/Search/NoResultsView.js b/src/UI/Episode/Search/NoResultsView.js new file mode 100644 index 000000000..54d868438 --- /dev/null +++ b/src/UI/Episode/Search/NoResultsView.js @@ -0,0 +1,10 @@ +'use strict'; + +define( + [ + 'marionette' + ], function (Marionette) { + return Marionette.ItemView.extend({ + template: 'Episode/Search/NoResultsViewTemplate' + }); + }); diff --git a/src/UI/Episode/Search/NoResultsViewTemplate.html b/src/UI/Episode/Search/NoResultsViewTemplate.html new file mode 100644 index 000000000..87201af05 --- /dev/null +++ b/src/UI/Episode/Search/NoResultsViewTemplate.html @@ -0,0 +1 @@ +
No results found
\ No newline at end of file