From f4a15f7f422c7d449a9cfb2ee8bc1ba76d52b41d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 28 Sep 2018 21:00:23 +0200 Subject: [PATCH 1/3] Add script to compile handlebars templates For now it is small and there is no real standard yet. But it is better to start with something. Signed-off-by: Roeland Jago Douma --- build/compile-handlebars-templates.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 build/compile-handlebars-templates.sh diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh new file mode 100644 index 0000000000..1775f45b0f --- /dev/null +++ b/build/compile-handlebars-templates.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +REPODIR=`git rev-parse --show-toplevel` + +cd $REPODIR + +# Settings +handlebars -n OC.Settings.Templates settings/js/authtoken.handlebars -f settings/js/templates.js + +# Contactsmenu +handlebars -n OC.ContactsMenu.Templates core/js/contactsmenu -f core/js/contactsmenu_templates.js + +# Files app +handlebars -n OCA.Files.FileSummary.Templates apps/files/js/filesummary.handlebars -f apps/files/js/filesummary_template.js + +if [[ $(git diff --name-only) ]]; then + echo "Please submit your compiled handlebars templates" + exit 1 +fi + +exit 0 From 4f13430a95b872f95cbd38bed4ee39d0d11abecf Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 28 Sep 2018 21:03:43 +0200 Subject: [PATCH 2/3] Add drone step Signed-off-by: Roeland Jago Douma --- .drone.yml | 9 +++++++++ build/compile-handlebars-templates.sh | 4 ++++ 2 files changed, 13 insertions(+) mode change 100644 => 100755 build/compile-handlebars-templates.sh diff --git a/.drone.yml b/.drone.yml index 5228d4e656..0e87b97469 100644 --- a/.drone.yml +++ b/.drone.yml @@ -57,6 +57,14 @@ pipeline: when: matrix: TESTS: checkers + handlebars: + image: node + commands: + - npm install handlebars -g + - ./build/compile-handlebars-templates.sh + when: + matrix: + TESTS: handlebars syntax-php7.0: image: nextcloudci/php7.0:php7.0-19 commands: @@ -774,6 +782,7 @@ matrix: - TESTS: vue-build-oauth2 - TESTS: vue-build-accessibility - TESTS: vue-build-backupcodes + - TESTS: handlebars - TESTS: nodb-codecov ENABLE_REDIS: true - TESTS: db-codecov diff --git a/build/compile-handlebars-templates.sh b/build/compile-handlebars-templates.sh old mode 100644 new mode 100755 index 1775f45b0f..80e2e661f4 --- a/build/compile-handlebars-templates.sh +++ b/build/compile-handlebars-templates.sh @@ -15,7 +15,11 @@ handlebars -n OCA.Files.FileSummary.Templates apps/files/js/filesummary.handleba if [[ $(git diff --name-only) ]]; then echo "Please submit your compiled handlebars templates" + echo + git diff exit 1 fi + +echo "All up to date! Carry on :D" exit 0 From 7e5b7f75ba05b45396a457577e5d601d0fc8e07f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 28 Sep 2018 21:15:30 +0200 Subject: [PATCH 3/3] Bump templates to handlebars 4.0.12 Signed-off-by: Roeland Jago Douma --- apps/files/js/filesummary_template.js | 2 +- core/js/contactsmenu_templates.js | 50 +++++++++++++-------------- settings/js/templates.js | 28 +++++++-------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/apps/files/js/filesummary_template.js b/apps/files/js/filesummary_template.js index c535c43cae..67a4d6b4e8 100644 --- a/apps/files/js/filesummary_template.js +++ b/apps/files/js/filesummary_template.js @@ -4,7 +4,7 @@ templates['filesummary'] = template({"compiler":[7,">= 4.0.0"],"main":function(c var helper; return "\n \n " - + container.escapeExpression(((helper = (helper = helpers.connectorLabel || (depth0 != null ? depth0.connectorLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"connectorLabel","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.connectorLabel || (depth0 != null ? depth0.connectorLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"connectorLabel","hash":{},"data":data}) : helper))) + "\n \n \n \n\n"; },"useData":true}); })(); \ No newline at end of file diff --git a/core/js/contactsmenu_templates.js b/core/js/contactsmenu_templates.js index 8e30b21cb2..973d93a74f 100644 --- a/core/js/contactsmenu_templates.js +++ b/core/js/contactsmenu_templates.js @@ -42,76 +42,76 @@ templates['contact'] = template({"1":function(container,depth0,helpers,partials, var stack1; return " \n
\n
    \n" - + ((stack1 = helpers.each.call(depth0,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.actions : stack1),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.actions : stack1),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
