summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-02-08 15:45:12 +0100
committerJames Lopez <james@jameslopez.es>2018-02-23 14:02:39 +0100
commit6d885f9c92cdb6e2d8ad332af2490d25269b5f9f (patch)
tree3f7c6f84d3a2edcfd86bcfe89a42cd315ab8e9d6 /app/helpers/blob_helper.rb
parent9053f8eb4b94669d18674552b8f588071d8c76c6 (diff)
downloadgitlab-ce-6d885f9c92cdb6e2d8ad332af2490d25269b5f9f.tar.gz
some more refactoring
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 8546e72a8a9..3f187a41735 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -27,7 +27,7 @@ module BlobHelper
elsif !current_user || (current_user && can_modify_blob?(blob, project, ref))
edit_link_tag(edit_text, ide_edit_path(project, ref, path, options), common_classes)
elsif current_user && can?(current_user, :fork_project, project)
- edit_blob_fork(common_classes, options, path, project, ref)
+ edit_blob_fork(common_classes, edit_blob_path(project, ref, path, options), project, edit_in_new_fork_notice)
end
end
@@ -56,7 +56,7 @@ module BlobHelper
elsif current_user && can_modify_blob?(blob, project, ref)
edit_link_tag(ide_edit_text, ide_edit_path(project, ref, path, options), common_classes)
elsif current_user && can?(current_user, :fork_project, project)
- edit_blob_fork(common_classes, options, path, project, ref)
+ edit_blob_fork(common_classes, edit_blob_path(project, ref, path, options), project, edit_in_new_fork_notice)
end
end
@@ -76,7 +76,7 @@ module BlobHelper
elsif can_modify_blob?(blob, project, ref)
button_tag label, class: "#{common_classes}", 'data-target' => "#modal-#{modal_type}-blob", 'data-toggle' => 'modal'
elsif can?(current_user, :fork_project, project)
- edit_blob_fork(common_classes, options, path, project, ref)
+ edit_blob_fork(common_classes, request.fullpath, project, edit_in_new_fork_notice_action(action), action)
end
end
@@ -311,10 +311,10 @@ module BlobHelper
blob if blob&.readable_text?
end
- def edit_blob_fork(common_classes, options, path, project, ref)
+ def edit_blob_fork(common_classes, path, project, notice, action = 'edit')
continue_params = {
- to: edit_blob_path(project, ref, path, options),
- notice: edit_in_new_fork_notice,
+ to: path,
+ notice: notice,
notice_now: edit_in_new_fork_notice_now
}
fork_path = project_forks_path(project, namespace_key: current_user.namespace.id, continue: continue_params)