><%= t('search.at_least') %>
<%= hidden_field_tag :focus, params[:focus] %>
<%= text_field_tag :search_query, params[:search_query].present? ? params[:search_query] : nil ,:autocomplete => :off, :id => :global_search_input %>
  • <%= link_to content_tag(:span,t('search.show_all'),:class => params[:focus].blank? ? 'global selected' : 'global'), search_path(:search_query => params[:search_query]), :remote => true %>
  • <% SocialStream.subjects.each do |subject| %> <% selected_class = (params[:focus].present? and params[:focus].pluralize.downcase.eql?(subject.to_s.pluralize.downcase)) ? 'selected' : ''%>
  • <%= focus_search_link content_tag(:span, subject.to_s.pluralize.capitalize, :class => selected_class + " " + subject.to_s.pluralize.downcase), subject.to_s.classify.constantize, params[:search_query] %>
  • <% end %>
<%= javascript_tag do %> $(document).ready(function() { $.preloadImages ("assets/mini-loading.gif"); $('#search_form').submit(function() { query = $('#global_search_input').val(); if((query=="")||(query.length < 2)||(query=="<%= t('search.write') %>")){ $('#too_short_error').show(); $('#global_search_input').removeClass("searching"); $('#global_search_input').blur(); $('#global_search_input').focus(); return false; }else{ $('#global_search_input').addClass("searching"); $('#global_search_input').blur(); } return true; }); }); <% end %>