Rename browse controller to feature queries controller
This commit is contained in:
parent
8878c963f3
commit
cca07cf0b5
6 changed files with 11 additions and 10 deletions
|
@ -4,7 +4,7 @@ class Ability
|
|||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
can :query, :browse
|
||||
can :read, :feature_query
|
||||
can :read, [Node, Way, Relation, OldNode, OldWay, OldRelation]
|
||||
can [:show, :create], Note
|
||||
can :search, :direction
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
class BrowseController < ApplicationController
|
||||
class FeatureQueriesController < ApplicationController
|
||||
layout :map_layout
|
||||
|
||||
before_action :authorize_web
|
||||
before_action :set_locale
|
||||
before_action -> { check_database_readable(:need_api => true) }
|
||||
before_action :require_oauth
|
||||
before_action :update_totp, :only => [:query]
|
||||
before_action :update_totp
|
||||
around_action :web_timeout
|
||||
authorize_resource :class => false
|
||||
|
||||
def query; end
|
||||
def show; end
|
||||
end
|
|
@ -417,7 +417,8 @@ en:
|
|||
telephone_link: "Call %{phone_number}"
|
||||
colour_preview: "Colour %{colour_value} preview"
|
||||
email_link: "Email %{email}"
|
||||
query:
|
||||
feature_queries:
|
||||
show:
|
||||
title: "Query Features"
|
||||
introduction: "Click on the map to find nearby features."
|
||||
nearby: "Nearby features"
|
||||
|
|
|
@ -204,7 +204,7 @@ OpenStreetMap::Application.routes.draw do
|
|||
get "/offline" => "site#offline"
|
||||
get "/key" => "site#key"
|
||||
get "/id" => "site#id"
|
||||
get "/query" => "browse#query"
|
||||
resource :feature_query, :path => "query", :only => :show
|
||||
post "/user/:display_name/confirm/resend" => "confirmations#confirm_resend", :as => :user_confirm_resend
|
||||
match "/user/:display_name/confirm" => "confirmations#confirm", :via => [:get, :post]
|
||||
match "/user/confirm" => "confirmations#confirm", :via => [:get, :post]
|
||||
|
|
|
@ -6,13 +6,13 @@ class BrowseControllerTest < ActionDispatch::IntegrationTest
|
|||
def test_routes
|
||||
assert_routing(
|
||||
{ :path => "/query", :method => :get },
|
||||
{ :controller => "browse", :action => "query" }
|
||||
{ :controller => "feature_queries", :action => "show" }
|
||||
)
|
||||
end
|
||||
|
||||
def test_query
|
||||
get query_path
|
||||
def test_show
|
||||
get feature_query_path
|
||||
assert_response :success
|
||||
assert_template "browse/query"
|
||||
assert_template "feature_queries/show"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue