@ -4,16 +4,16 @@ var HistoryCollection = require('../../Activity/History/HistoryCollection');
var EventTypeCell = require ( '../../Cells/EventTypeCell' ) ;
var QualityCell = require ( '../../Cells/QualityCell' ) ;
var RelativeDateCell = require ( '../../Cells/RelativeDateCell' ) ;
var Episode ActivityActionsCell = require ( './EpisodeActivit yActionsCell') ;
var Episode ActivityDetailsCell = require ( './EpisodeActivit yDetailsCell') ;
var No ActivityView = require ( './NoActivit yView') ;
var Episode HistoryActionsCell = require ( './EpisodeHistor yActionsCell') ;
var Episode HistoryDetailsCell = require ( './EpisodeHistor yDetailsCell') ;
var No HistoryView = require ( './NoHistor yView') ;
var LoadingView = require ( '../../Shared/LoadingView' ) ;
module . exports = Marionette . Layout . extend ( {
template : 'Episode/ Activity/EpisodeActivit yLayoutTemplate',
template : 'Episode/ History/EpisodeHistor yLayoutTemplate',
regions : {
activityTable : '.activit y-table'
historyTable : '.histor y-table'
} ,
columns : [
@ -41,13 +41,13 @@ module.exports = Marionette.Layout.extend({
{
name : 'this' ,
label : '' ,
cell : Episode Activit yDetailsCell,
cell : Episode Histor yDetailsCell,
sortable : false
} ,
{
name : 'this' ,
label : '' ,
cell : Episode Activit yActionsCell,
cell : Episode Histor yActionsCell,
sortable : false
}
] ,
@ -58,19 +58,19 @@ module.exports = Marionette.Layout.extend({
this . collection = new HistoryCollection ( {
episodeId : this . model . id ,
tableName : 'episode Activit y'
tableName : 'episode Histor y'
} ) ;
this . collection . fetch ( ) ;
this . listenTo ( this . collection , 'sync' , this . _showTable ) ;
} ,
onRender : function ( ) {
this . activit yTable. show ( new LoadingView ( ) ) ;
this . histor yTable. show ( new LoadingView ( ) ) ;
} ,
_showTable : function ( ) {
if ( this . collection . any ( ) ) {
this . activit yTable. show ( new Backgrid . Grid ( {
this . histor yTable. show ( new Backgrid . Grid ( {
collection : this . collection ,
columns : this . columns ,
className : 'table table-hover table-condensed'
@ -78,7 +78,7 @@ module.exports = Marionette.Layout.extend({
}
else {
this . activityTable. show ( new NoActivit yView( ) ) ;
this . historyTable. show ( new NoHistor yView( ) ) ;
}
}
} ) ;