Crossey2::Application.routes.draw do
  
  

	devise_for :admins, :controllers => {:sessions => "admin/sessions", :passwords => "admin/passwords"}


#blog
	
	match "blog_ecologie/categorie/:slug.:f"=> "public/articles#category", :as => :category_public_article, :f => "html"
	


	match "blog_ecologie/archives/:year/:month"=> "public/articles#archives", :as => :archive_public_article 
	
	match 'blog_ecologie/:slug.:f' => 'public/articles#show', :as => :article, :f => "html"
	match 'blog_ecologie.:f' => 'public/articles#index', :as => :articles, :f => "html"
	match "blog_ecologie/tags/:id.:f"=> "public/tags#show", :as => :public_tag , :f => "html"
	
	namespace :admin do
		resources :articles
		resources :categories
	end


	#CMS
	match 'pages/*url.:f' => 'public/menu_items#show', :as => :menu_item, :f => "html"
	
	resources :download_data_files



	namespace :portlet do
		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 :events
		resources :actualities
		
		
		root :to => "dashboard#index"
		resources :admins
	
		
		resources :external_links do
			collection do
				get :cible
			end
		end
		
	
		resources :menus
		resources :menu_items do
			collection do
				get :cible
			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

	root :to => "public/home#home"
	
end
