From 9137404243204512e3410103bc48a7638d71cb2e Mon Sep 17 00:00:00 2001 From: Carsten Otto Date: Thu, 14 May 2015 00:37:38 +0200 Subject: [PATCH] show links to context/project also for completed actions --- app/helpers/todos_helper.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 1c99fc9b..7c9cb8f8 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -297,17 +297,16 @@ module TodosHelper end def project_and_context_links(todo, parent_container_type, opts = {}) - str = '' + links = '' if todo.completed? - links = [] - links << todo.context.name unless opts[:suppress_context] - links << todo.project.name unless opts[:suppress_project] || todo.project.nil? - str = "(#{links.join(", ")})" unless links.empty? + links << item_link_to_context( todo ) unless opts[:suppress_context] + links << item_link_to_project( todo ) unless opts[:suppress_project] || todo.project.nil? else - str << item_link_to_context( todo ) if include_context_link(todo, parent_container_type) - str << item_link_to_project( todo ) if include_project_link(todo, parent_container_type) + links << item_link_to_context( todo ) if include_context_link(todo, parent_container_type) + links << item_link_to_project( todo ) if include_project_link(todo, parent_container_type) end - return str.html_safe + + links.html_safe end def include_context_link(todo, parent_container_type)