2014-04-04 09:28:33 +00:00
|
|
|
define(function (require) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
|
_ = require('underscore'),
|
|
|
|
Backbone = require('backbone'),
|
|
|
|
Marionette = require('marionette'),
|
2014-04-04 12:52:01 +00:00
|
|
|
ListItemView = require('app/views/missions/list_item'),
|
2014-04-05 14:50:40 +00:00
|
|
|
FormView = require('app/views/missions/form'),
|
2014-04-04 12:52:01 +00:00
|
|
|
tpl = require('text!tpl/missions/list.html'),
|
|
|
|
|
|
|
|
template = _.template(tpl);
|
2014-04-04 09:28:33 +00:00
|
|
|
|
2014-04-04 12:52:01 +00:00
|
|
|
return Marionette.CompositeView.extend({
|
2014-04-04 09:28:33 +00:00
|
|
|
itemView: ListItemView,
|
2014-04-04 12:52:01 +00:00
|
|
|
itemViewContainer: "tbody",
|
|
|
|
template: template,
|
2014-04-05 14:50:40 +00:00
|
|
|
|
|
|
|
events: {
|
|
|
|
"click #upload": "upload"
|
|
|
|
},
|
|
|
|
|
|
|
|
upload: function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var view = new FormView({missions: this.collection});
|
|
|
|
new Backbone.BootstrapModal({ content: view }).open()
|
|
|
|
},
|
2014-04-04 09:28:33 +00:00
|
|
|
});
|
|
|
|
});
|