<commit_before>class LeadsController < ApplicationController
  
  def index
    @leads = Lead.all
    @lead = Lead.find_by_id(params[:id])
    @user = current_user
    @sorted_leads = @leads.sort.reverse
  end

  def show
    @lead = Lead.find_by_id(params[:id])
    @leads = Lead.all
    # @reserved_leads = @lead.reverse_orders.where(selector_id: current_user.id)

    #@order = @lead.reverse_orders.where(selector_id: current_user.id)
  end

  def new
    session[:lead_params] ||= {}
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]


    @time = [
      ["<NAME>"], 
      ["V roku 24h"], 
      ["V roku 7 dni"],
      ["Po dogovoru"],
      ["Servis nad daljavo"]  
      ["Potrebujem informativni pogovor"],
    ]

    render 'new', layout: 'adwords_layout'
  end


  def share
    session[:lead_params] ||= {}
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]

    @time = [
      ["<NAME>"], 
      ["V roku 24h"], 
      ["V roku 7 dni"],
      ["Po dogovoru"] 
      ["Potrebujem informativni pogovor"],
    ]

    # render 'share', layout: 'adwords_layout'
  end

  def create
    session[:lead_params].deep_merge!(lead_params) if (lead_params)
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]
    if params[:back_button]<commit_msg>Fix bugs for previous commit<commit_after>class LeadsController < ApplicationController
  
  def index
    @leads = Lead.all
    @lead = Lead.find_by_id(params[:id])
    @user = current_user
    @sorted_leads = @leads.sort.reverse
  end

  def show
    @lead = Lead.find_by_id(params[:id])
    @leads = Lead.all
    # @reserved_leads = @lead.reverse_orders.where(selector_id: current_user.id)

    #@order = @lead.reverse_orders.where(selector_id: current_user.id)
  end

  def new
    session[:lead_params] ||= {}
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]


    @time = [
      ["<NAME>"], 
      ["V roku 24h"], 
      ["V roku 7 dni"],
      ["Po dogovoru"],
      ["Servis nad daljavo"],  
      ["Potrebujem informativni pogovor"]
    ]

    render 'new', layout: 'adwords_layout'
  end


  def share
    session[:lead_params] ||= {}
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]

    @time = [
      ["<NAME>"], 
      ["V roku 24h"], 
      ["V roku 7 dni"],
      ["Po dogovoru"], 
      ["Potrebujem informativni pogovor"]
    ]

    # render 'share', layout: 'adwords_layout'
  end

  def create
    session[:lead_params].deep_merge!(lead_params) if (lead_params)
    @lead = Lead.new(session[:lead_params])
    @lead.current_step = session[:lead_step]
    if params[:back_button]
{'fraction_non_alphanumeric': 0.146448087431694, 'fraction_numerical': 0.004371584699453552, 'mean_word_length': 3.020497803806735, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3204720', 'n_tokens_mistral': 1050, 'n_tokens_neox': 961, 'n_words': 189}