summaryrefslogtreecommitdiffstats
path: root/web/js/labitrack.d/31-handlebars-helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/labitrack.d/31-handlebars-helpers.js')
-rw-r--r--web/js/labitrack.d/31-handlebars-helpers.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/js/labitrack.d/31-handlebars-helpers.js b/web/js/labitrack.d/31-handlebars-helpers.js
new file mode 100644
index 0000000..6fa462a
--- /dev/null
+++ b/web/js/labitrack.d/31-handlebars-helpers.js
@@ -0,0 +1,17 @@
+(function(){
+ Handlebars.registerHelper('labelform', function(){
+ return new Handlebars.SafeString(λ.template('labelform', this));
+ });
+ Handlebars.registerHelper('pagination', function(){
+ return new Handlebars.SafeString(λ.template('pagination', this));
+ });
+ Handlebars.registerHelper('dump_ctx', function(){
+ console.log({'ctx': this});
+ });
+ Handlebars.registerHelper('checked_tag', function(tags){
+ if (!$.isArray(tags)) return;
+ if (tags.indexOf(this.name) !== -1) {
+ return new Handlebars.SafeString(' checked="checked"');
+ }
+ });
+}());