diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-17 02:31:30 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-18 17:00:53 +0300 |
commit | c29da3f8ca1d759b8cbecb91b6e0529b18cc5c85 (patch) | |
tree | b60d38cea7b271f52307ec48df1a14327915edda /app/helpers/todos_helper.rb | |
parent | 1e76245d4e8c5ecbd915c517b6c8923e9c4bbd2d (diff) |
Trigger a todo for mentions on commits page
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r-- | app/helpers/todos_helper.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 07ddc691d85..9604a4e01b4 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -16,14 +16,19 @@ module TodosHelper def todo_target_link(todo) target = todo.target_type.titleize.downcase - link_to "#{target} #{todo.target.to_reference}", todo_target_path(todo), { title: h(todo.target.title) } + link_to "#{target} #{todo.to_reference}", todo_target_path(todo), { title: h(todo.target.title) } end def todo_target_path(todo) anchor = dom_id(todo.note) if todo.note.present? - polymorphic_path([todo.project.namespace.becomes(Namespace), - todo.project, todo.target], anchor: anchor) + if todo.for_commit? + namespace_project_commit_path(todo.project.namespace.becomes(Namespace), todo.project, + todo.target, anchor: anchor) + else + polymorphic_path([todo.project.namespace.becomes(Namespace), + todo.project, todo.target], anchor: anchor) + end end def todos_filter_params |