3 var compileTemplate = require('./compile-web-template');
4 var prerenderWrapper = require('./prerender-wrapper');
6 var PRERENDERED_VIEWS = [
7 'js/views/archive/tmpl/archive-navigation-view',
8 'js/views/app/tmpl/headerViewTemplate',
9 'js/views/app/tmpl/headerViewTemplate',
10 'js/views/chat/tmpl/chatInputView',
11 'js/views/chat/tmpl/chat-input-box',
12 'js/views/chat/tmpl/chat-input-buttons',
13 'js/views/chat/tmpl/join-room-view',
14 'js/views/people/tmpl/peopleCollectionView',
15 'js/views/explore/tmpl/explore-view',
16 'js/views/org-directory/org-directory-header-view'
19 ].reduce(function(memo, v) {
20 memo[v] = compileTemplate(v + '.hbs');
24 module.exports = exports = function(templateFile, options) {
25 var hash = options.hash;
27 var template = PRERENDERED_VIEWS[templateFile];
28 if (!template) throw new Error('Template ' + templateFile + ' has not been precompiled.');
30 //assign the desktop prop here so it can be passed
31 //down to the child template
33 this.desktop = hash.desktop;
35 var inner = template(this);
37 if (!wrap) return inner;
39 var className = hash.className;
41 var dataId = hash.dataId && this.id;
43 return prerenderWrapper({