debian-mirror-gitlab/app/views/snippets/show.html.haml

45 lines
1.4 KiB
Text
Raw Normal View History

2015-09-11 14:41:01 +05:30
- page_title @snippet.title, "Snippets"
2014-09-02 18:07:02 +05:30
%h3.page-title
= @snippet.title
- if @snippet.private?
%span.label.label-success
2015-04-26 12:48:37 +05:30
%i.fa.fa-lock
2014-09-02 18:07:02 +05:30
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
= "##{@snippet.id}"
%span.light
by
= link_to user_snippets_path(@snippet.author) do
2015-04-26 12:48:37 +05:30
= image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: ''
2014-09-02 18:07:02 +05:30
= @snippet.author_name
.back-link
- if @snippet.author == current_user
= link_to user_snippets_path(current_user) do
2015-04-26 12:48:37 +05:30
← your snippets
2014-09-02 18:07:02 +05:30
- else
= link_to snippets_path do
← discover snippets
.file-holder
.file-title
2015-04-26 12:48:37 +05:30
%i.fa.fa-file
%strong
2014-09-02 18:07:02 +05:30
= @snippet.file_name
2015-04-26 12:48:37 +05:30
.file-actions
2014-09-02 18:07:02 +05:30
.btn-group
2015-09-11 14:41:01 +05:30
- if can?(current_user, :update_personal_snippet, @snippet)
2015-04-26 12:48:37 +05:30
= 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"
2014-09-02 18:07:02 +05:30
- if can?(current_user, :admin_personal_snippet, @snippet)
2015-04-26 12:48:37 +05:30
= link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-sm btn-remove", title: 'Delete Snippet'
2014-09-02 18:07:02 +05:30
= render 'shared/snippets/blob'