Rails.application.routes.draw do
  
  
  get "cirques-pre" => "public/home#cirques", :lang => "fr"
  
  constraints(:domain => ["angora.local", "stop-angora.fr"]) do

    get "la-souffrance-des-lapins-angoras.html" => "public/home#angora_e1", :lang => "fr"

    get "/:lang" => "public/home#angora"
    get "/" => "public/home#angora"
   
   
   
  
   
  end

  get "cirques/saw" => "public/cirque_signs#create", :as => :new_public_cirque_sign


  constraints(:domain => ["le-petit-gravier.com"], :subdomain => "enquete-2017") do
   
    get "/" => "survey_sets#new", :defaults => {:slug => "enquete-2017"} 
   
    
   
  end


   constraints( :domain => [ "visonslerespect.fr"]) do
    
     get "/:lang" => "public/home#fourrure"
      get "/" => "public/home#fourrure"
     
      namespace :public do
      get 'send_fourrure/sending'
      resources :fourrure_senders
      end
    
   end
   
   
   constraints( :domain => [ "cirques-animaux.fr"]) do

      get "/" => "public/home#cirques", :lang => "fr"
    
   end
  
  
  
   get 'sondages/:slug/merci-de-votre-participation.:f' => 'survey_sets#thank', :as => :thank_survey_set, :f => "html"
   get 'sondages/:slug.:f' => 'survey_sets#new', :as => :new_survey_set, :f => "html"
  
   resources :survey_sets do
     collection do 
       get 'thanks'
   
     end
   
   end
  
  
  namespace :public do
    get 'send_fourrure/sending'
    resources :fourrure_senders
    
    resources :document_orders
  end

  get "/fr/petitions/pour-moana-et-tous-les-autres-fermons-les-delphinariums.html" => redirect("/fr/petitions/pour-aicko-galeo-inouk-femke-et-tous-les-cetaces-captifs.html")
  
  
  
  namespace :public do
    
  resources :contacts
  
  get 'label_site/index'

  get 'label_site/list'

  get 'label_site/notre_label'
  
  get 'label_site/produits'
  get 'label_site/enseignes'
  

  get 'label_site/entreprises'
  get 'label_site/actus'

  get 'label_site/contact'
  end
  
  


  
  
   
  get "fourrure" => "public/home#fourrure"
  get "angora" => redirect('https://stop-angora.fr')
  
  get ":lang/angora" => redirect('https://stop-angora.fr')
  
  get 'auth/facebook/callback', to: 'public/facebook_auths#facebook_connect_callback'
  
 
  
  get 'parrainage', :to => redirect("/fr/faire-un-don")
  get 'faire-un-don', :to => redirect("/fr/faire-un-don")
  get '/fr', :to => redirect("/fr/index.html")
  get '/en', :to => redirect("/en/index.html")
  get "/fr/nos-combats/contre-la-captivite/des-cirques-oui-mais-sans-animaux/agir/carte-des-communes-refusant-les-cirques-avec-animaux.html", :to => redirect("/fr/carte-cirques.html")
  get "/fr/nos-combats/contre-la-captivite/des-cirques-oui-mais-sans-animaux/carte-des-communes-refusant-les-cirques-avec-animaux.html", :to => redirect("/fr/carte-cirques.html")
  
  get "/fr/nos-combats/loisirs/cirques/carte-des-communes-refusant-les-cirques-avec-animaux.html", :to => redirect("/fr/carte-cirques.html")
  
  
  
  
  
  
  scope "(:lang)", locale: /#{I18n.available_locales.join("|")}/ do
  
  
  get "contact.html" =>"public/contacts#new", :defaults => {:raison_id => 1}, :as => :general_contact
  
  get "contact-donation.html" =>"public/contacts#new", :defaults => {:raison_id => 2}, :as => :donation_contact

  get "contact-documents.html" =>"public/contacts#new", :defaults => {:raison_id => 3}, :as => :document_contact
  
  scope "(:slug)" do
  

  
  get "/p_dons/edit" => "public/don_tunnels#edit", :as => :edit_public_don_tunnels
  
  get "/p_dons" => "public/don_tunnels#new", :as => :new_public_don_tunnels
  patch "/p_don" => "public/don_tunnels#update", :as => :public_don_tunnel
  
  get "/p_don/particulars" => "public/don_tunnels#particulars", :as => :particulars_public_don_tunnels
  post "/p_don/particulars" => "public/don_tunnels#particulars_save", :as => :particulars_save_public_don_tunnels
  
  
  get "/p_don/paid_by_ogone" => "public/don_tunnels#paid_by_ogone", :as => :paid_by_ogone_public_don_tunnels
  get "/p_don/paid_by_ogone_confirm" => "public/don_tunnels#paid_by_ogone_confirm", :as => :paid_by_ogone_confirm_public_don_tunnels
  
  get "/p_don/payment_instructions" => "public/don_tunnels#payment_instructions", :as => :payment_instructions_public_don_tunnels
  
  get "/p_don/select_payment" => "public/don_tunnels#select_payment", :as => :select_payment_public_don_tunnels
  
  get "/p_don/sepa" => "public/don_tunnels#sepa", :as => :sepa_public_don_tunnels
  get "/p_don/recu" => "public/don_tunnels#recu", :as => :recu_public_don_tunnels
  
