show.html.haml 1.29 KB
Newer Older
Douwe Maan's avatar
Douwe Maan committed
1
- page_title @snippet.title, "Snippets"
2

3
4
5
6
7
8
9
10
11
12
13
.snippet
  .snippet-details
    .page-title
      - if @snippet.private?
        .snippet-box.snippet-box-locked
          %i.fa.fa-lock
          Private
      %span.creator
        updated by #{link_to_member(@project, @snippet.author, size: 24)}
        ·
        = time_ago_with_tooltip(@snippet.updated_at, placement: 'bottom', html_class: 'snippet_updated_ago')
14

15
16
17
18
19
20
21
22
23
24
25
26
      .pull-right
        = link_to new_snippet_path, class: 'btn btn-grouped new-snippet-link', title: "New Snippet" do
          = icon('plus')
          Add new snippet
        = link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-remove", title: 'Delete Snippet'
        - if can?(current_user, :update_personal_snippet, @snippet)
          = link_to edit_snippet_path(@snippet), class: "btn btn-grouped issuabled-edit" do
            = icon('pencil-square-o')
            Edit
    .gray-content-block.middle-block
      %h2.snippet-title
        = gfm escape_once(@snippet.title)
27

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
28
29
.file-holder
  .file-title
30
    %i.fa.fa-file
31
    %strong
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32
      = @snippet.file_name
33
    .file-actions
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
34
      .btn-group
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
35
        = link_to "raw", raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
36
  = render 'shared/snippets/blob'