2017-08-17 22:00:37 +05:30
|
|
|
- link_project = local_assigns.fetch(:link_project, false)
|
2019-12-04 20:38:33 +05:30
|
|
|
- notes_count = @noteable_meta_data[snippet.id].user_notes_count
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
%li.snippet-row.py-3{ data: { qa_selector: 'snippet_link', qa_snippet_title: snippet.title } }
|
2022-11-25 23:54:43 +05:30
|
|
|
= render Pajamas::AvatarComponent.new(snippet.author, size: 48, alt: "", class: 'gl-display-none gl-sm-display-block gl-float-left gl-mr-3')
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
= link_to gitlab_snippet_path(snippet), class: "title" do
|
|
|
|
= snippet.title
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
%ul.controls{ data: { qa_selector: 'snippet_file_count_content', qa_snippet_files: snippet.statistics&.file_count } }
|
|
|
|
%li
|
|
|
|
= snippet_file_count(snippet)
|
|
|
|
%li
|
|
|
|
= link_to gitlab_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if notes_count == 0) do
|
|
|
|
= sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom')
|
|
|
|
= notes_count
|
|
|
|
%li
|
|
|
|
%span.sr-only{ data: { qa_selector: 'snippet_visibility_content', qa_snippet_visibility: visibility_level_label(snippet.visibility_level) } }
|
|
|
|
= visibility_level_label(snippet.visibility_level)
|
|
|
|
= visibility_level_icon(snippet.visibility_level)
|
2016-09-29 09:46:39 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
.snippet-info
|
2022-11-25 23:54:43 +05:30
|
|
|
.gl-display-inline{ data: { testid: 'snippet-created-at'} }
|
|
|
|
- created_at = time_ago_with_tooltip(snippet.created_at, placement: 'bottom')
|
|
|
|
- author = link_to(snippet.author_name, user_snippets_path(snippet.author), data: { user_id: snippet.author.id })
|
|
|
|
#{snippet.to_reference} ·
|
|
|
|
- if link_project && snippet.project_id?
|
|
|
|
- project_link = link_to(snippet.project.full_name, project_path(snippet.project))
|
|
|
|
= _('created %{timeAgo} by %{author} in %{project_link}').html_safe % { timeAgo: created_at, author: author, project_link: project_link }
|
|
|
|
- else
|
|
|
|
= _('created %{timeAgo} by %{author}').html_safe % { timeAgo: created_at, author: author }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
.float-right
|
|
|
|
= _('updated %{timeAgo}').html_safe % { timeAgo: time_ago_with_tooltip(snippet.updated_at, placement: 'bottom') }
|