hmpo-template-mixins
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -116,8 +116,17 @@ 'use strict'; | ||
function optionGroup(key) { | ||
var legendClassName = fields[key] && fields[key].legend; | ||
if (legendClassName) { legendClassName = classNameString(legendClassName.className); } | ||
var legend = fields[key] && fields[key].legend; | ||
var legendClassName; | ||
var legendValue = 'fields.' + key + '.legend'; | ||
if (legend) { | ||
if (legend.className) { | ||
legendClassName = classNameString(legend.className); | ||
} | ||
if (typeof legend.value !== 'undefined') { | ||
legendValue = legend.value; | ||
} | ||
} | ||
return { | ||
'key': key, | ||
'error': this.errors && this.errors[key], | ||
'legend': fields[key] && fields[key].legend && fields[key].legend.value || t('fields.' + key + '.legend'), | ||
'legend': t(legendValue), | ||
'legendClassName': legendClassName, | ||
@@ -124,0 +133,0 @@ hint: conditionaltranslate('fields.' + key + '.hint'), |
{ | ||
"name": "hmpo-template-mixins", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "A middleware that exposes a series of Mustache mixins on res.locals to ease usage of forms, translations, and some general needs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
54801
1026