diff options
Diffstat (limited to 'app/helpers/tasks_helper.rb')
-rw-r--r-- | app/helpers/tasks_helper.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/helpers/tasks_helper.rb b/app/helpers/tasks_helper.rb index cf4eab0ef94..6975c1d1604 100644 --- a/app/helpers/tasks_helper.rb +++ b/app/helpers/tasks_helper.rb @@ -22,4 +22,20 @@ module TasksHelper [task.action_name, target].join(" ") end + + def task_note_link_html(task) + link_to task_note_target_path(task) do + "##{task.target_iid}" + end + end + + def task_note_target_path(task) + polymorphic_path([task.project.namespace.becomes(Namespace), + task.project, task.target], anchor: dom_id(task.note)) + end + + def task_note(text, options = {}) + text = first_line_in_markdown(text, 150, options) + sanitize(text, tags: %w(a img b pre code p span)) + end end |