<commit_before>#   Copyright (c) 2010, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

Diaspora::Application.routes.draw do

  # Posting and Reading

  resources :aspects do
    get 'manage'                    => :manage, :on => :collection
    put 'toggle_contact_visibility' => :toggle_contact_visibility
  end

  resources :status_messages, :only => [:new, :create, :destroy, :show]
  get 'p/:id' => 'posts#show', :as => 'post'

  resources :photos, :except => [:index] do
    put 'make_profile_photo' => :make_profile_photo
  end

  resources :comments, :only => [:create, :destroy]

  get 'tags/:name' => 'tags#show', :as => 'tag'
  resources :tags, :only => [:index]

  resource :like, :only => [:create]

  resources :conversations do
    resources :messages, :only => [:create, :show]
    delete 'visibility' => 'conversation_visibilities#destroy'
  end

  resources :notifications, :only => [:index, :update] do
    get 'read_all' => :read_all, :on => :collection
  end


  # Users and people

  resource :user, :only => [:edit, :update, :destroy], :shallow => true do
    get :export
    get :export_photos
  end
  match '/people/:id/contacts' => 'people#contacts'

  controller :users do
    get 'public/:username'          => :public,          :as => 'users_public'
    match 'getting_started'         => :getting_started, :as => 'getting_started'
    get 'getting_started_completed' => :getting_started_completed
  end

  # This is a hack to overide a route created by devise.
  # I couldn't find anything in devise to skip that route, see Bug #961
  match 'users/edit' => redirect('/user/edit')

  devise_for :users, :controllers => {:registrations => "registrations",
                                      :password      => "<PASSWORD>",
                                      :sessions      => "sessions",
                                      :invitations   => "invitations"} do
    get 'invitations/resend/:id' => 'invitations#resend', :as => 'invitation_resend'
  end
  get 'login' => redirect('/users/sign_in')

  scope 'admins', :controller => :admins do
    match 'user_search' => :user_search
    get 'admin_inviter' => :admin_inviter
    get 'add_invites' => :add_invites, :as => 'add_invites'
  end

  get 'bookmarklet' => 'status_messages#bookmarklet'
  resource :profile

  resources :requests, :only => [:destroy, :create]

  resources :contacts, :except => [:index, :update]
  resources :aspect_memberships, :only => [:destroy, :create, :update]
  resources :post_visibilities, :only => [:update]

  resources :people, :except => [:edit, :update] do
    resources :status_messages
    resources :photos
    post 'by_handle' => :retrieve_remote, :on => :collection, :as => 'person_by_handle'
  end


  # Federation
<commit_msg>(minor change) move bookmarklet route to the right place<commit_after>#   Copyright (c) 2010, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

Diaspora::Application.routes.draw do

  # Posting and Reading

  resources :aspects do
    get 'manage'                    => :manage, :on => :collection
    put 'toggle_contact_visibility' => :toggle_contact_visibility
  end

  resources :status_messages, :only => [:new, :create, :destroy, :show]
  get 'p/:id' => 'posts#show', :as => 'post'
  get 'bookmarklet' => 'status_messages#bookmarklet'

  resources :photos, :except => [:index] do
    put 'make_profile_photo' => :make_profile_photo
  end

  resources :comments, :only => [:create, :destroy]

  get 'tags/:name' => 'tags#show', :as => 'tag'
  resources :tags, :only => [:index]

  resource :like, :only => [:create]

  resources :conversations do
    resources :messages, :only => [:create, :show]
    delete 'visibility' => 'conversation_visibilities#destroy'
  end

  resources :notifications, :only => [:index, :update] do
    get 'read_all' => :read_all, :on => :collection
  end


  # Users and people

  resource :user, :only => [:edit, :update, :destroy], :shallow => true do
    get :export
    get :export_photos
  end
  match '/people/:id/contacts' => 'people#contacts'

  controller :users do
    get 'public/:username'          => :public,          :as => 'users_public'
    match 'getting_started'         => :getting_started, :as => 'getting_started'
    get 'getting_started_completed' => :getting_started_completed
  end

  # This is a hack to overide a route created by devise.
  # I couldn't find anything in devise to skip that route, see Bug #961
  match 'users/edit' => redirect('/user/edit')

  devise_for :users, :controllers => {:registrations => "registrations",
                                      :password      => "<PASSWORD>",
                                      :sessions      => "sessions",
                                      :invitations   => "invitations"} do
    get 'invitations/resend/:id' => 'invitations#resend', :as => 'invitation_resend'
  end
  get 'login' => redirect('/users/sign_in')

  scope 'admins', :controller => :admins do
    match 'user_search' => :user_search
    get 'admin_inviter' => :admin_inviter
    get 'add_invites' => :add_invites, :as => 'add_invites'
  end

  resource :profile

  resources :requests, :only => [:destroy, :create]

  resources :contacts, :except => [:index, :update]
  resources :aspect_memberships, :only => [:destroy, :create, :update]
  resources :post_visibilities, :only => [:update]

  resources :people, :except => [:edit, :update] do
    resources :status_messages
    resources :photos
    post 'by_handle' => :retrieve_remote, :on => :collection, :as => 'person_by_handle'
  end


  # Federation

{'fraction_non_alphanumeric': 0.13818436242784676, 'fraction_numerical': 0.002798670631450061, 'mean_word_length': 3.207505518763797, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4776078', 'n_tokens_mistral': 1859, 'n_tokens_neox': 1749, 'n_words': 508}