diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-20 21:29:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-20 21:29:51 +0000 |
commit | d6bfb7fa4da4068c3e64f3fce16574de56fd72e9 (patch) | |
tree | eec2bb152a3d5aa0782563baa38c59e170d1ea9c /app/views/custom_fields/_form.rhtml | |
parent | 59c5d995c339f726f7c6249d543a2b2a2a7bc061 (diff) | |
download | redmine-d6bfb7fa4da4068c3e64f3fce16574de56fd72e9.tar.gz redmine-d6bfb7fa4da4068c3e64f3fce16574de56fd72e9.zip |
Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1090 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/custom_fields/_form.rhtml')
-rw-r--r-- | app/views/custom_fields/_form.rhtml | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/app/views/custom_fields/_form.rhtml b/app/views/custom_fields/_form.rhtml index 915daab32..5e4eadf21 100644 --- a/app/views/custom_fields/_form.rhtml +++ b/app/views/custom_fields/_form.rhtml @@ -8,31 +8,42 @@ function toggle_custom_field_format() { p_regexp = $("custom_field_regexp"); p_values = $("custom_field_possible_values"); p_searchable = $("custom_field_searchable"); + p_default = $("custom_field_default_value"); + + p_default.setAttribute('type','text'); + Element.show(p_default.parentNode); + switch (format.value) { case "list": Element.hide(p_length.parentNode); Element.hide(p_regexp.parentNode); - Element.show(p_searchable.parentNode); + if (p_searchable) Element.show(p_searchable.parentNode); Element.show(p_values); break; - case "date": case "bool": + p_default.setAttribute('type','checkbox'); + Element.hide(p_length.parentNode); + Element.hide(p_regexp.parentNode); + if (p_searchable) Element.hide(p_searchable.parentNode); + Element.hide(p_values); + break; + case "date": Element.hide(p_length.parentNode); Element.hide(p_regexp.parentNode); - Element.hide(p_searchable.parentNode); + if (p_searchable) Element.hide(p_searchable.parentNode); Element.hide(p_values); break; case "float": case "int": Element.show(p_length.parentNode); Element.show(p_regexp.parentNode); - Element.hide(p_searchable.parentNode); + if (p_searchable) Element.hide(p_searchable.parentNode); Element.hide(p_values); break; default: Element.show(p_length.parentNode); Element.show(p_regexp.parentNode); - Element.show(p_searchable.parentNode); + if (p_searchable) Element.show(p_searchable.parentNode); Element.hide(p_values); break; } @@ -70,6 +81,7 @@ function deleteValueField(e) { <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><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p> </div> <div class="box"> |