<commit_before>class AnonymousConstraint
  def self.matches?(request)
    # TODO authlogic
    !request.cookies.has_key? 'account_credentials'
  end
end


# http://guides.rails.info/routing.html
# http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/
#
LinuxfrOrg::Application.routes.draw do
  # These routes are here only for cacheability reasons
  constraints(AnonymousConstraint) do
    get '/'         => 'home#anonymous'
    get '/news/:id' => 'news#anonymous'
  end

  root :to => 'home#index'

  # News
  resources :sections, :only => [:index, :show]
  get '/news(.:format)' => 'news#index', :as => 'news_index'
  resources :news, :only => [:show, :new, :create]
  get '/redirect/:id' => 'links#show'

  # Diaries & Users
  resources :users, :only => [:show] do
    resources :diaries, :as => 'journaux', :except => [:index, :new, :create]
  end
  resources :diaries, :only => [:index, :new, :create]

  # Forums
  resources :forums, :only => [:index, :show] do
    resources :posts, :except => [:new, :create]
  end
  resources :posts, :only => [:new, :create]

  # Other contents
  resources :polls, :as => 'sondages', :except => [:edit, :update, :destroy] do
    post :vote, :on => :member
  end
  resources :trackers, :as => 'suivi' do
    get :comments, :on => :collection
  end
  resources :wiki_pages, :as => 'wiki' do
    get :changes, :on => :collection
    get '/revisions/:revision' => 'wiki_pages#revision', :as => :revision, :on => :member
  end

  # Nodes
  get '/tableau-de-bord' => 'dashboard#index', :as => :dashboard
  resources :nodes, :only => [] do
    resources :comments do
      get :answer, :on => :member
      post '/relevance/:action' => 'relevances#index', :as => :relevance, :on => :member
    end
    resources :tags, :only => [:new, :create]
    post '/vote/:action' => 'votes#index', :as => :vote, :on => :member
  end
  resources :tags, :only => [:index, :show] do
    get :autocomplete, :on => :collection
    get :public, :on => :member
  end

  # Boards
  post '/board/add' => 'boards#add', :as => :add_board
  get  '/board' => 'boards#show', :as => :free_board
  get  '/board/index.xml' => 'boards#show', :as => :free_board_xml, :format => 'xml'

  # Accounts
  devise_for :account, :as => 'compte', :controllers => {
    :sessions = "sessions"
  }, :path_names => {
    :sign_in  => 'connexion',
    :sign_out => 'deconnexion',
    :sign_up  => 'inscription',
    :unlock   => 'debloquage'
  }
  resource :stylesheet, :only => [:edit, :create, :destroy]

  # Search
  get '/recherche' => 'search#index', :as => :search
  get '/recherche/:type' => 'search#type', :as => :search_by_type
  get '/recherche/:type/:facet' => 'search#facet', :as => :search_by_facet

  # Redaction
  namespace :redaction do
    root :to => 'redaction#index'
    resources :news, :except => [:new, :destroy] do<commit_msg>Fix a typo (thanks dmathieu)<commit_after>class AnonymousConstraint
  def self.matches?(request)
    # TODO authlogic
    !request.cookies.has_key? 'account_credentials'
  end
end


# http://guides.rails.info/routing.html
# http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/
#
LinuxfrOrg::Application.routes.draw do
  # These routes are here only for cacheability reasons
  constraints(AnonymousConstraint) do
    get '/'         => 'home#anonymous'
    get '/news/:id' => 'news#anonymous'
  end

  root :to => 'home#index'

  # News
  resources :sections, :only => [:index, :show]
  get '/news(.:format)' => 'news#index', :as => 'news_index'
  resources :news, :only => [:show, :new, :create]
  get '/redirect/:id' => 'links#show'

  # Diaries & Users
  resources :users, :only => [:show] do
    resources :diaries, :as => 'journaux', :except => [:index, :new, :create]
  end
  resources :diaries, :only => [:index, :new, :create]

  # Forums
  resources :forums, :only => [:index, :show] do
    resources :posts, :except => [:new, :create]
  end
  resources :posts, :only => [:new, :create]

  # Other contents
  resources :polls, :as => 'sondages', :except => [:edit, :update, :destroy] do
    post :vote, :on => :member
  end
  resources :trackers, :as => 'suivi' do
    get :comments, :on => :collection
  end
  resources :wiki_pages, :as => 'wiki' do
    get :changes, :on => :collection
    get '/revisions/:revision' => 'wiki_pages#revision', :as => :revision, :on => :member
  end

  # Nodes
  get '/tableau-de-bord' => 'dashboard#index', :as => :dashboard
  resources :nodes, :only => [] do
    resources :comments do
      get :answer, :on => :member
      post '/relevance/:action' => 'relevances#index', :as => :relevance, :on => :member
    end
    resources :tags, :only => [:new, :create]
    post '/vote/:action' => 'votes#index', :as => :vote, :on => :member
  end
  resources :tags, :only => [:index, :show] do
    get :autocomplete, :on => :collection
    get :public, :on => :member
  end

  # Boards
  post '/board/add' => 'boards#add', :as => :add_board
  get  '/board' => 'boards#show', :as => :free_board
  get  '/board/index.xml' => 'boards#show', :as => :free_board_xml, :format => 'xml'

  # Accounts
  devise_for :account, :as => 'compte', :controllers => {
    :sessions => "sessions"
  }, :path_names => {
    :sign_in  => 'connexion',
    :sign_out => 'deconnexion',
    :sign_up  => 'inscription',
    :unlock   => 'debloquage'
  }
  resource :stylesheet, :only => [:edit, :create, :destroy]

  # Search
  get '/recherche' => 'search#index', :as => :search
  get '/recherche/:type' => 'search#type', :as => :search_by_type
  get '/recherche/:type/:facet' => 'search#facet', :as => :search_by_facet

  # Redaction
  namespace :redaction do
    root :to => 'redaction#index'
    resources :news, :except => [:new, :destroy] do
{'fraction_non_alphanumeric': 0.18815513626834382, 'fraction_numerical': 0.0031446540880503146, 'mean_word_length': 3.6057924376508446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 128, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1627445', 'n_tokens_mistral': 2077, 'n_tokens_neox': 2040, 'n_words': 521}