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

4 5 6 7 8 9 10 11
  .pull-right
    = link_to new_project_snippet_path(@project), class: "btn btn-new", title: "New Snippet" do
      Add new snippet

%hr

.append-bottom-20
  .pull-right
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12 13 14
    = "##{@snippet.id}"
    %span.light
      by
15 16
      = link_to user_path(@snippet.author) do
        = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
Sacred Seven's avatar
Sacred Seven committed
17
        %span{ dir: "auto" }= @snippet.author_name
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

  .back-link
    = link_to project_snippets_path(@project) do
      ← project snippets

.file-holder
  .file-title
    %i.icon-file
    %span.file_name
      = @snippet.file_name
    .options
      .btn-group
        - if can?(current_user, :modify_project_snippet, @snippet)
          = link_to "edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small", title: 'Edit Snippet'
        = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn btn-small", target: "_blank"
      - if can?(current_user, :admin_project_snippet, @snippet)
        = link_to "remove", project_snippet_path(@project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-small btn-remove", title: 'Delete Snippet'
  = render 'shared/snippets/blob'

37
%div#notes= render "projects/notes/notes_with_form"