Rails.application.routes.draw do
  
  get ":lang/blog/tags/:tag_id.html"=> "public/articles#tags", :as => :tag_public_articles, :lang => "fr"
  
  
  get "robots.:f" => "public/seo#robots"
  get "sitemap.:f" => "public/seo#sitemap"
  


  


  

  get '/fr', :to => redirect("/fr/index.html")
  get '/en', :to => redirect("/en/index.html")

  scope "(:lang)", locale: /#{I18n.available_locales.join("|")}/ do
    get "contact.html" =>"public/contacts#new", :defaults => {:raison_id => 1}, :as => :general_contact
  end
  
  
  get 'u/:id' => 'tiny_urls#show', :as => :tiny_url
    
 
  get "produits/:id" => "public/d_products#show", :as => :public_d_product
  
  get ":lang/search" => "public/search#search", :as => :search

  
  
 

  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 ":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
	
  
  
  
  
  
  namespace :public do
    resources :contacts
    
    
    resources :specific_maps 
    resources :specific_map_items
    
   
    resources :comments
    
  end
  
  namespace :portlet do
    resources :share_contents
    resources :slide_contents
    resources :agir_contents
    resources :time_contents
    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 :keynumber_contents
    resources :articleindexs_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 :d_products
    resources :mail_contents
    resources :mail_templates

    resources :contact_files
    resources :contacts do
      collection do
        post :api
      end
    end
    resources :contact_actions

    resources :translations do
      collection do
        post :import
      end
    end

    

    resources :specific_maps do
      resources :specific_map_items do
        member do
          get :geoloc
        end
      end
      
    end
    
    
    resources :edit_watchers
    resources :specific_preferences
    resources :popups
    resources :tiny_urls
    
    resources :article_authors
    resources :home_sliders
    resources :home_slider_slides do
      
      collection do
        get :reorder
      end
      
    end
    
  
    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 :tags
    resources :password_resets
    
    resources :admin_auths do
        collection do 
          get :logout
        end
    end
    
    resources :admins
    resources :admin_roles
  
    
    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 'admin/new_site' => "admin/admin_auths#new_site"
  
  
  
  
  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#home'
  
 
  
 
  
  if !Rails.env.development?
    get '*path', to: 'public/menu_items#show'
  end
end
