Index: app/helpers/custom_fields_helper.rb
===================================================================
--- app/helpers/custom_fields_helper.rb (revision 2796)
+++ app/helpers/custom_fields_helper.rb (working copy)
@@ -44,6 +44,8 @@
(custom_field.default_value.blank? ? "" : '') :
''
select_tag(field_name, blank_option + options_for_select(custom_field.possible_values, custom_value.value), :id => field_id)
+ when "url"
+ text_field_tag(field_name, custom_value.value, :id => field_id, :size => 60)
else
text_field_tag(field_name, custom_value.value, :id => field_id)
end
Index: app/models/custom_field.rb
===================================================================
--- app/models/custom_field.rb (revision 2796)
+++ app/models/custom_field.rb (working copy)
@@ -26,7 +26,8 @@
"float" => { :name => :label_float, :order => 4 },
"list" => { :name => :label_list, :order => 5 },
"date" => { :name => :label_date, :order => 6 },
- "bool" => { :name => :label_boolean, :order => 7 }
+ "bool" => { :name => :label_boolean, :order => 7 },
+ "url" => { :name => :label_url, :order => 8}
}.freeze
validates_presence_of :name, :field_format
Index: app/views/custom_fields/_form.rhtml
===================================================================
--- app/views/custom_fields/_form.rhtml (revision 2796)
+++ app/views/custom_fields/_form.rhtml (working copy)
@@ -33,6 +33,11 @@
if (p_searchable) Element.hide(p_searchable.parentNode);
Element.hide(p_values);
break;
+ case "url":
+ Element.hide(p_length.parentNode);
+ if (p_searchable) Element.hide(p_searchable.parentNode);
+ Element.hide(p_values);
+ break;
case "float":
case "int":
Element.show(p_length.parentNode);
Index: config/locales/en.yml
===================================================================
--- config/locales/en.yml (revision 2796)
+++ config/locales/en.yml (working copy)
@@ -434,6 +434,7 @@
label_float: Float
label_boolean: Boolean
label_string: Text
+ label_url: URL
label_text: Long text
label_attribute: Attribute
label_attribute_plural: Attributes