summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-04-11 20:08:35 +0000
committerFelipe Artur <felipefac@gmail.com>2017-04-11 19:19:02 -0300
commita43b3dcfe9824241bf13333c12ece6f310a5ce15 (patch)
tree6d964ed5231e2afdc54131fccb40c635c986198a
parentc21c98b8aed4cb3c36715fc8223b98b5ab4e911a (diff)
downloadgitlab-ce-a43b3dcfe9824241bf13333c12ece6f310a5ce15.tar.gz
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
-rw-r--r--app/views/projects/blob/_blob.html.haml14
-rw-r--r--app/views/projects/blob/_header.html.haml7
2 files changed, 13 insertions, 8 deletions
diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml
index aa9b852035e..8e870bb5740 100644
--- a/app/views/projects/blob/_blob.html.haml
+++ b/app/views/projects/blob/_blob.html.haml
@@ -25,11 +25,9 @@
#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
- = render blob.to_partial_path(@project), blob: blob
+ - if blob.empty?
+ .file-content.code
+ .nothing-here-block
+ Empty file
+ - else
+ = render blob.to_partial_path(@project), blob: blob
diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml
index 6c7d389e707..71fa870e345 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