gitlab-org--gitlab-foss/app/views/search/results/_note.html.haml
Nick Thomas dd159a750b Make search results use the markdown cache columns, treating them consistently
Truncato is introduced as a dependency to intelligently shorten the rendered
HTML to 200 characters; the previous approach could have resulted in invalid
HTML being rendered.
2016-10-07 02:54:26 +01:00

26 lines
794 B
Text

- 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.str-truncated
%i.fa.fa-comment
= link_to_member(project, note.author, avatar: false)
commented on
= link_to project.name_with_namespace, project
·
- if note.for_commit?
= link_to_if(noteable_identifier, "Commit #{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
.note-search-result
.term
= preserve do
= search_md_sanitize(note, :note)