<commit_before># config/routes.rb:
# Mapping URLs to controllers for FOIFA.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/
#
# $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $

ActionController::Routing::Routes.draw do |map|
    
    # The priority is based upon order of creation: first created -> highest priority.

    # Sample of regular route:
    # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
    # Keep in mind you can assign values other than :controller and :action

    # Allow easy extension from themes. Note these will have the highest priority.
    require 'config/custom-routes'
    
    map.with_options :controller => 'general' do |general|
        general.frontpage           '/',            :action => 'frontpage'
        general.blog '/blog', :action => 'blog'
        general.custom_css '/stylesheets/custom.css', :action => 'custom_css'
        general.search_redirect '/search',      :action => 'search_redirect'
        # XXX combined is the search query, and then if sorted a "/newest" at the end.
        # Couldn't find a way to do this in routes which also picked up multiple other slashes
        # and dots and other characters that can appear in search query. So we sort it all
        # out in the controller.
        general.search_general '/search/*combined/requests', :action => 'search', :view => 'requests'
        general.search_general '/search/*combined', :action => 'search'
        general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true

        general.random_request '/random', :action => 'random_request'

        general.fai_test '/test', :action => 'fai_test'
    end

    map.with_options :controller => 'request' do |request|
        request.request_list_recent   '/list/recent',        :action => 'list', :view => 'recent'
        request.request_list_all   '/list/all',        :action => 'list', :view => 'all'
        request.request_list_successful   '/list/successful',        :action => 'list', :view => 'successful'
        request.request_list_unsuccessful   '/list/unsuccessful',        :action => 'list', :view => 'unsuccessful'
        request.request_list_awaiting   '/list/awaiting',        :action => 'list', :view => 'awaiting'
        request.request_list   '/list',        :action => 'list'

        request.select_authority     '/select_authority',     :action => 'select_authority'
        
        request.new_request    '/new',         :action => 'new'
        request.new_request_to_body    '/new/:url_name',         :action => 'new'

        request.search_ahead '/request/search_ahead',      :action => 'search_typeahead'

        request.show_request     '/request/:url_title.:format', :action => 'show'
        request.show_new_request     '/request/:url_title/new', :action => 'show'
        request.details_request     '/details/request/:url_title', :action => 'details'
        request.similar_request     '/similar/request/:url_title', :action => 'similar'

        request.describe_state   '/request/:id/describe', :action => 'describe_state'
        request.show_response_no_followup    '/request/:id/response', :action => 'show_response'
        request.show_response    '/request/:id/response/:incoming_message_id', :action => 'show_response'
        request.get_attachment_as_html   '/request/:id/response/:incoming_message_id/attach/html/:part/*file_name', :action => 'get_attachment_as_html'
        request.get_attachment   '/request/:id/response/:incoming_message_id/attach/:part/*file_name', :action => 'get_attachment'

        request.info_request_event '/request_event/:info_request_event_id', :action => 'show_request_event'

        request.upload_response "/upload/request/:url_title", :action => 'upload_response'
        request.download_entire_request '/request/:url_title/download',      :action => 'download_entire_request'

    end

    # Use /profile for things to do with the currently signed in user.
    # Use /user/XXXX for things that anyone can see about that user.
    # Note that /profile isn't indexe by search (see robots.txt)
    map.with_options :controller => 'user' do |user|
        user.signin '/profile/sign_in',        :action => 'signin'
        user.signup '/profile/sign_up',        :action => 'signup'
        user.signout '/profile/sign_out',      :action => 'signout'

        user.confirm '/c/:email_token', :action => 'confirm'
        user.show_user '/user/:url_name.:format', :action => 'show'
        user.contact_user '/user/contact/:id', :action => 'contact'

        user.signchangepassword '/profile/change_password',      :action => 'signchangepassword'
        user.signchangeemail '/profile/change_email',      :action => 'signchangeemail'

        user.set_profile_photo '/profile/set_photo', :action => 'set_profile_photo'
        user.clear_profile_photo '/profile/clear_photo', :action => 'clear_profile_photo'
        user.get_profile_photo '/user/:url_name/photo.png', :action => 'get_profile_photo'
        user.get_draft_profile_photo '/profile/draft_photo/:id.png', :action => 'get_draft_profile_photo'
        user.set_profile_about_me '/profile/set_about_me', :action => 'set_profile_about_me'

        user.river '/profile/river', :action => 'river'
    end

    map.with_options :controller => 'public_body' do |body|
        body.search_ahead_bodies '/body/search_ahead',      :action => 'search_typeahead'
        body.list_public_bodies "/body", :action => 'list'
        body.list_public_bodies_default "/body/list/all", :action => 'list'
        body.list_public_bodies "/body/list/:tag", :action => 'list'
        body.list_public_bodies_redirect "/local/:tag", :action => 'list_redirect'
        body.all_public_bodies_csv "/body/all-authorities.csv", :action => 'list_all_csv'
        body.show_public_body "/body/:url_name.:format", :action => 'show', :view => 'all'
        body.show_public_body_all "/body/:url_name/all", :action => 'show', :view => 'all'
        body.show_public_body_successful "/body/:url_name/successful", :action => 'show', :view => "successful"
        body.show_public_body_unsuccessful "/body/:url_name/unsuccessful", :action => 'show', :view => "unsuccessful"
        body.show_public_body_awaiting "/body/:url_name/awaiting", :action => 'show', :view => "awaiting"
        body.show_public_body_tag "/body/:url_name/:tag", :action => 'show'
        body.show_public_body_tag_view "/body/:url_name/:tag/:view", :action => 'show'

        body.view_public_body_email "/body/:url_name/view_email", :action => 'view_email'
    end

    map.with_options :controller => 'comment' do |comment|
        comment.new_comment "/annotate/request/:url_title", :action => 'new', :type => 'request'<commit_msg>Reorder routes so view_email is not hidden. Fixes #194<commit_after># config/routes.rb:
