Sha256: 1c1cbf96ce482a0a24ff7e31ba8826ed41883bc5056b63f45642ab51cc66247e

Contents?: true

Size: 1.94 KB

Versions: 5

Compression:

Stored size: 1.94 KB

Contents

#location_chooser
  %label= :country.l
  = select_tag(:country_id, options_from_collection_for_select(Country.find_countries_with_metros, "id", "name", selected_country), {:include_blank => true})

  %br
  %label= :state.l 
  = select_tag(:state_id, options_from_collection_for_select(states, "id", "name", (selected_state rescue nil)), {:disabled => states.empty? })

  = image_tag 'spinner.gif', :style => 'display:none;'

  %br
  %label= :metro_area.l
  = select_tag(:metro_area_id, options_from_collection_for_select(metro_areas, "id", "name", (selected_metro_area rescue nil)), {:disabled => metro_areas.empty? })

  = image_tag 'spinner.gif', :style => 'display:none;'

%span

- js ||= nil
- if js
  = observe_field("state_id", {:url => {:controller => 'users', :action => 'metro_area_update'}, :with => "'state_id=' + $('state_id').value + '&country_id=' + $('country_id').value", :loading => "$$('div#location_chooser img')[0].show();", 500 => "alert('"+:sorry_there_was_an_error.l+"'); return false", :update => "location_chooser"})
  = observe_field("country_id", {:url => {:controller => 'users', :action => 'metro_area_update'}, :with => "country_id", :loading => "$$('div#location_chooser img')[0].show();", 500 => "alert('"+:sorry_there_was_an_error.l+"'); return false", :update => "location_chooser"})
- else
  -content_for :end_javascript do
    = observe_field("state_id", {:url => {:controller => 'users', :action => 'metro_area_update'}, :with => "'state_id=' + $('state_id').value + '&country_id=' + $('country_id').value", :loading => "$$('div#location_chooser img')[0].show();", 500 => "alert('"+:sorry_there_was_an_error.l+"'); return false", :update => "location_chooser"})
    = observe_field("country_id", {:url => {:controller => 'users', :action => 'metro_area_update'}, :with => "country_id", :loading => "$$('div#location_chooser img')[0].show();", 500 => "alert('"+:sorry_there_was_an_error.l+"'); return false", :update => "location_chooser"})
  




Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
community_engine-2.3.2 app/views/shared/_location_chooser.html.haml
community_engine-2.3.1 app/views/shared/_location_chooser.html.haml
community_engine-2.3.0 app/views/shared/_location_chooser.html.haml
community_engine-2.1.0 app/views/shared/_location_chooser.html.haml
community_engine-2.0.0 app/views/shared/_location_chooser.html.haml