summaryrefslogtreecommitdiffstats
path: root/app/views/custom_fields/_form.rhtml
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-16 21:02:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-16 21:02:03 +0000
commita276926f420d0369a3f9d0fe69e972d07ef74363 (patch)
tree799cbf1c70d971c339039856b8e0df03485775c9 /app/views/custom_fields/_form.rhtml
parentf6282f9600b0656f68164118c4c5f557cb37968b (diff)
downloadredmine-a276926f420d0369a3f9d0fe69e972d07ef74363.tar.gz
redmine-a276926f420d0369a3f9d0fe69e972d07ef74363.zip
Use a textarea for custom fields possible values (#2472).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2267 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/custom_fields/_form.rhtml')
-rw-r--r--app/views/custom_fields/_form.rhtml26
1 files changed, 4 insertions, 22 deletions
diff --git a/app/views/custom_fields/_form.rhtml b/app/views/custom_fields/_form.rhtml
index f4aee6870..43ed5feb9 100644
--- a/app/views/custom_fields/_form.rhtml
+++ b/app/views/custom_fields/_form.rhtml
@@ -49,23 +49,6 @@ function toggle_custom_field_format() {
}
}
-function addValueField() {
- var f = $$('p#custom_field_possible_values span');
- p = document.getElementById("custom_field_possible_values");
- var v = f[0].cloneNode(true);
- v.childNodes[0].value = "";
- p.appendChild(v);
-}
-
-function deleteValueField(e) {
- var f = $$('p#custom_field_possible_values span');
- if (f.length == 1) {
- e.parentNode.childNodes[0].value = "";
- } else {
- Element.remove(e.parentNode);
- }
-}
-
//]]>
</script>
@@ -76,11 +59,10 @@ function deleteValueField(e) {
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
<%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p>
<p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
-<p id="custom_field_possible_values"><label><%= l(:field_possible_values) %> <%= image_to_function "add.png", "addValueField();return false" %></label>
-<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
-<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
-<% end %>
-</p>
+<p id="custom_field_possible_values"><%= f.text_area :possible_values, :value => @custom_field.possible_values.to_a.join("\n"),
+ :cols => 20,
+ :rows => 15 %>
+<br /><em><%= l(:text_custom_field_possible_values_info) %></em></p>
<p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p>
</div>