\n
\n"; },"10":function(container,depth0,helpers,partials,data) { - var helper, alias1=helpers.helperMissing, alias2="function", alias3=container.escapeExpression; + var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "
  • \n \n \"\"\n " - + alias3(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"title","hash":{},"data":data}) : helper))) + + alias4(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data}) : helper))) + "\n \n
  • \n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, alias1=container.lambda, alias2=container.escapeExpression; + var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.lambda, alias3=container.escapeExpression; - return ((stack1 = helpers["if"].call(depth0,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.avatar : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "") + return ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.avatar : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "") + "
    \n
    " - + alias2(alias1(((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.fullName : stack1), depth0)) + + alias3(alias2(((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.fullName : stack1), depth0)) + "
    \n
    " - + alias2(alias1(((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.lastMessage : stack1), depth0)) + + alias3(alias2(((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.lastMessage : stack1), depth0)) + "
    \n
    \n" - + ((stack1 = helpers["if"].call(depth0,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.topAction : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.hasTwoActions : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.hasManyActions : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); + + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.topAction : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.hasTwoActions : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.contact : depth0)) != null ? stack1.hasManyActions : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); },"useData":true}); templates['error'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper; return "
    \n
    \n

    " - + container.escapeExpression(((helper = (helper = helpers.couldNotLoadText || (depth0 != null ? depth0.couldNotLoadText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"couldNotLoadText","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.couldNotLoadText || (depth0 != null ? depth0.couldNotLoadText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"couldNotLoadText","hash":{},"data":data}) : helper))) + "

    \n
    \n"; },"useData":true}); templates['list'] = template({"1":function(container,depth0,helpers,partials,data) { var helper; return "
    \n
    \n

    " - + container.escapeExpression(((helper = (helper = helpers.noContactsFoundText || (depth0 != null ? depth0.noContactsFoundText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"noContactsFoundText","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.noContactsFoundText || (depth0 != null ? depth0.noContactsFoundText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"noContactsFoundText","hash":{},"data":data}) : helper))) + "

    \n
    \n"; },"3":function(container,depth0,helpers,partials,data) { - var helper, alias1=helpers.helperMissing, alias2="function", alias3=container.escapeExpression; + var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return ""; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; + var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - return ((stack1 = helpers.unless.call(depth0,((stack1 = (depth0 != null ? depth0.contacts : depth0)) != null ? stack1.length : stack1),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + return ((stack1 = helpers.unless.call(alias1,((stack1 = (depth0 != null ? depth0.contacts : depth0)) != null ? stack1.length : stack1),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
    \n" - + ((stack1 = helpers["if"].call(depth0,(depth0 != null ? depth0.contactsAppEnabled : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.contactsAppEnabled : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "\n"; },"useData":true}); templates['loading'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper; return "
    \n
    \n

    " - + container.escapeExpression(((helper = (helper = helpers.loadingText || (depth0 != null ? depth0.loadingText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"loadingText","hash":{},"data":data}) : helper))) + + container.escapeExpression(((helper = (helper = helpers.loadingText || (depth0 != null ? depth0.loadingText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"loadingText","hash":{},"data":data}) : helper))) + "

    \n
    \n"; },"useData":true}); templates['menu'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper, alias1=helpers.helperMissing, alias2="function", alias3=container.escapeExpression; + var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "\n\n
    \n
    \n"; },"useData":true}); })(); \ No newline at end of file diff --git a/settings/js/templates.js b/settings/js/templates.js index b45b788351..649f2e9596 100644 --- a/settings/js/templates.js +++ b/settings/js/templates.js @@ -3,39 +3,39 @@ templates['authtoken'] = template({"1":function(container,depth0,helpers,partials,data) { return ""; },"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=helpers.helperMissing, alias2="function", alias3=container.escapeExpression; + var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "
  • \n \n
    \n
  • \n"; },"4":function(container,depth0,helpers,partials,data) { return "checked"; },"6":function(container,depth0,helpers,partials,data) { return "
  • \n ' + t('settings', 'Revoke') +'\n
  • \n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=helpers.helperMissing, alias2="function", alias3=container.escapeExpression; + var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "\n \n
    \n \n \n " - + alias3(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"name","hash":{},"data":data}) : helper))) + + 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))) + "\n \n \n " - + alias3(((helper = (helper = helpers.lastActivity || (depth0 != null ? depth0.lastActivity : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"lastActivity","hash":{},"data":data}) : helper))) + + alias4(((helper = (helper = helpers.lastActivity || (depth0 != null ? depth0.lastActivity : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"lastActivity","hash":{},"data":data}) : helper))) + "\n \n " - + ((stack1 = helpers["if"].call(depth0,(depth0 != null ? depth0.showMore : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showMore : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "\n
    \n" - + ((stack1 = helpers["if"].call(depth0,(depth0 != null ? depth0.canScope : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(depth0,(depth0 != null ? depth0.canDelete : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.canScope : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.canDelete : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
    \n \n\n"; },"useData":true}); })(); \ No newline at end of file