Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-07 11:44:01 +0300
committerPhil Hughes <me@iamphill.com>2016-06-14 10:36:07 +0300
commitf67b06ada016915211e84a7d12a063aa25e422f3 (patch)
tree25b94f817c9971c5e347530cce1732f34ffd80f7 /app/helpers/issuables_helper.rb
parentf34af6b83cc2663bb8a076f4df9c82047e5511ab (diff)
Manually create todo for issuable
Added a button into the sidebar for issues & merge requests to allow users to manually create todo items Closes #15045
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r--app/helpers/issuables_helper.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index 40d8ce8a1d3..88ef1a6468c 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -67,6 +67,20 @@ module IssuablesHelper
end
end
+ def issuable_todo_path(issuable)
+ project = issuable.project
+
+ if issuable.kind_of?(MergeRequest)
+ todo_namespace_project_merge_request_path(project.namespace, project, issuable.iid, :json)
+ else
+ todo_namespace_project_issue_path(project.namespace, project, issuable.iid, :json)
+ end
+ end
+
+ def has_todo(issuable)
+ current_user.todos.find_by(target_id: issuable.id, state: :pending)
+ end
+
private
def sidebar_gutter_collapsed?