summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-05 09:59:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-05 09:59:17 +0000
commitb91cbcaa0382362688c59eb192bce46508956f7b (patch)
treebba9fe7728dac151139f3012673016f867a2e81b /app
parent0125ba14f6b0c7ff907c8bcadb1cfdf61ed9b157 (diff)
downloadredmine-b91cbcaa0382362688c59eb192bce46508956f7b.tar.gz
redmine-b91cbcaa0382362688c59eb192bce46508956f7b.zip
Option to render boolean custom fields as a single check box or radio buttons (#17003).
git-svn-id: http://svn.redmine.org/redmine/trunk@13216 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/custom_fields_helper.rb8
-rw-r--r--app/views/custom_fields/formats/_bool.html.erb2
2 files changed, 7 insertions, 3 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 173e0d5f8..5153c1489 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -138,7 +138,11 @@ module CustomFieldsHelper
end unless custom_values.empty?
end
- def edit_tag_style_tag(form)
- form.select :edit_tag_style, [[l(:label_drop_down_list), ''], [l(:label_checkboxes), 'check_box']], :label => :label_display
+ def edit_tag_style_tag(form, options={})
+ select_options = [[l(:label_drop_down_list), ''], [l(:label_checkboxes), 'check_box']]
+ if options[:include_radio]
+ select_options << [l(:label_radio_buttons), 'radio']
+ end
+ form.select :edit_tag_style, select_options, :label => :label_display
end
end
diff --git a/app/views/custom_fields/formats/_bool.html.erb b/app/views/custom_fields/formats/_bool.html.erb
index 81aa64afe..3b791acfe 100644
--- a/app/views/custom_fields/formats/_bool.html.erb
+++ b/app/views/custom_fields/formats/_bool.html.erb
@@ -1,3 +1,3 @@
<p><%= f.select :default_value, [[]]+@custom_field.possible_values_options %></p>
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
-<p><%= edit_tag_style_tag f %></p>
+<p><%= edit_tag_style_tag f, :include_radio => true %></p>