2013-06-22 08:24:24 +02:00
|
|
|
'use strict';
|
2013-06-25 01:41:59 +02:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'marionette',
|
|
|
|
'Calendar/UpcomingCollection',
|
|
|
|
'Calendar/UpcomingCollectionView',
|
|
|
|
'Calendar/CalendarView',
|
|
|
|
], function (Marionette, UpcomingCollection, UpcomingCollectionView, CalendarView) {
|
|
|
|
return Marionette.Layout.extend({
|
2013-06-07 07:33:01 +02:00
|
|
|
template: 'Calendar/CalendarLayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
upcoming: '#x-upcoming',
|
|
|
|
calendar: '#x-calendar'
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function () {
|
2013-06-25 01:41:59 +02:00
|
|
|
this.upcomingCollection = new UpcomingCollection();
|
2013-06-07 07:33:01 +02:00
|
|
|
this.upcomingCollection.fetch();
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
this._showUpcoming();
|
|
|
|
this._showCalendar();
|
|
|
|
},
|
|
|
|
|
|
|
|
_showUpcoming: function () {
|
2013-06-25 01:41:59 +02:00
|
|
|
this.upcoming.show(new UpcomingCollectionView({
|
2013-06-07 07:33:01 +02:00
|
|
|
collection: this.upcomingCollection
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
_showCalendar: function () {
|
2013-06-25 01:41:59 +02:00
|
|
|
this.calendar.show(new CalendarView());
|
2013-06-07 07:33:01 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|