_search_form.rhtml
2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<div class='search-form'>
<% simple_search = false unless defined? simple_search %>
<% form_tag( { :controller => 'search', :action => 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) },
:method => 'get', :class => 'search_form' ) do %>
<%= '<h3>%s</h3>' % form_title if defined? form_title %>
<%= hidden_field_tag :display, params[:display] %>
<%= hidden_field_tag :asset, params[:asset] %>
<div class="search-field">
<span class="formfield">
<%= text_field_tag 'query', @query, :id => ( lightbox? ? 'popup-search-input' : '' ), :size => 50 %>
<%= javascript_tag 'setTimeout("$(\"popup-search-input\").focus()", 10 )' if lightbox? %>
</span>
<%= submit_button(:search, _('Search'), :name => :search_whole_site_no) %>
<% if @category %>
<%= submit_button(:search, _('Search in whole site'), :name => :search_whole_site_yes) %>
<% end %>
</div>
<div id='advanced-search-options' style="display: <%= simple_search ? 'none' : 'block' %>">
<div class="search-options search-within">
<h4><%= _('Search within:') %></h4>
<br style='clear:left'/>
<div>
<span class="formfield">
<%= select_city %>
</span>
<span class="formfield">
<%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %>
</span>
</div>
</div><!-- fim class="search-options" -->
<div class="search-options search-for">
<h4><%= _('Search for:') %></h4>
<ul>
<% @search_in.map { |t,n| [t,getterm(n)] } .
sort_by(&:last).each do |thing, name| %>
<li>
<%= labelled_check_box name, 'find_in[]', thing.to_s, @searching[thing.to_sym] %>
</li>
<% end %>
</ul>
<br style="clear:both" />
</div><!-- fim class="search-options" -->
</div><!-- end id="advanced-search-options" -->
<% if simple_search %>
<%= link_to_function(_('More options'), nil, :id => 'advanced_search_link') do |page|
page['advanced_search_link'].hide
page['advanced-search-options'].toggle
end %>
<% end %>
<% if lightbox?; button_bar do %>
<%= lightbox_close_button _('Close') %>
<% end; end %>
<% end %>
</div> <!-- id="search-form" -->