From d06cd5f0644754cbf6703d5a36dfe31747ecb950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Fri, 4 Apr 2014 12:52:01 +0000 Subject: [PATCH] Better missions listing --- public/js/app/views/missions/list.js | 10 +++++++--- public/js/app/views/missions/list_item.js | 2 +- public/js/tpl/missions/list.html | 10 ++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 public/js/tpl/missions/list.html diff --git a/public/js/app/views/missions/list.js b/public/js/app/views/missions/list.js index e40f0da..ce54565 100644 --- a/public/js/app/views/missions/list.js +++ b/public/js/app/views/missions/list.js @@ -6,10 +6,14 @@ define(function (require) { _ = require('underscore'), Backbone = require('backbone'), Marionette = require('marionette'), - ListItemView = require('app/views/missions/list_item'); + ListItemView = require('app/views/missions/list_item'), + tpl = require('text!tpl/missions/list.html'), + + template = _.template(tpl); - return Marionette.CollectionView.extend({ - tagName: 'ul', + return Marionette.CompositeView.extend({ itemView: ListItemView, + itemViewContainer: "tbody", + template: template, }); }); diff --git a/public/js/app/views/missions/list_item.js b/public/js/app/views/missions/list_item.js index df50be1..c3d5ffc 100644 --- a/public/js/app/views/missions/list_item.js +++ b/public/js/app/views/missions/list_item.js @@ -11,7 +11,7 @@ define(function (require) { template = _.template(tpl); return Marionette.ItemView.extend({ - tagName: "li", + tagName: "td", template: template }); }); diff --git a/public/js/tpl/missions/list.html b/public/js/tpl/missions/list.html new file mode 100644 index 0000000..65a01d1 --- /dev/null +++ b/public/js/tpl/missions/list.html @@ -0,0 +1,10 @@ + + + + + + + + + +
Mission
\ No newline at end of file