Project

General

Profile

Patch #3651 ยป redmine_customfield_url.diff

Isaac Lo, 2009-07-22 09:46

View differences:

app/helpers/custom_fields_helper.rb (working copy)
44 44
                       (custom_field.default_value.blank? ? "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" : '') :
45 45
                       '<option></option>'
46 46
      select_tag(field_name, blank_option + options_for_select(custom_field.possible_values, custom_value.value), :id => field_id)
47
    when "url"
48
      text_field_tag(field_name, custom_value.value, :id => field_id, :size => 60)
47 49
    else
48 50
      text_field_tag(field_name, custom_value.value, :id => field_id)
49 51
    end
app/models/custom_field.rb (working copy)
26 26
                    "float" => { :name => :label_float, :order => 4 },
27 27
                    "list" => { :name => :label_list, :order => 5 },
28 28
                               "date" => { :name => :label_date, :order => 6 },
29
                               "bool" => { :name => :label_boolean, :order => 7 }
29
                               "bool" => { :name => :label_boolean, :order => 7 },
30
                  "url" => { :name => :label_url, :order => 8}
30 31
  }.freeze
31 32
  validates_presence_of :name, :field_format
app/views/custom_fields/_form.rhtml (working copy)
33 33
      if (p_searchable) Element.hide(p_searchable.parentNode);
34 34
      Element.hide(p_values);
35 35
      break;
36
    case "url":
37
      Element.hide(p_length.parentNode);
38
      if (p_searchable) Element.hide(p_searchable.parentNode);
39
      Element.hide(p_values);
40
      break;
36 41
    case "float":
37 42
    case "int":
38 43
      Element.show(p_length.parentNode);
config/locales/en.yml (working copy)
434 434
  label_float: Float
435 435
  label_boolean: Boolean
436 436
  label_string: Text
437
  label_url: URL
437 438
  label_text: Long text
438 439
  label_attribute: Attribute
439 440
  label_attribute_plural: Attributes
    (1-1/1)