From 57d16552ff769cc5b41737de803bc2ddc4813f4e Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 20 Feb 2016 11:53:15 -0800 Subject: [PATCH] Include 'issue'/'merge request' in link --- app/helpers/todos_helper.rb | 11 +++-------- app/views/dashboard/todos/_todo.html.haml | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 7c36046894..cbbfc1e04f 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -7,14 +7,9 @@ module TodosHelper current_user.todos.done.count end - def todo_action_name(todo) - target = todo.target_type.titleize.downcase - - [todo.action_name, target].join(" ") - end - - def todo_target_link_html(todo) - link_to "##{todo.target_iid}", todo_target_path(todo) + def todo_target_link(todo) + target = todo.target_type.titleize.downcase + link_to "#{target} #{todo.target.to_reference}", todo_target_path(todo) end def todo_target_path(todo) diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml index 7de703e304..773a9f6f4b 100644 --- a/app/views/dashboard/todos/_todo.html.haml +++ b/app/views/dashboard/todos/_todo.html.haml @@ -6,8 +6,8 @@ %span.author_name = link_to_author todo %span.todo_label - = todo_action_name(todo) - = todo_target_link_html(todo) + = todo.action_name + = todo_target_link(todo) · #{time_ago_with_tooltip(todo.created_at)}