summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-19 16:59:36 -0800
committerRémy Coutable <remy@rymai.me>2016-02-21 21:02:59 +0100
commit5c120204ad65bf6876c6fa35910a5f4334fcc3f4 (patch)
tree1e5d05b592d5b9e82b16c01f1c84f7b7fb4cb5b6 /app
parentba893daf53ba729f2d07f0acde4ba24c7ba97d23 (diff)
downloadgitlab-ce-5c120204ad65bf6876c6fa35910a5f4334fcc3f4.tar.gz
Merge branch '12792-emoji-as-text-diff-comment'
Diffstat (limited to 'app')
-rw-r--r--app/models/note.rb3
-rw-r--r--app/views/projects/diffs/_text_file.html.haml4
2 files changed, 4 insertions, 3 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 55255d22c2f..b3809ad81e0 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -375,6 +375,7 @@ class Note < ActiveRecord::Base
#
def set_award!
return unless awards_supported? && contains_emoji_only?
+
self.is_award = true
self.note = award_emoji_name
end
@@ -382,7 +383,7 @@ class Note < ActiveRecord::Base
private
def awards_supported?
- noteable.kind_of?(Issue) || noteable.is_a?(MergeRequest)
+ (noteable.kind_of?(Issue) || noteable.is_a?(MergeRequest)) && !for_diff_line?
end
def contains_emoji_only?
diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml
index 5e835b10e1f..d75e9ef2a49 100644
--- a/app/views/projects/diffs/_text_file.html.haml
+++ b/app/views/projects/diffs/_text_file.html.haml
@@ -35,8 +35,8 @@
= render "projects/notes/diff_notes_with_reply", notes: comments, line: raw_diff_lines[index].text
- if last_line > 0
- = render "projects/diffs/match_line", {line: "",
- line_old: last_line, line_new: last_line, bottom: true, new_file: diff_file.new_file}
+ = render "projects/diffs/match_line", { line: "",
+ line_old: last_line, line_new: last_line, bottom: true, new_file: diff_file.new_file }
- if diff_file.diff.blank? && diff_file.mode_changed?
.file-mode-changed