diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js index 5555c0f3886cf069c22b37124007b6cdb60e22b1..139de55f7691daad537da26834998f213d30f45f 100644 Binary files a/apps/workflowengine/js/workflowengine.js and b/apps/workflowengine/js/workflowengine.js differ diff --git a/apps/workflowengine/js/workflowengine.js.map b/apps/workflowengine/js/workflowengine.js.map index cbdbafd4bb33ac5ebab9d532299a3911db637579..045713abf7ddbb7ca29793f07a5e5ac78ad2ba57 100644 Binary files a/apps/workflowengine/js/workflowengine.js.map and b/apps/workflowengine/js/workflowengine.js.map differ diff --git a/apps/workflowengine/src/admin.js b/apps/workflowengine/src/admin.js index d986c5a494a657eb489b123710ece13c7dc9efcb..f4635fe5b8c60a075cb91c838a97779d13b6bd6a 100644 --- a/apps/workflowengine/src/admin.js +++ b/apps/workflowengine/src/admin.js @@ -18,6 +18,9 @@ * */ +import OperationTemplate from './templates/operation.handlebars'; +import OperationsTemplate from './templates/operations.handlebars'; + (function() { Handlebars.registerHelper('selectItem', function(currentValue, itemValue) { if (currentValue === itemValue) { @@ -134,7 +137,7 @@ saving: false, groups: [], template: function(vars) { - return OCA.WorkflowEngine.Templates['operation'](_.extend( + return OperationTemplate(_.extend( { shortRuleDescTXT: t('workflowengine', 'Short rule description'), addRuleTXT: t('workflowengine', 'Add rule'), @@ -357,7 +360,7 @@ 'click .button-add-operation': 'add' }, template: function(vars) { - return OCA.WorkflowEngine.Templates['operations'](_.extend( + return OperationsTemplate(_.extend( { addRuleGroupTXT: t('workflowengine', 'Add rule group') }, diff --git a/apps/workflowengine/src/templates.js b/apps/workflowengine/src/templates.js deleted file mode 100644 index 157d396357d426fc1625335553735012205b2052..0000000000000000000000000000000000000000 --- a/apps/workflowengine/src/templates.js +++ /dev/null @@ -1,109 +0,0 @@ -(function() { - var template = Handlebars.template, templates = OCA.WorkflowEngine.Templates = OCA.WorkflowEngine.Templates || {}; -templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) { - return " modified"; -},"3":function(container,depth0,helpers,partials,data) { - return " <span class=\"button-delete icon-delete\"></span>\n"; -},"5":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return " <div class=\"check\" data-id=\"" - + alias4(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data}) : helper))) - + "\">\n <select class=\"check-class\">\n" - + ((stack1 = helpers.each.call(alias1,(depths[1] != null ? depths[1].classes : depths[1]),{"name":"each","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " </select>\n <select class=\"check-operator\">\n" - + ((stack1 = helpers.each.call(alias1,(helpers.getOperators || (depth0 && depth0.getOperators) || alias2).call(alias1,(depth0 != null ? depth0["class"] : depth0),{"name":"getOperators","hash":{},"data":data}),{"name":"each","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " </select>\n <input type=\"text\" class=\"check-value\" value=\"" - + alias4(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"value","hash":{},"data":data}) : helper))) - + "\">\n <span class=\"button-delete-check icon-delete\"></span>\n </div>\n"; -},"6":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return " <option value=\"" - + alias4(((helper = (helper = helpers["class"] || (depth0 != null ? depth0["class"] : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"class","hash":{},"data":data}) : helper))) - + "\" " - + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0["class"] : depth0),(depths[1] != null ? depths[1]["class"] : depths[1]),{"name":"selectItem","hash":{},"data":data})) != null ? stack1 : "") - + ">" - + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) - + "</option>\n"; -},"8":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return " <option value=\"" - + alias4(((helper = (helper = helpers.operator || (depth0 != null ? depth0.operator : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"operator","hash":{},"data":data}) : helper))) - + "\" " - + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0.operator : depth0),(depths[1] != null ? depths[1].operator : depths[1]),{"name":"selectItem","hash":{},"data":data})) != null ? stack1 : "") - + ">" - + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) - + "</option>\n"; -},"10":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " <button class=\"button-save pull-right\">" - + container.escapeExpression(((helper = (helper = helpers.saveTXT || (depth0 != null ? depth0.saveTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"saveTXT","hash":{},"data":data}) : helper))) - + "</button>\n"; -},"11":function(container,depth0,helpers,partials,data) { - var helper; - - return " <button class=\"button-reset pull-right\">" - + container.escapeExpression(((helper = (helper = helpers.resetTXT || (depth0 != null ? depth0.resetTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"resetTXT","hash":{},"data":data}) : helper))) - + "</button>\n"; -},"13":function(container,depth0,helpers,partials,data) { - var helper; - - return " <span class=\"icon-loading-small pull-right\"></span>\n <span class=\"pull-right\">" - + container.escapeExpression(((helper = (helper = helpers.savingTXT || (depth0 != null ? depth0.savingTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"savingTXT","hash":{},"data":data}) : helper))) - + "</span>\n "; -},"15":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.message : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"16":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return "\n <span class=\"msg pull-right " - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.program(19, data, 0),"data":data})) != null ? stack1 : "") - + "\">\n " - + container.escapeExpression(((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"message","hash":{},"data":data}) : helper))) - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{"name":"if","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\n </span>\n "; -},"17":function(container,depth0,helpers,partials,data) { - return "error"; -},"19":function(container,depth0,helpers,partials,data) { - return "success"; -},"21":function(container,depth0,helpers,partials,data) { - var helper; - - return " " - + container.escapeExpression(((helper = (helper = helpers.errorMessage || (depth0 != null ? depth0.errorMessage : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"errorMessage","hash":{},"data":data}) : helper))); -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda; - - return "<div class=\"operation" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\">\n <div class=\"operation-header\">\n <input type=\"text\" class=\"operation-name\" placeholder=\"" - + alias4(((helper = (helper = helpers.shortRuleDescTXT || (depth0 != null ? depth0.shortRuleDescTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shortRuleDescTXT","hash":{},"data":data}) : helper))) - + "\" value=\"" - + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.name : stack1), depth0)) - + "\" />\n <input type=\"text\" class=\"operation-operation\" value=\"" - + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.operation : stack1), depth0)) - + "\" />\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " </div>\n\n <div class=\"checks\">\n" - + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.checks : stack1),{"name":"each","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " </div>\n <button class=\"button-add\">" - + alias4(((helper = (helper = helpers.addRuleTXT || (depth0 != null ? depth0.addRuleTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addRuleTXT","hash":{},"data":data}) : helper))) - + "</button>\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.saving : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0, blockParams, depths),"inverse":container.program(15, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "") - + "\n</div>\n"; -},"useData":true,"useDepths":true}); -templates['operations'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper; - - return "<div class=\"operations\"></div>\n<button class=\"button-add-operation\">" - + container.escapeExpression(((helper = (helper = helpers.addRuleGroupTXT || (depth0 != null ? depth0.addRuleGroupTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"addRuleGroupTXT","hash":{},"data":data}) : helper))) - + "</button>\n"; -},"useData":true}); -})(); \ No newline at end of file diff --git a/apps/workflowengine/src/workflowengine.js b/apps/workflowengine/src/workflowengine.js index 48d670d203c0486da305e32a5e873f23392c0042..207d2311bccb5a9482ecde93ce1ed560ebd9a2df 100644 --- a/apps/workflowengine/src/workflowengine.js +++ b/apps/workflowengine/src/workflowengine.js @@ -1,5 +1,4 @@ import './admin' -import './templates' import './filemimetypeplugin' import './filenameplugin' import './filesizeplugin' diff --git a/apps/workflowengine/webpack.js b/apps/workflowengine/webpack.js index c35a63d4d5b0edcc9c1887c98bb36b23a13eb164..c85aef591d8113825d865ec2903b304f7c26a1e1 100644 --- a/apps/workflowengine/webpack.js +++ b/apps/workflowengine/webpack.js @@ -28,6 +28,10 @@ module.exports = { options: { name: '[name].[ext]?[hash]' } + }, + { + test: /\.handlebars$/, + loader: "handlebars-loader" } ] }, diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh index f1356f8f41eda94978d5eed0753dce05e68b84b7..9aecc405a78de77654728e88347a421a6da4091a 100755 --- a/build/compile-handlebars-templates.sh +++ b/build/compile-handlebars-templates.sh @@ -16,9 +16,6 @@ handlebars -n OC.Share.Templates core/js/share -f core/js/sharetemplates.js # Files app handlebars -n OCA.Files.Templates apps/files/js/templates -f apps/files/js/templates.js -# Workflowengine -handlebars -n OCA.WorkflowEngine.Templates apps/workflowengine/src/templates -f apps/workflowengine/src/templates.js - # Sharing handlebars -n OCA.Sharing.Templates apps/files_sharing/js/templates -f apps/files_sharing/js/templates.js