BigW Consortium Gitlab

Move issuable_app_data to helper

parent ab0374f4
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
......@@ -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' : '' }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment