diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-05-23 09:36:41 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-23 09:36:41 +0000 |
commit | 8056a77d3ec9d3b4b1fd75211d6bc59fa1c65103 (patch) | |
tree | 6db59d14fc31cef143c1d49e7cdbc7a3133697b3 /app/helpers | |
parent | 3a3f542db6dd1a406f341cb59b18d9af7956e9fd (diff) | |
download | gitlab-ce-8056a77d3ec9d3b4b1fd75211d6bc59fa1c65103.tar.gz |
Resolve "Web IDE doesn't work for branches with slashes"
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blob_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index e7a36e20050..3db28fd6da3 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -17,7 +17,9 @@ module BlobHelper end def ide_edit_path(project = @project, ref = @ref, path = @path, options = {}) - "#{ide_path}/project#{url_for([project, "edit", "blob", id: [ref, path], script_name: "/"])}" + segments = [ide_path, 'project', project.full_path, 'edit', ref] + segments.concat(['-', path]) if path.present? + File.join(segments) end def edit_blob_button(project = @project, ref = @ref, path = @path, options = {}) @@ -331,7 +333,6 @@ module BlobHelper if !on_top_of_branch?(project, ref) edit_disabled_button_tag(text, common_classes) # This condition only applies to users who are logged in - # Web IDE (Beta) requires the user to have this feature enabled elsif !current_user || (current_user && can_modify_blob?(blob, project, ref)) edit_link_tag(text, edit_path, common_classes) elsif can?(current_user, :fork_project, project) && can?(current_user, :create_merge_request_in, project) |