summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-04-10 13:30:46 -0500
committerEric Eastwood <contact@ericeastwood.com>2017-04-10 16:33:07 -0500
commitb4f0ecde79b3263e8875d75cdcf94d011d0d81fe (patch)
tree03fad2513050f98b4d9441e5e0fe2994bca12930
parent84da388d43d6cc0886b6722822d4e24d380e4a13 (diff)
downloadgitlab-ce-30636-fix-blame-edit-blob-without-repo-permissions.tar.gz
Fix edit button on blame page without repo perms30636-fix-blame-edit-blob-without-repo-permissions
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
-rw-r--r--app/views/projects/blob/_blob.html.haml7
-rw-r--r--app/views/projects/blob/_header.html.haml7
2 files changed, 7 insertions, 7 deletions
diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml
index fd0ae42571e..9aafff343f0 100644
--- a/app/views/projects/blob/_blob.html.haml
+++ b/app/views/projects/blob/_blob.html.haml
@@ -25,13 +25,6 @@
#blob-content-holder.blob-content-holder
%article.file-holder
= 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?
.file-content.code
diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml
index c42bf3c324a..7a4a293548c 100644
--- a/app/views/projects/blob/_header.html.haml
+++ b/app/views/projects/blob/_header.html.haml
@@ -38,3 +38,10 @@
- if current_user
= replace_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