mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Search facets show translated boolean values
Created format method for getting translated messages for boolean values - IPA.boolean_format. Used in hosts, sudo rules, hbac rules and hbac test. https://fedorahosted.org/freeipa/ticket/2027
This commit is contained in:
committed by
Endi S. Dewata
parent
c1d0f72c20
commit
0e8b57b089
@@ -902,6 +902,27 @@ IPA.textarea_widget = function (spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
IPA.boolean_format = function(value) {
|
||||
|
||||
if (value === undefined || value === null) return '';
|
||||
|
||||
if (value instanceof Array) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
var normalized_value = typeof value === 'string' ? value.toLowerCase() : '';
|
||||
|
||||
if (value === false || normalized_value === 'false') {
|
||||
return IPA.messages['false'];
|
||||
}
|
||||
|
||||
if (value === true || normalized_value === 'true') {
|
||||
return IPA.messages['true'];
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
/*
|
||||
The entity name must be set in the spec either directly or via entity.name
|
||||
*/
|
||||
|
Reference in New Issue
Block a user