diff --git a/public/src/modules/helpers.common.js b/public/src/modules/helpers.common.js index 00b6a3fe74..07ab724963 100644 --- a/public/src/modules/helpers.common.js +++ b/public/src/modules/helpers.common.js @@ -97,15 +97,16 @@ module.exports = function (utils, Benchpress, relative_path) { return `${category.icon ? `` : ''}`; } - function buildCategoryLabel(category, className = '') { + function buildCategoryLabel(category, tag = 'a', className = '') { if (!category) { return ''; } - return ` + const href = tag === 'a' ? `href="${relative_path}/category/${category.slug}"` : ''; + return `<${tag} ${href} class="badge px-1 text-truncate text-decoration-none ${className}" style="color: ${category.color};background-color: ${category.bgColor};border-color: ${category.bgColor}!important; max-width: 70vw;"> ${category.icon && category.icon !== 'fa-nbb-none' ? `` : ''} ${category.name} - `; + `; } function generateCategoryBackground(category) {