summaryrefslogtreecommitdiff
path: root/app/views/projects/notes/discussions
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-03-25 00:39:22 -0700
committerStan Hu <stanhu@gmail.com>2016-03-28 07:43:42 -0700
commit191b9e3f05e8fa882e3eaf29cb4f85a942038987 (patch)
treeb4be12f8234f1f65605ca2621f8c3b8cc6fef90a /app/views/projects/notes/discussions
parent30e4d3ce9a18340c689557cd0c7b5f69e48795d4 (diff)
downloadgitlab-ce-191b9e3f05e8fa882e3eaf29cb4f85a942038987.tar.gz
Gracefully handle notes on deleted commits in merge requests
Closes #3250
Diffstat (limited to 'app/views/projects/notes/discussions')
-rw-r--r--app/views/projects/notes/discussions/_commit.html.haml7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/views/projects/notes/discussions/_commit.html.haml b/app/views/projects/notes/discussions/_commit.html.haml
index 3da2f2060b8..f67ec8db942 100644
--- a/app/views/projects/notes/discussions/_commit.html.haml
+++ b/app/views/projects/notes/discussions/_commit.html.haml
@@ -1,4 +1,6 @@
- note = discussion_notes.first
+- commit = note.noteable
+- commit_description = commit ? 'commit' : 'a deleted commit'
.discussion.js-toggle-container{ class: note.discussion_id }
.discussion-header
.discussion-actions
@@ -7,8 +9,9 @@
Show/hide discussion
%div
= link_to_member(@project, note.author, avatar: false)
- started a discussion on commit
- = link_to(note.noteable.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable), class: 'monospace')
+ %p started a discussion on #{commit_description}
+ - if commit
+ = link_to(commit.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable), class: 'monospace')
.last-update.hide.js-toggle-content
- last_note = discussion_notes.last
last updated by