diff --git a/app/views/search/_search_form.rhtml b/app/views/search/_search_form.rhtml new file mode 100644 index 0000000..72cd95e --- /dev/null +++ b/app/views/search/_search_form.rhtml @@ -0,0 +1,38 @@ +
+ + <% form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) }, + :method => 'get', :class => 'search_form' ) do %> + + <%= hidden_field_tag :display, params[:display] %> + <%= hidden_field_tag :filter, params[:filter] %> + + <% params_uri = CGI::unescape(request.request_uri) %> + <% if params_uri.index('?') %> + <% params_uri[(params_uri.index('?')+1)..-1].to_s.split("&").each do |part| %> + <% if part.start_with? "facet" %> + <% name_value = part.split("=") %> + <%= hidden_field_tag name_value[0], name_value[1] %> + <% end %> + <% end %> + <% end %> + +
+ + <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50 %> + <%= javascript_tag "jQuery('#search-input').attr('title', \"#{hint}\").hint()" if defined?(hint) %> + + + <%= submit_button(:search, _('Search')) %> +
+ + <% end %> + + <% if @empty_query %> + <% hint = environment.search_hints[@asset] %> + <% if hint and !hint.blank? %> +
<%= hint %>
+ <% end %> + <% end %> + +
+
-- libgit2 0.21.2