Rails.application.routes.draw do
  
  
  namespace :admin do
    resources :order_hists do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :import_csvs do 
      member do
        get :charge
      end
    end  
  end
  
  
  namespace :admin do
    resources :order_hist_lines do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :p_customer_product_prices do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    
    resources :timer_watchers
    
    resources :open_ranges do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :admin_permissions
    resources :p_product_sub_cats do 
      member do
        
      end
			collection do
				post :reorder
			end
    end  
  end

  namespace :admin do
    resources :market_discounts do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :p_commercial_cats do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :p_product_features do 
      member do
        
      end
      collection do
        
      end
    end  
    resources :p_product_feature_cats do 
      member do
        
      end
      collection do
        
      end
    end  
    resources :p_product_refs do
      collection do
        get :autocomplete
      end
      
      member do
        get :autocomplete_apercu
        get :get_infos
      end
      
    end
    resources :p_product_prices do 
      member do
        
      end
      collection do
        
      end
    end  
    resources :p_price_cats do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :s_brands do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :tva_rates do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :accounting_zones do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :price_documents do 
      member do
        get :print
      end
      collection do
        get :search_to_affect
        
      end
    end  
  end

  namespace :admin do
    resources :price_line_blocks do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :price_lines do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do

    
    
    get "navision/index" => "navision#index"
    get "navision/show" => "navision#show"
    
    get "navision/export_a_sale" => "navision#export_a_sale"
    get "navision/export_sale" => "navision#export_sale"
    get "navision/export_purchase" => "navision#export_purchase"
    
    get "navision/get_account" => "navision#get_account"
    
    get "navision/file" => "navision#file"
    
    

    resources :s_compta_accounts do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :i_tasks
    resources :i_task_projects do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  namespace :admin do
    resources :s_organisations do 
      member do
        
      end
      collection do
        
      end
    end  
  end

  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 ":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 :s_site_types
    resources :s_sites
    resources :s_module_configurations
    resources :s_modules
    resources :s_modules_states
    resources :a_sites
    
    resources :p_compta_exports do
      member do 
        get :lock
      end
    end
    resources :export_comptas
    
    resources :p_commercials
    resources :particulars
    resources :p_sheet_lines do
      member do
        get :decrement
        get :cancel
      end
    end
    
    resources :p_ship_tour_truck_sheet_lines
    
    resources :p_remises do
      collection do
        post :new_f
      end
      
      member do
        get :print
      end
    end
    resources :p_banks
    resources :p_bank_accounts
    resources :p_product_specs
    resources :p_ship_bills
    resources :p_stats
    resources :p_payment_types
    resources :p_payments do
      collection do
        get :relances
        get :import
        post :import
        get :import_arrondis
        get :import_lettrage
        
      end
    end
    resources :p_drivers
    resources :p_document_type
    resources :p_documents do
      member do
        get :create_avoir
        post :save_avoir
        get :detail
      end
      collection do
        get :search_to_affect
        get :doublons
        get :multiple
      end
    end
    resources :p_trucks
    resources :p_product_cats
    resources :p_fournisseur_orders do
      collection do
        get :export
      end
    end
    
    
    resources :p_brut_products
    resources :p_tanks
    resources :p_products do
      collection do
        get :autocomplete
        get :import
        get :import2
      end
      
      member do
        get :autocomplete_apercu
      end
      
    end
    resources :p_fournisseurs do
      collection do
        get :import
        
        
      end
      
    end
    
    resources :p_customers do
      
      resources :p_documents
      
      member do
        get :etat
        get :archive_import
      end
      
      collection do
        get :etat
        get :autocomplete
        get :import
        get :import_cat
        
        get :import3
        
      end
      
      member do
        get :autocomplete_apercu
      end
    end
    
    resources :p_customer_cats
    
    resources :p_ship_tours do
      member do
        get :generate_bills
        get :to_ship
        get :to_unship
        get :unship_return
        get :ship_return
        post :ship_return_save
        get :adr
      end
    end
    resources :p_volucompteurs
    
    
    resources :p_ship_tour_trucks do
      member do 
        post :update_ship_tour_truck_sheet_lines
        get :urg_ship
        
        get :new_volucompteur
        post :create_volucompteur
        
        
        
      end
    end
    resources :p_trucks
    resources :p_truck_spaces
    
    resources :p_customer_sheets do
      member do
        get :generate_d
        get :generate_fp
        get :generate_bc
        get :generate_bl
        get :generate_f
        get :reject
        get :unreject
        get :cancel
        get :uncancel
        
        get :urg_ship
        
        
        get :set_sheet_line_ship
        post :set_sheet_line_ship_save
        
      end
      collection do
        get :affects
        get :update_stocks
      end
    end
    
    resources :mail_contents
    resources :mail_templates

    resources :contacts

    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 "admin/admin_auths#index"
  
 
  
 
  
  if !Rails.env.development?
    get '*path', to: 'public/menu_items#show'
  end
end
