CMSnb::Application.routes.draw do
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"

  
  get ':id/merci-pour-votre-question.html' => "public/questions#show", :as => "public_question"
  get 'me-contacter.html' => "public/questions#new", :as => "new_public_question"
  post 'me-contacter.html' => "public/questions#create", :as => "public_questions"
  
  
  get 'newsletters/:id.html' => "public/newsletters#show", :as => "newsletter"
  get 'newsletters.html' => "public/newsletters#index", :as => "newsletters"

  
  get 'articles/:id.html' => "public/articles#show", :as => "public_article"
  get 'articles.html' => "public/articles#index", :as => "articles"
  
  get 'boutique.html' => "public/home#boutique", :as => "shop"
  
  get "articles/archives/:year/:month.html"=> "public/articles#archives", :as => :archive_public_article 
  get "articles/tags/:id.html"=> "public/articles#tags", :as => :public_tag 
	get "categorie/:slug.:f"=> "public/articles#category", :as => :category_public_article, :f => "html"
	

	
  
  
  
  
  namespace :public do
    resources :contacts
    resources :questions
    resources :articles
    resources :testimonies
    resources :portfolios
    resources :artworks
    resources :comments
    resources :photos
    resources :quotes do
      collection do
        get :newphoto
        post :createphoto
      end
    end

  end
  
  
	namespace :portlet do
		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 :comments
    resources :photos
    resources :quotes
    
    resources :artworks do
			collection do
				post :reorder
			end
		end
    resources :portfolios
    resources :password_resets
    
		resources :articles
    resources :newsletters
		resources :categories do
			collection do
				post :reorder
			end
		end
		

    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 :pages
		resources :menu_urls
		resources :menu_aliases
		resources :blocks
		resources :albums
		
		resources :cibles
	

	end
  
  
  
  
  
  
  
  
  resources :download_data_files

  

  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/articles#index'


end
