<commit_before># encoding: utf-8

# NOTES:
# (/u/:user_domain)                -> This allows support of org-urls (support != enforcement)
# defaults: { dont_rewrite: true } -> Use this to force an individual action to not get rewritten to org-url
# Can be also done at controller source files by using -> skip_before_filter :ensure_org_url_if_org_user

CartoDB::Application.routes.draw do
  # Double use: for user public dashboard AND org dashboard
  root :to => 'admin/pages#public'

  get   '(/u/:user_domain)/login'           => 'sessions#new',     as: :login
  get   '(/u/:user_domain)/logout'          => 'sessions#destroy', as: :logout
  match '(/u/:user_domain)/sessions/create' => 'sessions#create',  as: :create_session

  match '/limits' => 'home#limits', as: :limits
  match '/status' => 'home#app_status'

  # OAuth
  match '(/u/:user_domain)/oauth/authorize'      => 'oauth#authorize',     as: :authorize
  match '(/u/:user_domain)/oauth/request_token'  => 'oauth#request_token', as: :request_token
  match '(/u/:user_domain)/oauth/access_token'   => 'oauth#access_token',  as: :access_token
  get   '(/u/:user_domain)/oauth/identity'       => 'sessions#show',       as: :oauth_show_sessions

  # Internally, some of this methods will forcibly rewrite to the org-url if user belongs to an organization
  scope :module => :admin do

    # Organization dashboard page
    get    '(/u/:user_domain)/organization'                 => 'organizations#show',            as: :organization
    get    '(/u/:user_domain)/organization/settings'        => 'organizations#settings',        as: :organization_settings
    put    '(/u/:user_domain)/organization/settings'        => 'organizations#settings_update', as: :organization_settings_update
    # Organization users management
    get    '(/u/:user_domain)/organization/users/:id/edit'  => 'users#edit',    as: :edit_organization_user,   constraints: { id: /[0-z\.\-]+/ }
    put    '(/u/:user_domain)/organization/users/:id'       => 'users#update',  as: :update_organization_user, constraints: { id: /[0-z\.\-]+/ }
    post   '(/u/:user_domain)/organization/users'           => 'users#create',  as: :create_organization_user
    delete '(/u/:user_domain)/organization/users/:id'       => 'users#destroy', as: :delete_organization_user, constraints: { id: /[0-z\.\-]+/ }
    get    '(/u/:user_domain)/organization/users/new'       => 'users#new',     as: :new_organization_user

    # search
    get '(/u/:user_domain)/dashboard/search/:q'               => 'visualizations#index', as: :search
    get '(/u/:user_domain)/dashboard/search/:q/:page'         => 'visualizations#index', as: :search_page<commit_msg>#1693 Removed dead endpoint<commit_after># encoding: utf-8

# NOTES:
# (/u/:user_domain)                -> This allows support of org-urls (support != enforcement)
# defaults: { dont_rewrite: true } -> Use this to force an individual action to not get rewritten to org-url
# Can be also done at controller source files by using -> skip_before_filter :ensure_org_url_if_org_user

CartoDB::Application.routes.draw do
  # Double use: for user public dashboard AND org dashboard
  root :to => 'admin/pages#public'

  get   '(/u/:user_domain)/login'           => 'sessions#new',     as: :login
  get   '(/u/:user_domain)/logout'          => 'sessions#destroy', as: :logout
  match '(/u/:user_domain)/sessions/create' => 'sessions#create',  as: :create_session

  match '/status' => 'home#app_status'

  # OAuth
  match '(/u/:user_domain)/oauth/authorize'      => 'oauth#authorize',     as: :authorize
  match '(/u/:user_domain)/oauth/request_token'  => 'oauth#request_token', as: :request_token
  match '(/u/:user_domain)/oauth/access_token'   => 'oauth#access_token',  as: :access_token
  get   '(/u/:user_domain)/oauth/identity'       => 'sessions#show',       as: :oauth_show_sessions

  # Internally, some of this methods will forcibly rewrite to the org-url if user belongs to an organization
  scope :module => :admin do

    # Organization dashboard page
    get    '(/u/:user_domain)/organization'                 => 'organizations#show',            as: :organization
    get    '(/u/:user_domain)/organization/settings'        => 'organizations#settings',        as: :organization_settings
    put    '(/u/:user_domain)/organization/settings'        => 'organizations#settings_update', as: :organization_settings_update
    # Organization users management
    get    '(/u/:user_domain)/organization/users/:id/edit'  => 'users#edit',    as: :edit_organization_user,   constraints: { id: /[0-z\.\-]+/ }
    put    '(/u/:user_domain)/organization/users/:id'       => 'users#update',  as: :update_organization_user, constraints: { id: /[0-z\.\-]+/ }
    post   '(/u/:user_domain)/organization/users'           => 'users#create',  as: :create_organization_user
    delete '(/u/:user_domain)/organization/users/:id'       => 'users#destroy', as: :delete_organization_user, constraints: { id: /[0-z\.\-]+/ }
    get    '(/u/:user_domain)/organization/users/new'       => 'users#new',     as: :new_organization_user

    # search
    get '(/u/:user_domain)/dashboard/search/:q'               => 'visualizations#index', as: :search
    get '(/u/:user_domain)/dashboard/search/:q/:page'         => 'visualizations#index', as: :search_page
{'fraction_non_alphanumeric': 0.15704039260098152, 'fraction_numerical': 0.0022650056625141564, 'mean_word_length': 3.2699435938759067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4285491', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1686, 'n_words': 367}