summaryrefslogtreecommitdiff
path: root/app/helpers/tasks_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/tasks_helper.rb')
-rw-r--r--app/helpers/tasks_helper.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/helpers/tasks_helper.rb b/app/helpers/tasks_helper.rb
index a99f2b48a26..d8e0780e4c1 100644
--- a/app/helpers/tasks_helper.rb
+++ b/app/helpers/tasks_helper.rb
@@ -23,18 +23,20 @@ module TasksHelper
[task.action_name, target].join(" ")
end
- def task_note_link_html(task)
- link_to task_note_target_path(task) do
+ def task_target_link_html(task)
+ link_to task_target_path(task) do
"##{task.target_iid}"
end
end
- def task_note_target_path(task)
+ def task_target_path(task)
+ anchor = dom_id(task.note) if task.note.present?
+
polymorphic_path([task.project.namespace.becomes(Namespace),
- task.project, task.target], anchor: dom_id(task.note))
+ task.project, task.target], anchor: anchor)
end
- def task_note(text, options = {})
+ def task_body(text, options = {})
text = first_line_in_markdown(text, 150, options)
sanitize(text, tags: %w(a img b pre code p span))
end