gitlab-org--gitlab-foss/app/views/snippets/show.html.haml

45 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-04-30 17:06:18 +00:00
- page_title @snippet.title, "Snippet"
%h3.page-title
= @snippet.title
- if @snippet.private?
%span.label.label-success
2014-10-01 22:21:29 +00:00
%i.fa.fa-lock
private
.pull-right
= link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
Add new snippet
%hr
.append-bottom-20
.pull-right
2013-06-05 19:25:27 +00:00
= "##{@snippet.id}"
%span.light
by
2013-07-18 10:33:43 +00:00
= link_to user_snippets_path(@snippet.author) do
= image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: ''
2013-07-18 10:33:43 +00:00
= @snippet.author_name
.back-link
- if @snippet.author == current_user
= link_to user_snippets_path(current_user) do
← your snippets
- else
= link_to snippets_path do
← discover snippets
.file-holder
.file-title
2014-10-01 22:21:29 +00:00
%i.fa.fa-file
2015-03-14 02:20:25 +00:00
%strong
= @snippet.file_name
2015-03-14 02:20:25 +00:00
.file-actions
.btn-group
- if can?(current_user, :modify_personal_snippet, @snippet)
2015-03-14 07:29:32 +00:00
= link_to "edit", edit_snippet_path(@snippet), class: "btn btn-sm", title: 'Edit Snippet'
= link_to "raw", raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank"
- if can?(current_user, :admin_personal_snippet, @snippet)
2015-03-14 07:29:32 +00:00
= link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-sm btn-remove", title: 'Delete Snippet'
= render 'shared/snippets/blob'