diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-06-20 19:57:10 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-07 01:50:59 +0300 |
commit | 375193455aa5cb752f1035a6cc69160170a58477 (patch) | |
tree | e54ec42a455c02ab61ead34268841ef19ae339b4 /app/helpers/notes_helper.rb | |
parent | 4c1bf77c7fd3e62be4b9f6fd54520db0f7fc346b (diff) |
Style diff and blob file headers the same way
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r-- | app/helpers/notes_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index e85ba76887d..1a97f884508 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -79,4 +79,14 @@ module NotesHelper full_key = { project: note.project, user_id: note.author_id } @max_access_by_user_id[full_key] end + + def diff_note_path(note) + return unless note.diff_note? + + if note.for_merge_request? && note.active? + diffs_namespace_project_merge_request_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) + elsif note.for_commit? + namespace_project_commit_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) + end + end end |