summaryrefslogtreecommitdiffstats
path: root/install/ui/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r--install/ui/widget.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index a55cc347..64547da7 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -36,6 +36,7 @@ IPA.widget = function(spec) {
that.id = spec.id;
that.label = spec.label;
that.tooltip = spec.tooltip;
+ that.measurement_unit = spec.measurement_unit;
that.entity = IPA.get_entity(spec.entity); //some old widgets still need it
that.facet = spec.facet;
@@ -2688,10 +2689,12 @@ IPA.table_layout = function(spec) {
title: widget.label
}).appendTo(tr);
+ var label_text = widget.label + that.get_measurement_unit_text(widget) + ':';
+
$('<label/>', {
name: widget.name,
'class': that.label_class,
- text: widget.label+':'
+ text: label_text
}).appendTo(td);
if(widget.create_required) {
@@ -2713,6 +2716,16 @@ IPA.table_layout = function(spec) {
return table;
};
+
+ that.get_measurement_unit_text = function(widget) {
+
+ if (widget.measurement_unit) {
+ var unit = IPA.messages.measurement_units[widget.measurement_unit];
+ return ' (' + unit + ')';
+ }
+ return '';
+ };
+
return that;
};