Skip to content

Commit b034a40

Browse files
mathprodPowerKiKi
authored andcommitted
Fix repository settings form template to work with redmine 4.x
Patch from comments in issue #742 (#742 (comment))
1 parent 8731251 commit b034a40

File tree

13 files changed

+15
-12
lines changed

13 files changed

+15
-12
lines changed

Diff for: Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ group :development, :test do
4242
gem 'database_cleaner'
4343
gem 'factory_bot_rails', '< 5.0'
4444

45-
gem 'rubocop', require: false
45+
gem 'rubocop', '~> 0.76.0', require: false
4646
gem 'rubocop-rspec'
4747

4848
# Publish to CodeClimate

Diff for: app/controllers/redmine_git_hosting_controller.rb

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def render_with_api
5454
def render_js_redirect
5555
respond_to do |format|
5656
format.js { render js: "window.location = #{success_url.to_json};" }
57+
format.html do
58+
redirect_to success_url
59+
end
5760
end
5861
end
5962

Diff for: app/views/repository_deployment_credentials/edit.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_deployment_credential, @credential,
2-
url: repository_deployment_credential_path(@repository, @credential),
2+
url: repository_deployment_credential_path(@repository, @credential), authenticity_token: form_authenticity_token,
33
html: { method: :put, class: 'tabular', remote: true } do |f|
44

55
.flash-messages = error_messages_for 'credential'

Diff for: app/views/repository_deployment_credentials/new.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_deployment_credential, @credential,
2-
url: repository_deployment_credentials_path(@repository),
2+
url: repository_deployment_credentials_path(@repository), authenticity_token: form_authenticity_token,
33
html: { method: :post, class: 'tabular', remote: true } do |f|
44

55
.flash-messages= error_messages_for 'credential'

Diff for: app/views/repository_git_config_keys/edit.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_git_config_key, @git_config_key,
2-
url: repository_git_config_key_path(@repository, @git_config_key),
2+
url: repository_git_config_key_path(@repository, @git_config_key), authenticity_token: form_authenticity_token,
33
html: { method: :put, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }

Diff for: app/views/repository_git_config_keys/new.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_git_config_key, @git_config_key,
2-
url: repository_git_config_keys_path(@repository),
2+
url: repository_git_config_keys_path(@repository), authenticity_token: form_authenticity_token,
33
html: { method: :post, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }

Diff for: app/views/repository_git_extras/move.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ h2 = l(:label_move_repository, repo_name: @repository.gitolite_repository_name)
22

33
.box
44
= labelled_form_for :repository_mover, @move_repository_form,
5-
url: move_repository_git_extras_path(@repository),
5+
url: move_repository_git_extras_path(@repository), authenticity_token: form_authenticity_token,
66
html: { method: :post, class: 'tabular', data: { confirm: l(:text_are_you_sure) } } do |f|
77

88
.flash-messages = error_messages_for 'move_repository_form'

Diff for: app/views/repository_mirrors/edit.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_mirror, @mirror,
2-
url: repository_mirror_path(@repository, @mirror),
2+
url: repository_mirror_path(@repository, @mirror), authenticity_token: form_authenticity_token,
33
html: { method: :put, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }

Diff for: app/views/repository_mirrors/new.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_mirror, @mirror,
2-
url: repository_mirrors_path(@repository),
2+
url: repository_mirrors_path(@repository), authenticity_token: form_authenticity_token,
33
html: { method: :post, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_post_receive_url, @post_receive_url,
2-
url: repository_post_receive_url_path(@repository, @post_receive_url),
2+
url: repository_post_receive_url_path(@repository, @post_receive_url), authenticity_token: form_authenticity_token,
33
html: { method: :put, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }

Diff for: app/views/repository_post_receive_urls/new.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_post_receive_url, @post_receive_url,
2-
url: repository_post_receive_urls_path(@repository),
2+
url: repository_post_receive_urls_path(@repository), authenticity_token: form_authenticity_token,
33
html: { method: :post, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_protected_branche, @protected_branch,
2-
url: repository_protected_branch_path(@repository, @protected_branch),
2+
url: repository_protected_branch_path(@repository, @protected_branch), authenticity_token: form_authenticity_token,
33
html: { method: :put, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= labelled_form_for :repository_protected_branche, @protected_branch,
2-
url: repository_protected_branches_path(@repository),
2+
url: repository_protected_branches_path(@repository), authenticity_token: form_authenticity_token,
33
html: { method: :post, class: 'tabular', remote: true } do |f|
44

55
= render partial: 'form', locals: { f: f }

0 commit comments

Comments
 (0)