diff --git a/src/UI/Episode/Activity/EpisodeActivityLayout.js b/src/UI/Episode/Activity/EpisodeActivityLayout.js index 646a560dd..ccfb3f128 100644 --- a/src/UI/Episode/Activity/EpisodeActivityLayout.js +++ b/src/UI/Episode/Activity/EpisodeActivityLayout.js @@ -8,8 +8,9 @@ define( 'Cells/EventTypeCell', 'Cells/QualityCell', 'Cells/RelativeDateCell', + 'Episode/Activity/NoActivityView', 'Shared/LoadingView' - ], function (App, Marionette, Backgrid, HistoryCollection, EventTypeCell, QualityCell, RelativeDateCell, LoadingView) { + ], function (App, Marionette, Backgrid, HistoryCollection, EventTypeCell, QualityCell, RelativeDateCell, NoActivityView, LoadingView) { return Marionette.Layout.extend({ template: 'Episode/Activity/EpisodeActivityLayoutTemplate', @@ -57,11 +58,17 @@ define( }, _showTable: function () { - this.activityTable.show(new Backgrid.Grid({ - collection: this.collection, - columns : this.columns, - className : 'table table-hover table-condensed' - })); + if (this.collection.any()) { + this.activityTable.show(new Backgrid.Grid({ + collection: this.collection, + columns : this.columns, + className : 'table table-hover table-condensed' + })); + } + + else { + this.activityTable.show(new NoActivityView()); + } } }); }); diff --git a/src/UI/Episode/Activity/NoActivityView.js b/src/UI/Episode/Activity/NoActivityView.js new file mode 100644 index 000000000..863e09cf0 --- /dev/null +++ b/src/UI/Episode/Activity/NoActivityView.js @@ -0,0 +1,11 @@ +'use strict'; +define( + [ + 'marionette' + ], function (Marionette) { + + return Marionette.ItemView.extend({ + template: 'Episode/Activity/NoActivityViewTemplate' + }); + + }); diff --git a/src/UI/Episode/Activity/NoActivityViewTemplate.html b/src/UI/Episode/Activity/NoActivityViewTemplate.html new file mode 100644 index 000000000..ea9d127af --- /dev/null +++ b/src/UI/Episode/Activity/NoActivityViewTemplate.html @@ -0,0 +1,3 @@ +
+ No activity for this episode. +
\ No newline at end of file