diff --git a/services/web/app/coffee/infrastructure/Modules.coffee b/services/web/app/coffee/infrastructure/Modules.coffee index 2df8907f7e..0dfbf3fa22 100644 --- a/services/web/app/coffee/infrastructure/Modules.coffee +++ b/services/web/app/coffee/infrastructure/Modules.coffee @@ -25,14 +25,14 @@ module.exports = Modules = for module in @modules for view, partial of module.viewIncludes or {} @viewIncludes[view] ||= [] - @viewIncludes[view].push fs.readFileSync(Path.join(MODULE_BASE_PATH, module.name, "app/views", partial + ".jade")) + @viewIncludes[view].push jade.compile(fs.readFileSync(Path.join(MODULE_BASE_PATH, module.name, "app/views", partial + ".jade")), doctype: "html") moduleIncludes: (view, locals) -> - partials = Modules.viewIncludes[view] or [] + compiledPartials = Modules.viewIncludes[view] or [] html = "" - for partial in partials - compiler = jade.compile(partial, doctype: "html") - html += compiler(locals) + for compiledPartial in compiledPartials + d = new Date() + html += compiledPartial(locals) return html moduleIncludesAvailable: (view) ->