templates: Add `is_false` handlebars helper.

There is need for such a helper because `unless` executes to be true even
when we haven't passed the context variable on which we are checking the
conditional statement.
This commit is contained in:
Shubham Dhama 2018-09-02 13:08:09 +05:30 committed by Tim Abbott
parent 0292ffe04b
commit d1c62369b7
1 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,13 @@ Handlebars.registerHelper('if_or', function () {
return options.inverse(this); return options.inverse(this);
}); });
Handlebars.registerHelper('is_false', function (variable, options) {
if (variable === false) {
return options.fn(this);
}
return options.inverse(this);
});
Handlebars.registerHelper('t', function (i18n_key) { Handlebars.registerHelper('t', function (i18n_key) {
// Marks a string for translation. // Marks a string for translation.
// Example usage: // Example usage: