1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-16 21:15:33 -04:00

switched from grunt to gulp

This commit is contained in:
kayone
2014-08-28 14:40:18 -07:00
parent 5cfe2c0186
commit 4d23b2cac3
23 changed files with 861 additions and 561 deletions

View File

@@ -2,6 +2,7 @@
define(
[
'templates',
'handlebars',
'handlebars.helpers',
'Handlebars/Helpers/DateTime',
'Handlebars/Helpers/Html',
@@ -13,11 +14,10 @@ define(
'Handlebars/Helpers/EachReverse',
'Handlebars/Helpers/String',
'Handlebars/Handlebars.Debug'
], function (Templates) {
], function (Templates, Handlebars) {
return function () {
this.get = function (templateId) {
var templateKey = templateId.toLowerCase();
var templateKey = templateId.toLowerCase().replace('template', '');
var templateFunction = Templates[templateKey];
@@ -28,7 +28,8 @@ define(
return function (data) {
try {
return templateFunction(data);
var wrappedTemplate = Handlebars.template.call(Handlebars, templateFunction);
return wrappedTemplate(data);
}
catch (error) {
console.error('template render failed for ' + templateKey + ' ' + error);