Rails.application.routes.draw do
  

  namespace :admin do
    resources :realisation_images do
      collection do
        get :reorder 
      end
            
            
    end
    resources :realisations
          
          
      
  end

  namespace :admin do
  get 'donators/import'
  end


  #get 'contact.html' => 'public/menu_items#contact'
 # get "contact/new"

  #post "contact/create"
  
  
  get "evenements/:id.html" => "public/events#show", :as => "public_event"
  get "evenements.html" => "public/events#index", :as => "public_events"
  
  
  get 'actualite/:id.html' => "public/articles#show", :as => "public_article"
  
  
    
  get "actualite/archives/:year/:month.html"=> "public/articles#archives", :as => :archive_public_article 
  get "actualite/tags/:id.html"=> "public/articles#tags", :as => :public_tag 
	get "categorie/:slug.:f"=> "public/articles#category", :as => :category_public_article, :f => "html"
  
  
	get ':lang/actualite/:slug.:f' => 'public/articles#show', :as => :article, :f => "html"
	get 'actualites.:f' => 'public/articles#index', :as => :public_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 'faire-un-don' => redirect("https://faireundon.test.com/?cid=1/"), :as => :new_public_donator_transaction
  get 'parrainage' => "public/sponsorship_animals#index", :as => :public_sponsorship_animals
  get "sitemap.:f" => "public/sitemap#sitemap"
  namespace :public do
    
		resources :registrants do
			member do
				get :email_validation
			end
      
		end
		resources :newsletter
    
    resources :reservations
    
    
    resources :contacts
    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 :sponsorship_animals do
      
      member do
        post :donate_save
        
        get :paid_by_payplug
        get :paid_by_payplug_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_payplug
        get :paid_by_payplug_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 :petition_signators do
      
      member do 
        get :confirm
        get :thank
      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 :registrants do
      collection do
        get :import
      end
    end

		resources :newsletters do
			member do
				post :send_test
				get :select_recipients
				post :select_recipients
				post:send_newsletter
			end
		end
    
    
		resources :reservations
    resources :big_menus do
      member do
        post :reorder
      end
    end
    resources :big_menu_items
    
    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 :petitions do
    
    end
    
    
		resources :categories do
			collection do
				post :reorder
			end
		end
    resources :comments
    resources :articles
    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
      end
      member do
        get :clone
      end
    end
    resources :image_files do
      member do
        get :rotate
      end
    end
    resources :file_folders
    resources :data_files
		resources :video_folders
		resources :video_files
    resources :pages do
      member do
        get :copy_lang
      end
    end
    resources :menu_urls
    resources :menu_aliases
    resources :blocks
    resources :albums
    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 '*url.html' => 'public/menu_items#show', :as => :menu_item, :f => "html"
  get '*url.:f' => 'public/menu_items#redirect',  :f => "html"
  
  
  root 'public/menu_items#show'
  if !Rails.env.development?
    get '*path', to: 'public/menu_items#show'
  end
end
