Commit 20584f687d1ecef8a06fec9139c17954baa09b36
1 parent
6db82f82
Exists in
master
and in
29 other branches
ActionItem527: finished beautifying the seller search block(farejador)
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2180 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
4 additions
and
9 deletions
Show diff stats
app/helpers/forms_helper.rb
... | ... | @@ -64,7 +64,7 @@ module FormsHelper |
64 | 64 | content_tag('div', labelled_select(_('State:'), 'state', :id, :name, nil, states, :id => state_id), :class => 'select_state_for_origin' ) + |
65 | 65 | content_tag('div', labelled_select(_('City:'), 'city', :id, :name, nil, cities, :id => city_id), :class => 'select_city_for_origin' ) + |
66 | 66 | |
67 | - observe_field(state_id, :update => city_id, :url => { :controller => 'search', :action => 'cities' }, :with => 'state_id') | |
67 | + 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 = '<option>#{_('Loading...')}</option>'", :with => 'state_id') | |
68 | 68 | end |
69 | 69 | |
70 | 70 | protected | ... | ... |
app/views/search/_search_form.rhtml
... | ... | @@ -25,16 +25,11 @@ |
25 | 25 | <br style='clear:left'/> |
26 | 26 | <div> |
27 | 27 | <span class="formfield"> |
28 | - <label for="search-radius"><%= _('Distance (km):') %></label> | |
29 | - <%= text_field_tag 'radius', '', :id => 'search-radius', :size => 3 %> | |
28 | + <%= select_city %> | |
30 | 29 | </span> |
31 | - | |
32 | 30 | <span class="formfield"> |
33 | - <label for="search_region"><%= _('From:') %></label> | |
34 | - <%= text_field :region, :name, :id => 'search_region', :size => 30 %> | |
31 | + <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %> | |
35 | 32 | </span> |
36 | - <div id='search_region_auto_complete' class='auto-complete'></div> | |
37 | - <%= auto_complete_field('search_region', :url => {:action => 'complete_region'}) %> | |
38 | 33 | </div> |
39 | 34 | </div><!-- fim class="search-options" --> |
40 | 35 | ... | ... |
app/views/search/_sellers_form.rhtml
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | </div> |
15 | 15 | |
16 | 16 | <div class="formfield search-distance-opt"> |
17 | - <%= labelled_text_field _('Distance (km): '), 'radius' %> | |
17 | + <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %> | |
18 | 18 | </div> |
19 | 19 | |
20 | 20 | <div class="button-bar"> | ... | ... |