BigW Consortium Gitlab

show.html.haml 1.33 KB
Newer Older
1
%h3.page-title
2 3
  = @snippet.title

4
  - if @snippet.private?
5
    %span.label.label-success
6
      %i.fa.fa-lock
7
      private
8

9
  .pull-right
10
    = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
11
      Add new snippet
12
%hr
13 14 15

.append-bottom-20
  .pull-right
Dmitriy Zaporozhets committed
16 17 18
    = "##{@snippet.id}"
    %span.light
      by
19
      = link_to user_snippets_path(@snippet.author) do
20
        = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
21
        = @snippet.author_name
22 23 24 25 26 27 28 29 30

  .back-link
    - if @snippet.author == current_user
      = link_to user_snippets_path(current_user) do
        ← my snippets
    - else
      = link_to snippets_path do
        ← discover snippets

31 32
.file-holder
  .file-title
33
    %i.fa.fa-file
34 35 36 37 38 39 40 41 42 43
    %span.file_name
      = @snippet.file_name
    .options
      .btn-group
        - if can?(current_user, :modify_personal_snippet, @snippet)
          = link_to "edit", edit_snippet_path(@snippet), class: "btn btn-small", title: 'Edit Snippet'
        = link_to "raw", raw_snippet_path(@snippet), class: "btn btn-small", target: "_blank"
      - if can?(current_user, :admin_personal_snippet, @snippet)
        = link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-small btn-remove", title: 'Delete Snippet'
  = render 'shared/snippets/blob'