From: Tom Hughes Date: Wed, 11 Sep 2024 16:12:13 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5186' X-Git-Tag: live~692 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/b34e71f1d9f215cb685d992e1c8950abb4daeea8?hp=418615bce79fd23b96da02ef9f1e5824aeb9fac5 Merge remote-tracking branch 'upstream/pull/5186' --- diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index d6584f364..9a8f193a1 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -7,7 +7,7 @@ class Ability can :query, :browse can :show, [Node, Way, Relation] can [:index, :show], [OldNode, OldWay, OldRelation] - can [:show, :new], Note + can [:show, :create], Note can :search, :direction can [:index, :permalink, :edit, :help, :fixthemap, :offline, :export, :about, :communities, :preview, :copyright, :key, :id], :site can [:finish, :embed], :export @@ -20,11 +20,11 @@ class Ability can [:index, :rss, :show], DiaryEntry can :index, DiaryComment can [:index], Note - can [:new, :create, :update], :password + can [:create, :update], :password can [:index, :show], Redaction - can [:new, :create, :destroy], :session + can [:create, :destroy], :session can [:index, :show, :data, :georss], Trace - can [:terms, :new, :create, :save, :suspended, :show, :auth_success, :auth_failure], User + can [:terms, :create, :save, :suspended, :show, :auth_success, :auth_failure], User can [:index, :show, :blocks_on, :blocks_by], UserBlock end @@ -34,21 +34,21 @@ class Ability if Settings.status != "database_offline" can [:subscribe, :unsubscribe], Changeset - can [:index, :new, :create, :show, :update, :destroy], :oauth2_application + can [:index, :create, :show, :update, :destroy], :oauth2_application can [:index, :destroy], :oauth2_authorized_application - can [:new, :show, :create, :destroy], :oauth2_authorization + can [:show, :create, :destroy], :oauth2_authorization can [:update, :destroy], :account can [:show], :dashboard - can [:new, :create, :subscribe, :unsubscribe], DiaryEntry + can [:create, :subscribe, :unsubscribe], DiaryEntry can :update, DiaryEntry, :user => user can [:create], DiaryComment can [:make_friend, :remove_friend], Friendship - can [:new, :create, :reply, :show, :inbox, :outbox, :muted, :mark, :unmute, :destroy], Message + can [:create, :reply, :show, :inbox, :outbox, :muted, :mark, :unmute, :destroy], Message can [:close, :reopen], Note can [:show, :update], :preference can :update, :profile - can [:new, :create], Report - can [:mine, :new, :create, :update, :destroy], Trace + can :create, Report + can [:mine, :create, :update, :destroy], Trace can [:account, :go_public], User can [:index, :create, :destroy], UserMute @@ -56,8 +56,8 @@ class Ability can [:hide, :unhide], [DiaryEntry, DiaryComment] can [:index, :show, :resolve, :ignore, :reopen], Issue can :create, IssueComment - can [:new, :create, :update, :destroy], Redaction - can [:new, :create, :revoke_all], UserBlock + can [:create, :update, :destroy], Redaction + can [:create, :revoke_all], UserBlock can :update, UserBlock, :creator => user can :update, UserBlock, :revoker => user can :update, UserBlock, :active? => true diff --git a/app/controllers/user_blocks_controller.rb b/app/controllers/user_blocks_controller.rb index 7d61366be..c42c2659d 100644 --- a/app/controllers/user_blocks_controller.rb +++ b/app/controllers/user_blocks_controller.rb @@ -25,7 +25,7 @@ class UserBlocksController < ApplicationController @show_user_name = true @show_creator_name = true - render :partial => "blocks" if turbo_frame_request_id == "pagination" + render :partial => "page" if turbo_frame_request_id == "pagination" end def show @@ -127,7 +127,7 @@ class UserBlocksController < ApplicationController @show_user_name = false @show_creator_name = true - render :partial => "blocks" if turbo_frame_request_id == "pagination" + render :partial => "page" if turbo_frame_request_id == "pagination" end ## @@ -142,7 +142,7 @@ class UserBlocksController < ApplicationController @show_user_name = true @show_creator_name = false - render :partial => "blocks" if turbo_frame_request_id == "pagination" + render :partial => "page" if turbo_frame_request_id == "pagination" end private diff --git a/app/views/changesets/index.html.erb b/app/views/changesets/index.html.erb index 97e6351a0..fc5f7cbbc 100644 --- a/app/views/changesets/index.html.erb +++ b/app/views/changesets/index.html.erb @@ -13,9 +13,9 @@ <% end -%> <% elsif params[:bbox] %> -

<%= t(params[:max_id] ? ".no_more_area" : ".empty_area") %>

+

<%= params[:max_id] ? t(".no_more_area") : t(".empty_area") %>

<% elsif params[:display_name] %> -

<%= t(params[:max_id] ? ".no_more_user" : ".empty_user") %>

+

<%= params[:max_id] ? t(".no_more_user") : t(".empty_user") %>

<% else %> -

<%= t(params[:max_id] ? ".no_more" : ".empty") %>

+

<%= params[:max_id] ? t(".no_more") : t(".empty") %>

