Commit a43b3dcf authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray Committed by Felipe Artur

Merge branch '30636-fix-blame-edit-blob-without-repo-permissions' into 'master'

Fix "Edit" button on blame page without repo permissions

Closes #30636

See merge request !10598
parent c21c98b8
...@@ -25,11 +25,9 @@ ...@@ -25,11 +25,9 @@
#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 - if blob.empty?
.js-file-fork-suggestion-section.file-fork-suggestion.hidden .file-content.code
%span.file-fork-suggestion-note .nothing-here-block
You don't have permission to edit this file. Try forking this project to edit the file. Empty file
= link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new' - else
%button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' } = render blob.to_partial_path(@project), blob: blob
Cancel
= render blob.to_partial_path(@project), blob: blob
...@@ -38,3 +38,10 @@ ...@@ -38,3 +38,10 @@
- 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
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