diff options
| author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-22 11:38:11 +0100 |
|---|---|---|
| committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-31 11:35:05 +0100 |
| commit | d537a9a45b23bac1aaff028302aae515d6afe949 (patch) | |
| tree | 89c495d23e26ed29c1d1b0b2ef968a0e3263baf7 /app | |
| parent | ab0374f4d6e2bb72ee3040b9b906c2be23519cd7 (diff) | |
| download | gitlab-ce-d537a9a45b23bac1aaff028302aae515d6afe949.tar.gz | |
Move issuable_app_data to helper
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/issuables_helper.rb | 8 | ||||
| -rw-r--r-- | app/views/projects/issues/show.html.haml | 5 |
2 files changed, 9 insertions, 4 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 diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index f81a68744c0..4ce1f56da7d 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -55,10 +55,7 @@ .issue-details.issuable-details .detail-page-description.content-block - - issuable_app_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) - - issuable_app_data.merge(updated_at_by) if updated_at_by.present? - #js-issuable-app{ data: issuable_app_data } + #js-issuable-app{ data: issuable_app_data(@project, @issue) } %h2.title= markdown_field(@issue, :title) - if @issue.description.present? .description{ class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '' } |
