From b2496b6fec3788b087b8c304e90b762c0d08c99c Mon Sep 17 00:00:00 2001 From: dreptin Date: Fri, 1 Oct 2021 13:28:33 +0200 Subject: [PATCH] feat(handlebars): added a new ifEquals helper --- js/controllers/results.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/controllers/results.js b/js/controllers/results.js index 4f6a3d3..698fbde 100644 --- a/js/controllers/results.js +++ b/js/controllers/results.js @@ -332,6 +332,8 @@ function addHandlebarsFunctions(handlebars, config) { return "Recherchées via GROBID"; } }); + + handlebars.registerHelper('ifEquals', (v1, v2, options) => (v1 === v2) ? options.fn(this) : options.inverse(this)); } function generateTermsFacet(facetName, keys, tag, nbTag, data, handlebars) {