From 3981e230c4249f2c637ade76010277f394b14962 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 11 Mar 2016 16:15:43 +0200 Subject: [PATCH] category children helper --- public/src/modules/helpers.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index cd5c27734d..bdc4176d52 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -100,6 +100,23 @@ return style.join('; ') + ';'; }; + helpers.generateChildrenCategories = function(category, relative_path) { + var html = ''; + category.children.forEach(function(child) { + if (!child) { + return; + } + var link = child.link ? child.link : ('/category/' + child.slug); + html += '' + + '' + + '' + + '' + + '' + child.name + ' '; + }); + html = html ? ('
' + html + '') : html; + return html; + }; + helpers.generateTopicClass = function(topic) { var style = []; @@ -244,7 +261,7 @@ } return icons; - } + }; exports.register = function() { var templates;