summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/_actions.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/blob/_actions.html.haml')
-rw-r--r--app/views/projects/blob/_actions.html.haml12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml
new file mode 100644
index 00000000000..456c7432c94
--- /dev/null
+++ b/app/views/projects/blob/_actions.html.haml
@@ -0,0 +1,12 @@
+.btn-group.tree-btn-group
+ -# only show edit link for text files
+ - if @blob.text?
+ = link_to "edit", project_edit_tree_path(@project, @id), class: "btn btn-tiny", disabled: !allowed_tree_edit?
+ = link_to "raw", project_raw_path(@project, @id), class: "btn btn-tiny", target: "_blank"
+ -# only show normal/blame view links for text files
+ - if @blob.text?
+ - if current_page? project_blame_path(@project, @id)
+ = link_to "normal view", project_blob_path(@project, @id), class: "btn btn-tiny"
+ - else
+ = link_to "blame", project_blame_path(@project, @id), class: "btn btn-tiny" unless @blob.empty?
+ = link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny"