Skip to content

Commit

Permalink
Allow field groups to be edited
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tillman committed Nov 22, 2011
1 parent 1b87765 commit 3ca2a08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/helpers/admin/fields_helper.rb
Expand Up @@ -25,4 +25,7 @@ def field_edit_as_options(field)
options.map{|k| [t("field_types.#{k}"), k] }
end

def field_group_options
FieldGroup.all.map {|fg| [fg.name, fg.id]}
end
end
10 changes: 7 additions & 3 deletions app/views/admin/fields/_top_section.html.haml
Expand Up @@ -13,9 +13,13 @@
.label.top.req Field type:
= f.select :as, field_edit_as_options(f.object)
%tr
%td{ :colspan => 3 }
%td
.label.top.req Select Options (pipe separated):
= f.text_field :collection_string
%td= spacer
%td
.label.top.req Field group:
= f.select :field_group_id, field_group_options
%tr
%td
.label.top Required:
Expand All @@ -27,11 +31,11 @@
%tr
%td
.label.top Hint:
= f.text_area :hint
= f.text_area :hint, :rows => 5
%td= spacer
%td
.label.top Placeholder:
= f.text_area :placeholder
= f.text_area :placeholder, :rows => 5

= hook(:customfield_top_section_bottom, self, :f => f)

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en-US_simple_form.yml
Expand Up @@ -28,7 +28,7 @@ en-US:
select: Select List
multiselect: Multi Select
radio: Radio Buttons
checkbox: Checkbox
boolean: Checkbox
check_boxes: Checkbox List
date: Date
datetime: Date & Time
Expand Down

0 comments on commit 3ca2a08

Please sign in to comment.