Commit bf174499 authored by Eric Eastwood's avatar Eric Eastwood

Fix edit button on blame page without repo perms

Without repo permissions, pressing the "Edit" button on the blame page
will now prompt to Fork/Cancel.

Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/30636

Conflicts:
	app/views/projects/blob/_header.html.haml
parent a24beca0
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#blob-content-holder.blob-content-holder #blob-content-holder.blob-content-holder
%article.file-holder %article.file-holder
= render "projects/blob/header", blob: blob = render "projects/blob/header", blob: blob
- if current_user
.js-file-fork-suggestion-section.file-fork-suggestion.hidden
%span.file-fork-suggestion-note
You don't have permission to edit this file. Try forking this project to edit the file.
= link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new'
%button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' }
Cancel
- if blob.empty? - if blob.empty?
.file-content.code .file-content.code
......
...@@ -40,6 +40,13 @@ ...@@ -40,6 +40,13 @@
- if current_user - if current_user
= replace_blob_link = replace_blob_link
= delete_blob_link = delete_blob_link
- if current_user
.js-file-fork-suggestion-section.file-fork-suggestion.hidden
%span.file-fork-suggestion-note
You don't have permission to edit this file. Try forking this project to edit the file.
= link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new'
%button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' }
Cancel
- if license_allows_file_locks? - if license_allows_file_locks?
:javascript :javascript
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment