def buy
      @page = Pwb::Page.find_by_slug "buy"
      @page_title = @current_agency.company_name
      # @content_to_show = []
      if @page.present?
        @page_title = @page.page_title + ' - ' + @current_agency.company_name
        # TODO: - allow addition of custom content
        # @page.ordered_visible_page_contents.each do |page_content|
        #   @content_to_show.push page_content.content.raw
        # end
      end

      # @page_title = I18n.t("searchForProperties")
      # in erb template for this action, I have js that will render search_results template
      # for properties - like search_ajax action does
      @operation_type = "for_sale"
      # above used to decide if link to result should be to buy or rent path

      @properties = Prop.visible.for_sale.limit 45
      # ordering happens clientside
      # .order('price_sale_current_cents ASC').limit 35
      @prices_from_collection = @current_website.sale_price_options_from
      @prices_till_collection = @current_website.sale_price_options_till
      # @prices_collection = @current_website.sale_price_options_from

      # %W(#{''} 25,000 50,000 75,000 100,000 150,000 250,000 500,000 1,000,000 2,000,000 5,000,000 )
      # ..

      set_common_search_inputs
      set_select_picker_texts
      apply_search_filter filtering_params(params)
      set_map_markers

      # below allows setting in form of any input values that might have been passed by param
      @search_defaults = params[:search].present? ? params[:search] : {}
      # {"property_type" => ""}
      # below won't sort right away as the list of results is loaded by js
      # and so won't be ready for sorting when below is called - but will wire up for sorting button
      # initial client sort called by       INMOAPP.sortSearchResults();
      js 'Main/Search#sort' # trigger client-side paloma script

      render "/pwb/search/buy"
    end
def buy
      @page = Pwb::Page.find_by_slug "buy"
      @page_title = @current_agency.company_name
      # @content_to_show = []
      if @page.present?
        @page_title = @page.page_title + ' - ' + @current_agency.company_name
        # TODO: - allow addition of custom content
        # @page.ordered_visible_page_contents.each do |page_content|
        #   @content_to_show.push page_content.content.raw
        # end
      end

      # @page_title = I18n.t("searchForProperties")
      # in erb template for this action, I have js that will render search_results template
      # for properties - like search_ajax action does
      @operation_type = "for_sale"
      # above used to decide if link to result should be to buy or rent path

      @properties = Prop.visible.for_sale.limit 45
      # ordering happens clientside
      # .order('price_sale_current_cents ASC').limit 35
      @prices_from_collection = @current_website.sale_price_options_from
      @prices_till_collection = @current_website.sale_price_options_till
      # @prices_collection = @current_website.sale_price_options_from

      # %W(#{''} 25,000 50,000 75,000 100,000 150,000 250,000 500,000 1,000,000 2,000,000 5,000,000 )
      # ..

      set_common_search_inputs
      set_select_picker_texts
      apply_search_filter filtering_params(params)
      set_map_markers

      # below allows setting in form of any input values that might have been passed by param
      @search_defaults = params[:search].present? ? params[:search] : {}
      # {"property_type" => ""}
      # below won't sort right away as the list of results is loaded by js
      # and so won't be ready for sorting when below is called - but will wire up for sorting button
      # initial client sort called by       INMOAPP.sortSearchResults();
      js 'Main/Search#sort' # trigger client-side paloma script

      render "/pwb/search/buy"
    end
ordering of results happens client-side with paloma search.js