hmpo-template-mixins
Advanced tools
Comparing version 0.1.12 to 0.1.13
@@ -81,2 +81,3 @@ 'use strict'; | ||
extension = extension || {}; | ||
var hint = i18nLookup(sharedTranslationsKey + 'fields.' + key + '.hint'); | ||
return _.extend(extension, { | ||
@@ -88,3 +89,4 @@ id: key, | ||
label: t(sharedTranslationsKey + 'fields.' + key + '.label'), | ||
hint: i18nLookup(sharedTranslationsKey + 'fields.' + key + '.hint'), | ||
hint: hint, | ||
hintId: extension.hintId || (hint ? key + '-hint' : null), | ||
error: this.errors && this.errors[key], | ||
@@ -163,8 +165,8 @@ maxlength: maxlength(key) || extension.maxlength, | ||
if (isExact) { | ||
dayPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-day', { pattern: '[0-9]*', min: 1, max: 31, maxlength: 2 })); | ||
dayPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-day', { pattern: '[0-9]*', min: 1, max: 31, maxlength: 2, hintId: key + '-hint' })); | ||
parts.push(dayPart); | ||
} | ||
monthPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-month', { pattern: '[0-9]*', min: 1, max: 12, maxlength: 2 })); | ||
yearPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-year', { pattern: '[0-9]*', maxlength: 4 })); | ||
monthPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-month', { pattern: '[0-9]*', min: 1, max: 12, maxlength: 2, hintId: key + '-hint' })); | ||
yearPart = compiled['partials/forms/input-text-group'].render(inputText.call(this, key + '-year', { pattern: '[0-9]*', maxlength: 4, hintId: key + '-hint' })); | ||
parts = parts.concat(monthPart, yearPart); | ||
@@ -171,0 +173,0 @@ |
{ | ||
"name": "hmpo-template-mixins", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"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", |
Sorry, the diff of this file is not supported yet
29875
538