<commit_before>class PagesController < ApplicationController
  layout :resolve_layout

  set_tab :home, :only => :home
  set_tab :services, :only => :services
  set_tab :about, :only => :about
  set_tab :contact, :only => :contact
  set_tab :faq, :only => :faq

  def home
    @title = "Updates and Alerts right to your phone!"
    @description = "Alertzy provides free sms-updates for Edmonton residents from our services.  Our services include Garbage Pickup schedules, sports field closures, and many more are coming soon."
  end
  
  def services
    @title = "Our current services"
    @description = "View Alertzy's available services and their descriptions.  Here you can find out the great services available to Alertzy users."
  end

  def about
    @title = "About this thing called Alertzy"
    @description = "All about the history of Alertzy and the hard working individuals who built it."
  end

  def contact
    @title = "How to get ahold of us"
    @description = "The contact information to reach the Alertzy team."
    @contact = Contact.new
  end
  
  def contact_submit
    @contact  = Contact.new(params[:contact])
    
    if verify_recaptcha(:model => @contact, :message => "Invalid Captcha Entry")
      #valid
      if @contact.valid?
        ContactMailer.contact_form(@contact).deliver
        flash.now[:notice] = "Thanks for contacting us! We'll respond as soon as possible."
        @contact = Contact.new
        render :action => 'contact'
      else  
        # invalid captcha
        flash.now[:error] = "Sorry we\'re unable to process the contact request. Please fix the fields below:"
        render :action => 'contact'
      end
    else  
      #not valid
      #since we display our flash array we need to remove the recaptcha error
      flash.delete(:recaptcha_error)
      flash.now[:error] = "Sorry we\'re unable to process the contact request. Please fix the fields below:"
      render :action => 'contact'
    end
  end

  def faq
    @title = "You've got questions..."
    @description = "A collection of common questions which users of Alertzy have, and their answers."
  end

  private
  def resolve_layout
    case action_name
    when "home"<commit_msg>minor comment fixing before deploy<commit_after>class PagesController < ApplicationController
  layout :resolve_layout

  set_tab :home, :only => :home
  set_tab :services, :only => :services
  set_tab :about, :only => :about
  set_tab :contact, :only => :contact
  set_tab :faq, :only => :faq

  def home
    @title = "Updates and Alerts right to your phone!"
    @description = "Alertzy provides free sms-updates for Edmonton residents from our services.  Our services include Garbage Pickup schedules, sports field closures, and many more are coming soon."
  end
  
  def services
    @title = "Our current services"
    @description = "View Alertzy's available services and their descriptions.  Here you can find out the great services available to Alertzy users."
  end

  def about
    @title = "About this thing called Alertzy"
    @description = "All about the history of Alertzy and the hard working individuals who built it."
  end

  def contact
    @title = "How to get ahold of us"
    @description = "The contact information to reach the Alertzy team."
    @contact = Contact.new
  end
  
  def contact_submit
    @contact  = Contact.new(params[:contact])
    
    if verify_recaptcha(:model => @contact, :message => "Invalid Captcha Entry")
      # valid captcha
      if @contact.valid?
        ContactMailer.contact_form(@contact).deliver
        flash.now[:notice] = "Thanks for contacting us! We'll respond as soon as possible."
        @contact = Contact.new
        render :action => 'contact'
      else  
        # invalid model fields entered
        flash.now[:error] = "Sorry we\'re unable to process the contact request. Please fix the fields below:"
        render :action => 'contact'
      end
    else  
      # invalid captcha
      #since we display our flash array we need to remove the recaptcha error (it adds it to the flash by default)
      flash.delete(:recaptcha_error)
      flash.now[:error] = "Sorry we\'re unable to process the contact request. Please fix the fields below:"
      render :action => 'contact'
    end
  end

  def faq
    @title = "You've got questions..."
    @description = "A collection of common questions which users of Alertzy have, and their answers."
  end

  private
  def resolve_layout
    case action_name
    when "home"
{'fraction_non_alphanumeric': 0.08175960897578316, 'fraction_numerical': 0.0, 'mean_word_length': 3.063176895306859, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '4535391', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1208, 'n_words': 514}