diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-22 13:38:11 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-31 13:35:05 +0300 |
commit | d537a9a45b23bac1aaff028302aae515d6afe949 (patch) | |
tree | 89c495d23e26ed29c1d1b0b2ef968a0e3263baf7 /app/helpers | |
parent | ab0374f4d6e2bb72ee3040b9b906c2be23519cd7 (diff) |
Move issuable_app_data to helper
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/issuables_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 9290e4ec133..39982eb2e2c 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -1,5 +1,6 @@ module IssuablesHelper include GitlabRoutingHelper + include EditableHelper def sidebar_gutter_toggle_icon sidebar_gutter_collapsed? ? icon('angle-double-left', { 'aria-hidden': 'true' }) : icon('angle-double-right', { 'aria-hidden': 'true' }) @@ -273,4 +274,11 @@ module IssuablesHelper container: (is_collapsed ? 'body' : nil) } end + + def issuable_app_data(project, issue) + data = { "endpoint" => realtime_changes_namespace_project_issue_path(project.namespace, project, issue), "can-update" => can?(current_user, :update_issue, issue).to_s, "issuable-ref" => issue.to_reference } + updated_at_by = updated_at_by(issue) + + data.merge(updated_at_by) if updated_at_by.present? + end end |