gitlab-org--gitlab-foss/app/views/shared/snippets/_snippet.html.haml

38 lines
1.4 KiB
Text
Raw Normal View History

- link_project = local_assigns.fetch(:link_project, false)
%li.snippet-row
2018-04-09 17:50:40 -04:00
= image_tag avatar_icon_for_user(snippet.author), class: "avatar s40 d-none d-sm-block", alt: ''
.title
= link_to reliable_snippet_path(snippet) do
= snippet.title
2016-12-08 15:29:15 -05:00
- if snippet.file_name
%span.snippet-filename.monospace.d-none.d-sm-inline-block
2016-12-08 15:29:15 -05:00
= snippet.file_name
2013-06-05 15:25:27 -04:00
2016-12-08 15:29:15 -05:00
%ul.controls
%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)
2016-12-08 15:29:15 -05:00
.snippet-info
#{snippet.to_reference} ·
authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom', html_class: 'snippet-created-ago')}
by
2019-01-04 10:51:19 -05:00
= link_to user_snippets_path(snippet.author), class: "js-user-link", data: { user_id: snippet.author.id } do
= snippet.author_name
- if link_project && snippet.project_id?
2018-05-29 15:54:25 -04:00
%span.d-none.d-sm-inline-block
in
= link_to project_path(snippet.project) do
= snippet.project.full_name
2016-12-08 15:29:15 -05:00
.float-right.snippet-updated-at
2016-12-08 17:13:23 -05:00
%span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')}