diff --git a/static/js/templates.js b/static/js/templates.js index 1633039e09..b000bb90f7 100644 --- a/static/js/templates.js +++ b/static/js/templates.js @@ -75,6 +75,15 @@ Handlebars.registerHelper('unless_a_not_b', function () { return options.fn(this); }); +Handlebars.registerHelper('if_equal', function () { + // Execute conditional code if both values are equal + var options = arguments[arguments.length - 1]; + if (arguments[0] === arguments[1]) { + return options.fn(this); + } + return options.inverse(this); +}); + Handlebars.registerHelper('if_not_a_or_b_and_not_c', function () { var options = arguments[arguments.length - 1]; if (arguments[0] === false || arguments[1] === true && arguments[2] === false) {