# -*- encoding : utf-8 -*-

class Public::PetitionsController < ApplicationController
  layout "public"
  def show
    
    if params[:lang]
      
      @lang = LangSite.find_by_slug(params[:lang])
      
    end
    @petition_lang = PetitionLang.where(:lang_site_id => @lang.id).find_by_slug(params[:slug])
		@petition = @petition_lang.petition
    
    @signator = @petition.signators.new(:country => "France")
    @title = "Petition - "+@petition_lang.title
  end


  def index
    #@petitions = Petition.order("created_at DESC").all
    redirect_to "/"
  end



end
