Commit 6d204ee1ac8042dd56698f8977071e9f44cfa4b3
1 parent
cd53e5e5
Exists in
master
and in
29 other branches
Adding search form back...
Showing
1 changed file
with
38 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,38 @@ |
1 | +<div class='search-form'> | |
2 | + | |
3 | + <% form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) }, | |
4 | + :method => 'get', :class => 'search_form' ) do %> | |
5 | + | |
6 | + <%= hidden_field_tag :display, params[:display] %> | |
7 | + <%= hidden_field_tag :filter, params[:filter] %> | |
8 | + | |
9 | + <% params_uri = CGI::unescape(request.request_uri) %> | |
10 | + <% if params_uri.index('?') %> | |
11 | + <% params_uri[(params_uri.index('?')+1)..-1].to_s.split("&").each do |part| %> | |
12 | + <% if part.start_with? "facet" %> | |
13 | + <% name_value = part.split("=") %> | |
14 | + <%= hidden_field_tag name_value[0], name_value[1] %> | |
15 | + <% end %> | |
16 | + <% end %> | |
17 | + <% end %> | |
18 | + | |
19 | + <div class="search-field"> | |
20 | + <span class="formfield"> | |
21 | + <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50 %> | |
22 | + <%= javascript_tag "jQuery('#search-input').attr('title', \"#{hint}\").hint()" if defined?(hint) %> | |
23 | + </span> | |
24 | + | |
25 | + <%= submit_button(:search, _('Search')) %> | |
26 | + </div> | |
27 | + | |
28 | + <% end %> | |
29 | + | |
30 | + <% if @empty_query %> | |
31 | + <% hint = environment.search_hints[@asset] %> | |
32 | + <% if hint and !hint.blank? %> | |
33 | + <div class="search-hint"><%= hint %></div> | |
34 | + <% end %> | |
35 | + <% end %> | |
36 | + | |
37 | + <div style="clear: both"></div> | |
38 | +</div> | ... | ... |