# Mapping URLs to controllers for FOIFA.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/
#
# $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $

ActionController::Routing::Routes.draw do |map|
    
    # The priority is based upon order of creation: first created -> highest priority.

    # Sample of regular route:
    # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
    # Keep in mind you can assign values other than :controller and :action

    # Allow easy extension from themes. Note these will have the highest priority.
    require 'config/custom-routes'
    
    map.with_options :controller => 'general' do |general|
        general.frontpage           '/',            :action => 'frontpage'
        general.blog '/blog', :action => 'blog'
        general.custom_css '/stylesheets/custom.css', :action => 'custom_css'
        general.search_redirect '/search',      :action => 'search_redirect'
        # XXX combined is the search query, and then if sorted a "/newest" at the end.
        # Couldn't find a way to do this in routes which also picked up multiple other slashes
        # and dots and other characters that can appear in search query. So we sort it all
        # out in the controller.
        general.search_general '/search/*combined/requests', :action => 'search', :view => 'requests'
        general.search_general '/search/*combined', :action => 'search'
        general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true

        general.random_request '/random', :action => 'random_request'

        general.fai_test '/test', :action => 'fai_test'
    end

    map.with_options :controller => 'request' do |request|
        request.request_list_recent   '/list/recent',        :action => 'list', :view => 'recent'
        request.request_list_all   '/list/all',        :action => 'list', :view => 'all'
        request.request_list_successful   '/list/successful',        :action => 'list', :view => 'successful'
        request.request_list_unsuccessful   '/list/unsuccessful',        :action => 'list', :view => 'unsuccessful'
        request.request_list_awaiting   '/list/awaiting',        :action => 'list', :view => 'awaiting'
        request.request_list   '/list',        :action => 'list'

        request.select_authority     '/select_authority',     :action => 'select_authority'
        
        request.new_request    '/new',         :action => 'new'
        request.new_request_to_body    '/new/:url_name',         :action => 'new'

        request.search_ahead '/request/search_ahead',      :action => 'search_typeahead'

        request.show_request     '/request/:url_title.:format', :action => 'show'
        request.show_new_request     '/request/:url_title/new', :action => 'show'
        request.details_request     '/details/request/:url_title', :action => 'details'
        request.similar_request     '/similar/request/:url_title', :action => 'similar'

        request.describe_state   '/request/:id/describe', :action => 'describe_state'
        request.show_response_no_followup    '/request/:id/response', :action => 'show_response'
        request.show_response    '/request/:id/response/:incoming_message_id', :action => 'show_response'
        request.get_attachment_as_html   '/request/:id/response/:incoming_message_id/attach/html/:part/*file_name', :action => 'get_attachment_as_html'
        request.get_attachment   '/request/:id/response/:incoming_message_id/attach/:part/*file_name', :action => 'get_attachment'

        request.info_request_event '/request_event/:info_request_event_id', :action => 'show_request_event'

        request.upload_response "/upload/request/:url_title", :action => 'upload_response'
        request.download_entire_request '/request/:url_title/download',      :action => 'download_entire_request'

    end

    # Use /profile for things to do with the currently signed in user.
    # Use /user/XXXX for things that anyone can see about that user.
    # Note that /profile isn't indexe by search (see robots.txt)
    map.with_options :controller => 'user' do |user|
        user.signin '/profile/sign_in',        :action => 'signin'
        user.signup '/profile/sign_up',        :action => 'signup'
        user.signout '/profile/sign_out',      :action => 'signout'

        user.confirm '/c/:email_token', :action => 'confirm'
        user.show_user '/user/:url_name.:format', :action => 'show'
        user.contact_user '/user/contact/:id', :action => 'contact'

        user.signchangepassword '/profile/change_password',      :action => 'signchangepassword'
        user.signchangeemail '/profile/change_email',      :action => 'signchangeemail'

        user.set_profile_photo '/profile/set_photo', :action => 'set_profile_photo'
        user.clear_profile_photo '/profile/clear_photo', :action => 'clear_profile_photo'
        user.get_profile_photo '/user/:url_name/photo.png', :action => 'get_profile_photo'
        user.get_draft_profile_photo '/profile/draft_photo/:id.png', :action => 'get_draft_profile_photo'
        user.set_profile_about_me '/profile/set_about_me', :action => 'set_profile_about_me'

        user.river '/profile/river', :action => 'river'
    end

    map.with_options :controller => 'public_body' do |body|
        body.search_ahead_bodies '/body/search_ahead',      :action => 'search_typeahead'
        body.list_public_bodies "/body", :action => 'list'
        body.list_public_bodies_default "/body/list/all", :action => 'list'
        body.list_public_bodies "/body/list/:tag", :action => 'list'
        body.list_public_bodies_redirect "/local/:tag", :action => 'list_redirect'
        body.all_public_bodies_csv "/body/all-authorities.csv", :action => 'list_all_csv'
        body.show_public_body "/body/:url_name.:format", :action => 'show', :view => 'all'
        body.show_public_body_all "/body/:url_name/all", :action => 'show', :view => 'all'
        body.show_public_body_successful "/body/:url_name/successful", :action => 'show', :view => "successful"
        body.show_public_body_unsuccessful "/body/:url_name/unsuccessful", :action => 'show', :view => "unsuccessful"
        body.show_public_body_awaiting "/body/:url_name/awaiting", :action => 'show', :view => "awaiting"
        body.view_public_body_email "/body/:url_name/view_email", :action => 'view_email'
        body.show_public_body_tag "/body/:url_name/:tag", :action => 'show'
        body.show_public_body_tag_view "/body/:url_name/:tag/:view", :action => 'show'
    end

    map.with_options :controller => 'comment' do |comment|
        comment.new_comment "/annotate/request/:url_title", :action => 'new', :type => 'request'
{'fraction_non_alphanumeric': 0.14012552911983653, 'fraction_numerical': 0.0032841920887461684, 'mean_word_length': 3.2306267366471135, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 167, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6047784', 'n_tokens_mistral': 4122, 'n_tokens_neox': 4096, 'n_words': 921}