end
  
  scope ":slug" do
    
    namespace :public do
      resources :don_tunnels do
        member do
          get :paid_by_ogone
          get :paid_by_ogone_confirm
  
          get :particulars
          post :particulars_save
          get :select_payment
          post :select_payment_save
          get :payment_instructions
          get :sepa
          get :recu
        end
        collection do
          post :payplug_ipn
    
    
        end
  
      end
    end
  
  end
  
  
  
  
  
  get "presse/sentience/:id" => "public/press_releases#show", :as => :public_sentience, :defaults => {:sentience => true}
  get "presse/sentience.html" => "public/press_releases#sentiences", :as => :public_sentiences, :defaults => {:sentience => true}
  
  get "presse" => "public/press_releases#index", :as => :public_press_releases
  get "presse/:id" => "public/press_releases#show", :as => :public_press_release
  
  
  get "petitions.html" => "public/petitions#index", :as => :public_petitions
  
  
  get "boutique/cat/:id/:slug.:format" => "public/product_categories#show", :as => :public_product_category, :format => "html"
  get "boutique/produit/:id/:slug.:format" => "public/products#show", :as => :public_product, :format => "html"
  
  get "boutique.:f" => "public/product_categories#index", :as => :boutique, :f => "html"
  
  
    get 'forum/forum_users/create_by_facebook.:f' => 'forum/forum_users#create', :as => :facebook_forum_forum_user, :f => "html", :by_facebook => true
    
    
    
    namespace :forum do
      root :to => "forum_topics#index", :id => 1
      resources :forum_topics do
        member do
          get :follow
          
        end
      end
      resources :forum_reports
      resources :forum_messages do
        member do
          get :report
          
        end
      end
      resources :forums
      resources :forum_categories
      resources :forum_users do
        member do
          get :lock
        end
      end
      
          
      resources :password_resets
      resources :forum_user_images do
        member do
          get :rotate
        end
      end
      resources :auths do
        collection do 
          get :logout
        end
      end
    
    end
    
    
    
  
  
  
    #get "/newsletters/:id.html" => "public/newsletters#show", :as => :public_newsletter
    get "/newsletters.html" => "public/newsletters#index", :as => :public_newsletters
  
    get "images-news/hashtag/:id.html" => "public/image_actu_albums#hashtag", :as => :hashtag_public_image_actu
    get "images-news/:id.html" => "public/image_actus#show", :as => :public_image_actu
    get "images-news/album/:id.html" => "public/image_actu_albums#show", :as => :public_image_actu_album
    get "images-news.html" => "public/image_actu_albums#index", :as => :public_image_actu_albums
    get "newsletters/:id.html" => "public/newsletters#show", :as => :public_newsletter
    get "videos/:slug" => "public/video_files#show", :as => :public_video_file
    
    get "videos" => "public/video_files#index", :as => :public_video_files
    get "videos/chaine/:id" => "public/investigation_cats#show", :as => :public_investigation_cat
    
    get "faire-un-don.html", :to => redirect("/faire-un-don")
    get "faire-un-don" => "public/donator_transactions#new", :as => :new_public_donator_transaction
    get "adhesion" => "public/transaction_joins#new", :as => :new_public_transaction_join
    
    get "abonnements" => "public/transaction_abos#new", :as => :new_public_transaction_abo
    get 'u/:id' => 'tiny_urls#show', :as => :tiny_url
    
    get 'parrainage' => "public/sponsorship_animals#index", :as => :public_sponsorship_animals
    
    namespace :public do
      resources :militer_cats
      
      resources :product_sizes

      resources :product_images

      resources :product_categories

      resources :products

      resources :product_orders do
        member do
          get :payment_instructions
        end
        
        collection do
          get :paid_by_ogone
          get :paid_by_ogone_confirm
                  
          post :payplug_ipn
          
          post :vourcher
          
          get :particulars
          post :particulars_save
          get :select_payment
          get :select_fdp
          post :select_fdp_save
          get :select_fdp_save
          post :select_payment_save
          
          
          get :payment_instructions
          
        end
        
      end
      resources :product_order_products
      
      
      resources :product_customers do
        member do
          get :confirm
          get :mail
          get :mail_confirm
          get :show_details
        end

        collection do
          get :find_parrain
        end

      end

      resources :product_customers_auths do

        collection do

          get :logout

        end
      end
      
      resources :password_resets

      get :my_cart, to: "product_orders#my_cart"
      
      
      
      
      
      
      
      
      
      
      resources :image_actu_albums
      resources :image_actus
      
      resources :sponsorship_animals do
      
        member do
          post :donate_save
        
          get :paid_by_ogone
          get :paid_by_ogone_confirm
        
          get :particulars
          post :particulars_save
          get :select_payment
          post :select_payment_save
          get :payment_instructions
        
        end
        collection do
          post :payplug_ipn
        end
      end
    
      
    
    
      resources :donator_transactions do
        member do
          get :paid_by_ogone
          get :paid_by_ogone_confirm
      
          get :particulars
          post :particulars_save
          get :select_payment
          post :select_payment_save
          get :payment_instructions
          get :sepa
          get :recu
        end
        collection do
          post :payplug_ipn
        
        
        end
      
      end
      
      resources :transaction_joins do
        member do
          get :paid_by_ogone
          get :paid_by_ogone_confirm
      
          get :particulars
          post :particulars_save
          get :select_payment
          post :select_payment_save
          get :payment_instructions
          get :sepa
          get :recu
        end
        collection do
          post :payplug_ipn
        
        
        end
      
      end
    
      resources :transaction_abos do
        member do
          get :paid_by_ogone
          get :paid_by_ogone_confirm
      
          get :particulars
          post :particulars_save
          get :select_payment
          post :select_payment_save
          get :payment_instructions
          get :sepa
          get :recu
          get :facture
        end
        collection do
          post :payplug_ipn
        
        
        end
      
      end
    end
  end
  
  get "fr/search" => "public/search#search", :as => :search
  get "fr/petitions/strasbourg-cirque.:f" => "public/petitions#strasbourg_cirque"
  get "fr/petitions/patrimoine-cirques.:f" => "public/petitions#patrimoine_cirque"
  
  
  
  get "/ogoneipn" => "public/donator_transactions#ogone_ipn", :as => :ogone_ipn_public_donator_transactions
  
  get "/ogoneipnsa" => "public/sponsorship_animals#ogone_ipn", :as => :ogone_ipn_public_sponsorship_animals
  get "/ogoneipntj" => "public/transaction_joins#ogone_ipn", :as => :ogone_ipn_public_transaction_joins
  get "/ogoneipnta" => "public/transaction_abos#ogone_ipn", :as => :ogone_ipn_public_transaction_abos
  get "/ogoneipnpo" => "public/product_orders#ogone_ipn", :as => :ogone_ipn_public_product_orders
  
  
  get '/fr/nos-combats/compagnons-animaux/chiens-et-chats/veterinaires-formes-cav.html', to: redirect('/fr/carte-veterinaires.html')
  
  
  get "/fr/nos-combats/compagnons/veterinaires-formes-cav.html", to: redirect('/fr/carte-veterinaires.html')
  
  get "/fr/assurance-vie.html"=> "public/home#assurance"
  
  get "/fr/carte-veterinaires.:f"=> "public/specific_maps#show", :id => 1
  get "/fr/carte-cirques.:f"=> "public/specific_maps#cirques", :as => :carte_cirque, :f => "html"
  
  get "/fr/nos-combats/abolir-lexperimentation-animale/les-labels-gravier/decouvrez-les-produits-labellises.html" => "public/label_produits#index"
  
  get "/fr/agir-ensemble/les-labels-gravier/decouvrez-les-produits-labellises.html" => "public/label_produits#index"
  get "/fr/nos-combats/experimentation-animale/les-labels-gravier/decouvrez-les-produits-labellises.html" => "public/label_produits#index"
  
  get "/fr/agir-ensemble/le-label-gravier/decouvrez-les-produits-labellises.html" => "public/label_produits#index"
  get "label" => "public/label_produits#index", :as => :label
  
  
  
  get "petition-chine" => "public/petitions#chine"
  get "fr/petitions/animaux-en-chine-a-laide.:f" => "public/petitions#chine"
  get "fr/petitions/politique-penale-protection-animaux-et-humains.:f" => "public/petitions#politique_penale"
  get "fr/petitions/condamner-toutes-les-violences.:f" => "public/petitions#politique_penale"
  
  
  
  get "/fr/petitions/pour-aicko-galeo-inouk-femke-et-tous-les-cetaces-captifs.html" => "public/petitions#delphinariums"

  get "petition-produits-entretien" => "public/petitions#entretien"
  get "fr/petitions/interdiction-des-tests-sur-animaux-pour-les-produits-dentretien.html" => "public/petitions#entretien"
  
  
  

  
  
  
  
  namespace :admin do
    resources :detenus
    
    resources :investigation_cats do
      collection do
        post :reorder
      end


    end
    
    resources :contacts
    
    resources :survey_types do
      member do
        get :export
      end
    end
    
    
    resources :product_order_payments
    resources :product_orders do
      member do
        get :ship
        
        get :bill
      end
    end
    
    
    resources :product_sizes do
      collection do
        get :reorder
      end


    end
    resources :product_images do
      collection do
        get :reorder
      end


    end


    resources :militer_cats do
      collection do
        post :reorder
      end


    end


    resources :product_categories do
      collection do
        post :reorder
      end

      resources :product_collections

    end

    resources :products do
      collection do
        post :reorder
      end
      
      member do
        get :stock
      end
      
    end
    
    
    
    resources :don_tunnels do
      collection do
        get :general_stats

        
      end
      
      member do
        get :stats
        
      end
      
      
    end
    
    
    
    resources :petitions do
      collection do
        get :general_stats
        get :export
        get :export_p
        
      end
      
      member do
        get :stats
        
      end
      
      
    end
    
    resources :image_actu_albums do
      
    end
    
    resources :image_actus do
      member do
        get :rotate
      end
      
      collection do
        get :reorder
      end
    end
    
    
    resources :translations do
      collection do
        post :import
      end
    end
    resources :donator_transaction_exports do
      collection do
        get :export_today
      end
    end
    
    resources :recurrent_payments
    
    
    resources :recurrent_dates do
      member do
        get :paid
      end
    end
    resources :specific_maps do
      resources :specific_map_items do
        member do
          get :geoloc
        end
      end
      
    end
    
    resources :registrants do
      
      collection do
        get :import
        get :export_csv
      end
    end
    
    
    
    
    
    
    
    resources :donators
    resources :donator_transactions do
      
      member do
        get :edit_sepa
        post :save_sepa
          get :paid_by_alias
        
      end
        
        
      collection do
        get :export_cb
        get :export_iban
        get :import_past_recurrent
        
      end
    end
  end

  namespace :admin do
  get 'donators/import'
  end

  get "evenements/:id.html" => "public/events#show", :as => "public_event"
  get "evenements.html" => "public/events#index", :as => "public_events"
  get 'blog/:id.html' => "public/articles#show", :as => "public_article"
  
  get "fr/inscription-newsletter.html" => "public/registrants#new", :as => "new_public_registrant"
    
  get ":lang/blog/archives/:year/:month.html"=> "public/articles#archives", :as => :archive_public_article, :lang => "fr"
  get ":lang/blog/tags/:id.html"=> "public/articles#tags", :as => :public_tag, :lang => "fr"
	get ":lang/blog/categorie/:slug.:f"=> "public/articles#category", :as => :category_public_article, :f => "html", :lang => "fr"
  
  
	get ':lang/blog/:slug.:f' => 'public/articles#show', :as => :article, :f => "html"
	get ':lang/blog.:f' => 'public/articles#index', :as => :articles, :f => "html"
  
  get ':lang/petitions/:slug.:f' => 'public/petitions#show', :as => :petition, :f => "html"
  
  post ':lang/petitions/:slug.:f' => 'public/petition_signators#create', :as => :public_petition_signators, :f => "html"
	
  get ':lang/petitions/:slug/sign_by_facebook.:f' => 'public/petition_signators#create', :as => :facebook_public_petition_signator, :f => "html", :by_facebook => true
	
  
  
  
  
  get "sitemap.:f" => "public/sitemap#sitemap"
  namespace :public do
    resources :question_juridiques
    resources :politique_messages
    
    resources :specific_maps 
    resources :specific_map_items
    
    resources :press_releases
    resources :label_produits do
      collection do
        get :import
      end
    end
    resources :label_marques
    resources :label_familles
    resources :label_entreprises
    resources :label_distributeur_marques
    resources :label_distributeurs
    resources :label_categories
    resources :newsletters
    
    resources :registrants do
      
      member do
        get :email_validation
      end
    end
    resources :press_releases
    
    
    resources :petition_signators do
      
      member do 
        get :confirm
        get :thank
      end
      
      collection do
        get :import
      end
      
      
    end
    
    resources :petitions do
      member do 
        get :confirm
      end
      collection do
        get :chine
      end
    end
    resources :comments
    
  end
  
  namespace :portlet do
    resources :video_contents
    resources :petition_contents
    resources :timeline_history_contents
    resources :menu_item_link_contents
    resources :quote_contents
    resources :event_contents
    resources :break_contents
    resources :download_contents
    resources :dynamic_contents
    resources :gallery_contents
    resources :gallery_images do
      collection do
        get :reorder
      end
    end
    resources :html_contents
    resources :image_contents
    resources :link_contents
    resources :img_link_contents
    resources :text_contents
    resources :map_contents
    resources :title_contents
    resources :table_contents
    resources :block_contents
    resources :table_rows
    resources :table_cols
    resources :portlets do
      collection do
        post :reorder
      end
    end
  end
  
  namespace :admin do
    resources :question_juridiques
    resources :tiny_urls
    resources :animal_petition_signators do
      collection do
        get :import
        get :send_notifs
        
      end
    end
    resources :politiques do
      collection do
        get :import_depute
        get :import_senateur
        
      end
        
    end
    
    resources :article_authors
    resources :home_sliders
    resources :home_slider_slides do
      
      collection do
        get :reorder
      end
      
    end
    resources :label_produits
    resources :label_marques
    resources :label_familles
    resources :label_entreprises
    resources :label_distributeur_marques
    resources :label_distributeurs
    resources :label_categories
    
    
    resources :newsletters do
      member do
        get :history
        get :history_detail
        
        get "select_recipients"
        put "select_recipients"
        post "send_test"
        post "send_newsletter"
      end
    end
    
    
    resources :press_releases
    
    resources :sponsorship_animals
    resources :timeline_histories
    resources :timeline_years
    resources :timeline_contents
    
    
    
    
		resources :categories do
			collection do
				post :reorder
			end
		end
    resources :comments
    resources :articles do
      member do
        get :edit_menu_items
      end
    end
    resources :events
    
    resources :tags
    resources :password_resets
    
    resources :admin_auths do
        collection do 
          get :logout
        end
    end
    
    resources :admins
    
  
    
    resources :external_links do
      collection do
        get :cible
      end
    end
    
  
    resources :menus
    resources :menu_items do
      collection do
        get :cible
        post :reorder
        get :import
        get :anglais
        get :lien_anglais
        get :update_permalinks
      end
      member do
        get :clone
        get :clone_as_article
        get :edit_articles
      end
    end
    resources :image_files do
      member do
        get :rotate
      end
    end
    resources :file_folders
    resources :data_files
		resources :video_folders do
      member do
        get :change_video_folder
      end
    end
		resources :video_files
    resources :pages do
      member do
        get :copy_lang
      end
    end
    resources :menu_urls
    resources :menu_aliases
    resources :blocks
    resources :albums do
      member do
        get :change_album
      end
        
    end
    resources :cibles
  

  end
  
  resources :audio_files
  resources :video_files
  resources :download_data_files

  get 'fr/read/:token' => "public/data_files#read", :as => :read_data_file

  get 'admin' => "admin/admin_auths#index"
  
  
  
  
  
  get ':lang/*url.html' => 'public/menu_items#show', :as => :menu_item, :f => "html"
  get ':lang/*url.:f' => 'public/menu_items#redirect',  :f => "html"
  
  
  get "home2" => redirect('/')
  
  get "plan" => "public/home#plan"
  
  
  root 'public/home#coming'
  
 
  
 
  
  if !Rails.env.development?
    get '*path', to: 'public/menu_items#show'
  end
end