<% end %> diff --git a/app/views/user_blocks/_blocks.html.erb b/app/views/user_blocks/_page.html.erb similarity index 100% rename from app/views/user_blocks/_blocks.html.erb rename to app/views/user_blocks/_page.html.erb diff --git a/app/views/user_blocks/blocks_by.html.erb b/app/views/user_blocks/blocks_by.html.erb index 38254a5a3..73748e557 100644 --- a/app/views/user_blocks/blocks_by.html.erb +++ b/app/views/user_blocks/blocks_by.html.erb @@ -7,7 +7,7 @@ <% end %> <% unless @user_blocks.empty? %> -<%= render :partial => "blocks" %> +<%= render :partial => "page" %> <% else %>

<%= t ".empty", :name => @user.display_name %>

<% end %> diff --git a/app/views/user_blocks/blocks_on.html.erb b/app/views/user_blocks/blocks_on.html.erb index 38254a5a3..73748e557 100644 --- a/app/views/user_blocks/blocks_on.html.erb +++ b/app/views/user_blocks/blocks_on.html.erb @@ -7,7 +7,7 @@ <% end %> <% unless @user_blocks.empty? %> -<%= render :partial => "blocks" %> +<%= render :partial => "page" %> <% else %>

<%= t ".empty", :name => @user.display_name %>

<% end %> diff --git a/app/views/user_blocks/index.html.erb b/app/views/user_blocks/index.html.erb index 854d62037..5b040e2b5 100644 --- a/app/views/user_blocks/index.html.erb +++ b/app/views/user_blocks/index.html.erb @@ -7,7 +7,7 @@ <% end %> <% unless @user_blocks.empty? %> -<%= render :partial => "blocks" %> +<%= render :partial => "page" %> <% else %>

<%= t ".empty" %>

<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 395cb3bf7..16015d92c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2833,15 +2833,9 @@ en: doesnt_have_role: "The user does not have role %{role}." not_revoke_admin_current_user: "Cannot revoke administrator role from current user." grant: - title: Confirm role granting - heading: Confirm role granting are_you_sure: "Are you sure you want to grant the role `%{role}' to the user `%{name}'?" - confirm: "Confirm" revoke: - title: Confirm role revoking - heading: Confirm role revoking are_you_sure: "Are you sure you want to revoke the role `%{role}' from the user `%{name}'?" - confirm: "Confirm" user_blocks: model: non_moderator_update: "Must be a moderator to create or update a block." @@ -2927,7 +2921,7 @@ en: not_revoked: "(not revoked)" show: "Show" edit: "Edit" - blocks: + page: display_name: "Blocked User" creator_name: "Creator" reason: "Reason for block" diff --git a/test/controllers/redactions_controller_test.rb b/test/controllers/redactions_controller_test.rb index 5ca72fe47..b3bc4cf16 100644 --- a/test/controllers/redactions_controller_test.rb +++ b/test/controllers/redactions_controller_test.rb @@ -102,7 +102,7 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest # create an empty redaction redaction = create(:redaction) - delete redaction_path(:id => redaction) + delete redaction_path(redaction) assert_redirected_to(redactions_path) end @@ -113,7 +113,7 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest redaction = create(:redaction) create(:old_node, :redaction => redaction) - delete redaction_path(:id => redaction) + delete redaction_path(redaction) assert_redirected_to(redaction_path(redaction)) assert_match(/^Redaction is not empty/, flash[:error]) end @@ -121,28 +121,28 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest def test_delete_non_moderator session_for(create(:user)) - delete redaction_path(:id => create(:redaction)) + delete redaction_path(create(:redaction)) assert_redirected_to :controller => "errors", :action => "forbidden" end def test_edit redaction = create(:redaction) - get edit_redaction_path(:id => redaction) + get edit_redaction_path(redaction) assert_redirected_to login_path(:referer => edit_redaction_path(redaction)) end def test_edit_moderator session_for(create(:moderator_user)) - get edit_redaction_path(:id => create(:redaction)) + get edit_redaction_path(create(:redaction)) assert_response :success end def test_edit_non_moderator session_for(create(:user)) - get edit_redaction_path(:id => create(:redaction)) + get edit_redaction_path(create(:redaction)) assert_redirected_to :controller => "errors", :action => "forbidden" end @@ -151,7 +151,7 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest redaction = create(:redaction) - put redaction_path(:id => redaction, :redaction => { :title => "Foo", :description => "Description here." }) + put redaction_path(redaction, :redaction => { :title => "Foo", :description => "Description here." }) assert_redirected_to(redaction_path(redaction)) end @@ -160,7 +160,7 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest redaction = create(:redaction) - put redaction_path(:id => redaction, :redaction => { :title => "Foo", :description => "" }) + put redaction_path(redaction, :redaction => { :title => "Foo", :description => "" }) assert_response :success assert_template :edit end @@ -170,7 +170,7 @@ class RedactionsControllerTest < ActionDispatch::IntegrationTest redaction = create(:redaction) - put redaction_path(:id => redaction, :redaction => { :title => "Foo", :description => "Description here." }) + put redaction_path(redaction, :redaction => { :title => "Foo", :description => "Description here." }) assert_redirected_to :controller => "errors", :action => "forbidden" end end