summaryrefslogtreecommitdiff
path: root/app/views/snippets/show.html.haml
blob: 97374e073dc2447b1f06c7bdf850b33f896f36f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- page_title @snippet.title, "Snippets"
%h4.page-title
  = @snippet.title

  - if @snippet.private?
    %span.label.label-success
      %i.fa.fa-lock
      private

  .pull-right
    = link_to new_snippet_path, class: "btn btn-new btn-sm", title: "New Snippet" do
      Add new snippet

.append-bottom-10.prepend-top-10
  .pull-right
    %span.light
      created by
      = link_to user_snippets_path(@snippet.author) do
        = @snippet.author_name

  .back-link
    - if @snippet.author == current_user
      = link_to dashboard_snippets_path do
        ← your snippets
    - else
      = link_to explore_snippets_path do
        ← explore snippets

.file-holder
  .file-title
    %i.fa.fa-file
    %strong
      = @snippet.file_name
    .file-actions
      .btn-group
        - if can?(current_user, :update_personal_snippet, @snippet)
          = 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)
        = 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'