From 20584f687d1ecef8a06fec9139c17954baa09b36 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Wed, 9 Jul 2008 00:18:32 +0000 Subject: [PATCH] ActionItem527: finished beautifying the seller search block(farejador) --- app/helpers/forms_helper.rb | 2 +- app/views/search/_search_form.rhtml | 9 ++------- app/views/search/_sellers_form.rhtml | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb index be33d60..4025070 100644 --- a/app/helpers/forms_helper.rb +++ b/app/helpers/forms_helper.rb @@ -64,7 +64,7 @@ module FormsHelper content_tag('div', labelled_select(_('State:'), 'state', :id, :name, nil, states, :id => state_id), :class => 'select_state_for_origin' ) + content_tag('div', labelled_select(_('City:'), 'city', :id, :name, nil, cities, :id => city_id), :class => 'select_city_for_origin' ) + - observe_field(state_id, :update => city_id, :url => { :controller => 'search', :action => 'cities' }, :with => 'state_id') + observe_field(state_id, :update => city_id, :function => "new Ajax.Updater(#{city_id.inspect}, #{url_for(:controller => 'search', :action => 'cities').inspect}, {asynchronous:true, evalScripts:true, parameters:'state_id=' + value}); $(#{city_id.inspect}).innerHTML = ''", :with => 'state_id') end protected diff --git a/app/views/search/_search_form.rhtml b/app/views/search/_search_form.rhtml index fe8f11c..59843f7 100644 --- a/app/views/search/_search_form.rhtml +++ b/app/views/search/_search_form.rhtml @@ -25,16 +25,11 @@
- - <%= text_field_tag 'radius', '', :id => 'search-radius', :size => 3 %> + <%= select_city %> -   - - <%= text_field :region, :name, :id => 'search_region', :size => 30 %> + <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %> -
- <%= auto_complete_field('search_region', :url => {:action => 'complete_region'}) %>
diff --git a/app/views/search/_sellers_form.rhtml b/app/views/search/_sellers_form.rhtml index 5f81181..77bb69d 100644 --- a/app/views/search/_sellers_form.rhtml +++ b/app/views/search/_sellers_form.rhtml @@ -14,7 +14,7 @@
- <%= labelled_text_field _('Distance (km): '), 'radius' %> + <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %>
-- libgit2 0.21.2