# -*- encoding : utf-8 -*-

Pharma::Application.routes.draw do


	resources :download_data_files

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

	namespace :public do
		resources :inscrits do 
	      member do
	        get :verify_key
	        get :delete
	      end
	    end
		resources :newsletter
	end
	

	namespace :admin do
		root :to => "dashboard#index"
		
		resources :inscrits
		resources :interests
		resources :newsletters do
			member do
				post :send_test
		
				get :send_newsletter
			end
		end
		
		resources :external_links do
			collection do
				get :cible
			end
		end
		

		resources :articles
		resources :admins
		resources :menus
		resources :menu_items do
			collection do
				get :cible
			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
	
		
		resources :events

	end 


	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
				get :reorder
			end
		end
	end


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

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

	
end
