
#search_form
  =form_tag search_public_annonces_path, {:authenticity_token => false, :method => :post, :onsubmit => "$(this).attr('action',$(this).data('action-url')+'?'+$('#specific_search').closest('form').serialize());$('.search_results').html('<div class=\"loader\"><img src=\"/loader.gif\" /></div>');", :data => {:action_url => search_public_annonces_path()}, :remote => (true if @search_index), :onchange => ("$(this).submit();" if @search_index)} do
    

    #general_search
      =text_field_tag :q, params[:q], :id => "q", :placeholder => t("what")
      
      .place_search
        =hidden_field_tag :place_type, params[:place_type]
        =hidden_field_tag :place_cp, params[:place_cp]
        =hidden_field_tag :place_city, params[:place_city]
        =hidden_field_tag :place_country, params[:place_country]
        =hidden_field_tag :place_id, params[:place_id]
        
        =text_field_tag :place, params[:place], :id => "place",:placeholder => t("where")
        
        %span{:style => "display:none;"}
          =text_field_tag :place_lat, params[:place_lat], :id => "place_lat_field"
          =text_field_tag :place_lng, params[:place_lng], :id => "place_lng_field"
          =text_field_tag :place_dist, params[:place_dist], :id => "place_dist_field"
          =check_box_tag :with_radius, 1, (true if params[:with_radius]), :id => "with_radius_check", :onchange => "init_radius_form();"
        %ul.dropdown-menu.autocomp{:"aria-labelledby" => "place"}

        
        
        
      =select_tag :annonce_cat_id, option_groups_from_collection_for_select(AnnonceCat.where(:parent_id => nil).all, :children, :name, :id, :name,params[:annonce_cat_id]),:prompt => t("what-category"),:include_blank => false, :onchange => ("$.ajax({ url: '#{search_public_annonce_cats_path()}',data: {annonce_cat_id : $(this).val()}});" ), :id => "annonce_cat_id"
      =submit_tag t("search"), :class => "btn btn-primary", :id => "search_button"
      .clear
    .price_form
      =t("price-from")
      =text_field_tag :min_price, params[:min_price], :placeholder => t("price-min"), :class => "form-control"
      =t("to")
      =text_field_tag :max_price, params[:max_price], :placeholder => t("price-max"), :class => "form-control"
      €
      
    #specific_form_hidden
    

    #more_search

      #specific_search_container
        .inner
          #specific_search
            =render :partial => "public/annonce_cats/specific_search_form"
          =#submit_tag t("search"), :class => "btn btn-primary"
  
