summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-17 17:45:32 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 12:12:05 -0200
commit1d476b0656b3ec24e264d7a7c30bdca83704b3bd (patch)
treed1cdb1b22c0f1365efd80a0485e25b1ecfaf7735 /app/helpers
parent14fc05ebfdfb6654859ee6f57aa462420a6bcb56 (diff)
downloadgitlab-ce-1d476b0656b3ec24e264d7a7c30bdca83704b3bd.tar.gz
Create a pending task when a user is mentioned on a note
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/tasks_helper.rb16
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