From db24a831d415856e678c9153452cddaca3b311ca Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 4 Apr 2012 10:49:16 +0200 Subject: DNS forward policy: checkboxes changed to radio buttons DNS forward policy fields were using mutually exclusive checkboxes. Such behavior is unusual for users. Checkboxes were changed to radios. https://fedorahosted.org/freeipa/ticket/2599 --- install/ui/dns.js | 30 ++++++++++++++++++++++++------ install/ui/ipa.js | 21 +++++++++++++-------- install/ui/test/data/ipa_init.json | 2 ++ 3 files changed, 39 insertions(+), 14 deletions(-) (limited to 'install') diff --git a/install/ui/dns.js b/install/ui/dns.js index 6a684b9ea..0d7f03f20 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -52,10 +52,19 @@ IPA.dns.config_entity = function(spec) { validators: [IPA.dnsforwarder_validator()] }, { - type: 'checkboxes', + type: 'radio', name: 'idnsforwardpolicy', - mutex: true, - options: IPA.create_options(['only', 'first']) + default_value: 'first', + options: [ + { + value: 'first', + label: IPA.messages.objects.dnsconfig.forward_first + }, + { + value: 'only', + label: IPA.messages.objects.dnsconfig.forward_only + } + ] }, 'idnszonerefresh' ] @@ -170,10 +179,19 @@ IPA.dns.zone_entity = function(spec) { validators: [IPA.dnsforwarder_validator()] }, { - type: 'checkboxes', + type: 'radio', name: 'idnsforwardpolicy', - mutex: true, - options: IPA.create_options(['only', 'first']) + default_value: 'first', + options: [ + { + value: 'first', + label: IPA.messages.objects.dnsconfig.forward_first + }, + { + value: 'only', + label: IPA.messages.objects.dnsconfig.forward_only + } + ] }, { type: 'checkbox', diff --git a/install/ui/ipa.js b/install/ui/ipa.js index be8748101..eeac03053 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -1516,17 +1516,22 @@ IPA.limit_text = function(value, max_length) { return limited_text; }; -IPA.create_options = function(labels, values) { - - if(!values) values = labels; +IPA.create_options = function(values) { var options = []; - for (var i=0; i