Add empty pd declaration page
This commit is contained in:
parent
2074e9dce2
commit
62b70f45bc
6 changed files with 49 additions and 1 deletions
|
@ -29,7 +29,7 @@ class Ability
|
||||||
|
|
||||||
if user&.active?
|
if user&.active?
|
||||||
can :welcome, :site
|
can :welcome, :site
|
||||||
can :read, [:deletion, :account_terms]
|
can :read, [:deletion, :account_terms, :account_pd_declaration]
|
||||||
|
|
||||||
if Settings.status != "database_offline"
|
if Settings.status != "database_offline"
|
||||||
can [:subscribe, :unsubscribe], Changeset
|
can [:subscribe, :unsubscribe], Changeset
|
||||||
|
|
12
app/controllers/accounts/pd_declarations_controller.rb
Normal file
12
app/controllers/accounts/pd_declarations_controller.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
module Accounts
|
||||||
|
class PdDeclarationsController < ApplicationController
|
||||||
|
layout "site"
|
||||||
|
|
||||||
|
before_action :authorize_web
|
||||||
|
before_action :set_locale
|
||||||
|
|
||||||
|
authorize_resource :class => :account_pd_declaration
|
||||||
|
|
||||||
|
def show; end
|
||||||
|
end
|
||||||
|
end
|
3
app/views/accounts/pd_declarations/show.html.erb
Normal file
3
app/views/accounts/pd_declarations/show.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<% content_for :heading do %>
|
||||||
|
<h1><%= t ".title" %></h1>
|
||||||
|
<% end %>
|
|
@ -324,6 +324,9 @@ en:
|
||||||
terms_declined_html: We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see %{terms_declined_link}.
|
terms_declined_html: We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see %{terms_declined_link}.
|
||||||
terms_declined_link: this wiki page
|
terms_declined_link: this wiki page
|
||||||
terms_declined_url: https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined
|
terms_declined_url: https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined
|
||||||
|
pd_declarations:
|
||||||
|
show:
|
||||||
|
title: Consider my contributions to be in the Public Domain
|
||||||
browse:
|
browse:
|
||||||
deleted_ago_by_html: "Deleted %{time_ago} by %{user}"
|
deleted_ago_by_html: "Deleted %{time_ago} by %{user}"
|
||||||
edited_ago_by_html: "Edited %{time_ago} by %{user}"
|
edited_ago_by_html: "Edited %{time_ago} by %{user}"
|
||||||
|
|
|
@ -279,6 +279,7 @@ OpenStreetMap::Application.routes.draw do
|
||||||
resource :account, :only => [:edit, :update, :destroy] do
|
resource :account, :only => [:edit, :update, :destroy] do
|
||||||
scope :module => :accounts do
|
scope :module => :accounts do
|
||||||
resource :terms, :only => [:show, :update]
|
resource :terms, :only => [:show, :update]
|
||||||
|
resource :pd_declaration, :only => :show
|
||||||
resource :deletion, :only => :show
|
resource :deletion, :only => :show
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
29
test/controllers/accounts/pd_declarations_controller_test.rb
Normal file
29
test/controllers/accounts/pd_declarations_controller_test.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
module Accounts
|
||||||
|
class PdDeclarationsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
##
|
||||||
|
# test all routes which lead to this controller
|
||||||
|
def test_routes
|
||||||
|
assert_routing(
|
||||||
|
{ :path => "/account/pd_declaration", :method => :get },
|
||||||
|
{ :controller => "accounts/pd_declarations", :action => "show" }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_show_not_logged_in
|
||||||
|
get account_pd_declaration_path
|
||||||
|
|
||||||
|
assert_redirected_to login_path(:referer => account_pd_declaration_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_show_agreed
|
||||||
|
user = create(:user)
|
||||||
|
session_for(user)
|
||||||
|
|
||||||
|
get account_pd_declaration_path
|
||||||
|
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue