Skip to content

Commit

Permalink
cosmetic changes: autocomplete inputs are wide/take up one row on form
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenjs committed Dec 29, 2014
1 parent fb9c416 commit 478c149
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 2 additions & 0 deletions app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ $sidebar_width: 210px;
input, select, textarea {
width: 240px;
display: block; }
input.input-wide {
width: 495px; }
input[type="checkbox"], input[type="radio"] {
display: inline;
width: auto; }
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/imports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def import
h[:cf_campus] = row[:campus]
h[:cf_faculty] = row[:faculty]
h[:cf_course_1] = row[:course_1]
h[:cf_course_2] = row[:course_2]
#h[:cf_course_2] = row[:course_2]
h[:cf_church_affiliation] = row[:church_affiliation]
end
contact = Contact.find_or_initialize_by_email_and_last_name(row[:email_1], row[:last_name])
Expand Down
2 changes: 1 addition & 1 deletion app/inputs/autocomplete_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def input
# Autocomplete latches onto the 'text_with_autocomplete' class.
#------------------------------------------------------------------------------
def input_html_classes
super.push('text_with_autocomplete')
super.push('text_with_autocomplete input-wide')
end

# Returns the field as field1
Expand Down
20 changes: 13 additions & 7 deletions app/views/fields/_group_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
- field_group.fields.without_pairs.in_groups_of(2, false) do |group|
%tr
- group.each_with_index do |field, i|
%td
- if field.hint.present?
= image_tag "info_tiny.png", :title => field.hint, :class => "tooltip-icon"
- if field.as == 'check_boxes'
- value = f.object.send(field.name)
- checked = YAML.load(value.to_s)
= f.input field.name, field.input_options.merge(:checked => checked)
- span = field.as == 'autocomplete' ? 3 : 1
- if field.as == 'autocomplete' && i !=0 #autocomplete takes up one whole line
%tr
%td{:colspan => span}
= f.input field.name, field.input_options
- else
%td{:colspan => span}
- if field.hint.present?
= image_tag "info_tiny.png", :title => field.hint, :class => "tooltip-icon"
- if field.as == 'check_boxes'
- value = f.object.send(field.name)
- checked = YAML.load(value.to_s)
= f.input field.name, field.input_options.merge(:checked => checked)
- if i == 0
%td= spacer
2 changes: 1 addition & 1 deletion lib/tasks/workflow.rake
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ namespace :ffcrm do

contact.cf_faculty = row[:cf_faculty]
contact.cf_course_1 = row[:cf_course_1]
contact.cf_course_2 = row[:cf_course_2]
#contact.cf_course_2 = row[:cf_course_2]

puts (contact.first_name + " " + contact.last_name)

Expand Down

0 comments on commit 478c149

Please sign in to comment.