debian-mirror-gitlab/app/views/projects/blob/_actions.html.haml

27 lines
1.6 KiB
Text
Raw Normal View History

2014-09-02 18:07:02 +05:30
.btn-group.tree-btn-group
2015-04-26 12:48:37 +05:30
= link_to 'Raw', namespace_project_raw_path(@project.namespace, @project, @id),
class: 'btn btn-sm', target: '_blank'
2014-09-02 18:07:02 +05:30
-# only show normal/blame view links for text files
2015-12-23 02:04:40 +05:30
- if blob_viewable?(@blob)
2015-04-26 12:48:37 +05:30
- if current_page? namespace_project_blame_path(@project.namespace, @project, @id)
= link_to 'Normal View', namespace_project_blob_path(@project.namespace, @project, @id),
class: 'btn btn-sm'
2014-09-02 18:07:02 +05:30
- else
2015-04-26 12:48:37 +05:30
= link_to 'Blame', namespace_project_blame_path(@project.namespace, @project, @id),
class: 'btn btn-sm' unless @blob.empty?
= link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id),
class: 'btn btn-sm'
2015-12-23 02:04:40 +05:30
= link_to 'Permalink', namespace_project_blob_path(@project.namespace, @project,
tree_join(@commit.sha, @path)), class: 'btn btn-sm'
2014-09-02 18:07:02 +05:30
2015-12-23 02:04:40 +05:30
- if blob_editable?(@blob)
2015-09-25 12:07:36 +05:30
.btn-group{ role: "group" }
2015-12-23 02:04:40 +05:30
= edit_blob_link(@project, @ref, @path)
2015-09-25 12:07:36 +05:30
%button.btn.btn-default{ 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal' } Replace
2015-11-26 14:37:03 +05:30
%button.btn.btn-remove{ 'data-target' => '#modal-remove-blob', 'data-toggle' => 'modal' } Delete
2015-12-23 02:04:40 +05:30
- elsif !on_top_of_branch?
.btn-group{ role: "group" }
%button.btn.btn-default.disabled.has_tooltip{title: "You can only edit files when you are on a branch.", data: {container: 'body'}} Edit
%button.btn.btn-default.disabled.has_tooltip{title: "You can only replace files when you are on a branch.", data: {container: 'body'}} Replace
%button.btn.btn-remove.disabled.has_tooltip{title: "You can only delete files when you are on a branch.", data: {container: 'body'}} Delete