summaryrefslogtreecommitdiffstats
path: root/install/ui/field.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-07-09 16:58:00 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-07-10 13:30:38 +0200
commit848bd0e9e738a4590049a223868dcfe6749a9154 (patch)
tree8539184b9e3d9655d953980b12487db68ea16253 /install/ui/field.js
parent05cf7c53a69b7c999ac68c2869db924e2dccc3a0 (diff)
downloadfreeipa-848bd0e9e738a4590049a223868dcfe6749a9154.tar.gz
freeipa-848bd0e9e738a4590049a223868dcfe6749a9154.tar.xz
freeipa-848bd0e9e738a4590049a223868dcfe6749a9154.zip
Password policy measurement units.
When filling password policy it may be unclear what value to enter because user may not remember field's measurement unit. This patch adds support for declaring measurement units. It's done in field's/widget's spec by entering key for unit's string (which is in IPA.messages.measurement_units[key]). Measurement units in table layout are displayed in parenthesis after label. It is to be consistent with some fields which have measurement unit integrated in label. This patch defines measurement units for password policy's 'History size', 'Failure reset interval' and 'Lockout duration' fields. https://fedorahosted.org/freeipa/ticket/2437
Diffstat (limited to 'install/ui/field.js')
-rw-r--r--install/ui/field.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/install/ui/field.js b/install/ui/field.js
index 84ec0c4df..fb292ff2a 100644
--- a/install/ui/field.js
+++ b/install/ui/field.js
@@ -35,6 +35,7 @@ IPA.field = function(spec) {
that.param = spec.param || spec.name;
that.label = spec.label;
that.tooltip = spec.tooltip;
+ that.measurement_unit = spec.measurement_unit;
that.formatter = spec.formatter;
that.widget = null;
@@ -348,8 +349,9 @@ IPA.field = function(spec) {
that.set_widget_flags = function() {
if (that.widget) {
- if(that.label) that.widget.label = that.label;
- if(that.title) that.widget.title = that.title;
+ if (that.label) that.widget.label = that.label;
+ if (that.title) that.widget.title = that.title;
+ if (that.measurement_unit) that.widget.measurement_unit = that.measurement_unit;
that.widget.undo = that.undo;
that.widget.writable = that.writable;
that.widget.read_only = that.read_only;