diff options
author | Struan Donald <struan@exo.org.uk> | 2013-04-12 13:30:40 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-04-12 15:18:37 +0100 |
commit | 2fd6bf06985be340c0874f0f98a5ee769b9e2f9d (patch) | |
tree | eaa000c23b021ece3d56b4b1ca594019a8e22b34 /www/js | |
parent | 82e9a55192524f8f30725acb83e2a1c21a19f55f (diff) |
quick list of current draft reports
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/reports.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/www/js/views/reports.js b/www/js/views/reports.js index 3ad2c01..33b1a7a 100644 --- a/www/js/views/reports.js +++ b/www/js/views/reports.js @@ -3,7 +3,22 @@ ReportsView: FMS.FMSView.extend({ template: 'reports', id: 'reports', - next: 'home' + next: 'home', + + render: function(){ + if ( !this.template ) { + console.log('no template to render'); + return; + } + template = _.template( tpl.get( this.template ) ); + if ( this.model ) { + this.$el.html(template({ model: this.model.toJSON(), drafts: FMS.allDrafts })); + } else { + this.$el.html(template()); + } + this.afterRender(); + return this; + } }) }); })(FMS, Backbone, _, $); |