summaryrefslogtreecommitdiff
path: root/app/views/search/results/_note.html.haml
blob: c7c91e768df14d3682de0f85d47f35ac3fa22d53 (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
- project = note.project
- note_url = Gitlab::UrlBuilder.build(note)
- noteable_identifier = note.noteable.try(:iid) || note.noteable.try(:id)

.search-result-row
  %h5.note-search-caption.gl-max-w-full
    %span.gl-display-inline-block.gl-text-truncate.search-max-w-inherit.gl-vertical-align-bottom
      = sprite_icon('comment', css_class: 'gl-vertical-align-text-bottom')
      = link_to_member(project, note.author, avatar: false)
      = _("commented on %{link_to_project}").html_safe % { link_to_project: link_to(project.full_name, project) }
    ·

    - if note.for_commit?
      = link_to_if(noteable_identifier, _("Commit %{commit_id}") % { commit_id: truncate_sha(note.commit_id) }, note_url) do
        = truncate_sha(note.commit_id)
        %span.light= _("Commit deleted")

    - else
      %span #{note.noteable_type.titleize} ##{noteable_identifier}
      ·
      = link_to note.noteable.title, note_url, data: {track_action: 'click_text', track_label: 'noteable_title', track_property: 'search_result'}

    %span.note-headline-light.note-headline-meta
      %span.system-note-separator
        ·
      %span.system-note-separator= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')

  .note-search-result
    .term
      = simple_search_highlight_and_truncate(note.note, @search_term)