BigW Consortium Gitlab

_snippet.html.haml 1.27 KB
Newer Older
1 2
- link_project = local_assigns.fetch(:link_project, false)

3
%li.snippet-row
4 5
  = image_tag avatar_icon(snippet.author_email), class: "avatar s40 hidden-xs", alt: ''

6 7
  .title
    = link_to reliable_snippet_path(snippet) do
8
      = snippet.title
9 10 11
    - if snippet.file_name
      %span.snippet-filename.monospace.hidden-xs
        = snippet.file_name
Dmitriy Zaporozhets committed
12

13
    %ul.controls
14 15 16 17 18 19 20 21 22 23
      %li
        - note_count = snippet.notes.user.count
        = link_to reliable_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if note_count.zero?) do
          = icon('comments')
          = note_count
      %li
        %span.sr-only
          = visibility_level_label(snippet.visibility_level)
        = visibility_level_icon(snippet.visibility_level, fw: false)

24 25
  .snippet-info
    #{snippet.to_reference} ·
26 27
    authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom', html_class: 'snippet-created-ago')}
    by
28 29
    = link_to user_snippets_path(snippet.author) do
      = snippet.author_name
30 31 32
    - if link_project && snippet.project_id?
      %span.hidden-xs
        in
33
        = link_to project_path(snippet.project) do
34
          = snippet.project.name_with_namespace
35 36

    .pull-right.snippet-updated-at
Mike Greiling committed
37
      %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')}