diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-05-31 21:15:40 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-05-31 21:15:40 +0000 |
commit | eb728d37a7ed940d9d9b1f762c4ea65cc8e35a56 (patch) | |
tree | be6524aa6298385e9bcb93789989bd225b65b043 /app/helpers/issuables_helper.rb | |
parent | 161af17c1b69e7e00aefcd4f540a55755259ceda (diff) | |
parent | 3fc4b2c86090841d9a6245b9b73e46231610703e (diff) | |
download | gitlab-ce-eb728d37a7ed940d9d9b1f762c4ea65cc8e35a56.tar.gz |
Merge branch 'master' into 'trigger-source'
# Conflicts:
# db/schema.rb
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r-- | app/helpers/issuables_helper.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 9290e4ec133..c380a10c82d 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -199,6 +199,27 @@ module IssuablesHelper issuable_filter_params.any? { |k| params.key?(k) } end + def issuable_initial_data(issuable) + { + endpoint: namespace_project_issue_path(@project.namespace, @project, issuable), + canUpdate: can?(current_user, :update_issue, issuable), + canDestroy: can?(current_user, :destroy_issue, issuable), + canMove: current_user ? issuable.can_move?(current_user) : false, + issuableRef: issuable.to_reference, + isConfidential: issuable.confidential, + markdownPreviewUrl: preview_markdown_path(@project), + markdownDocs: help_page_path('user/markdown'), + projectsAutocompleteUrl: autocomplete_projects_path(project_id: @project.id), + issuableTemplates: issuable_templates(issuable), + projectPath: ref_project.path, + projectNamespace: ref_project.namespace.full_path, + initialTitleHtml: markdown_field(issuable, :title), + initialTitleText: issuable.title, + initialDescriptionHtml: markdown_field(issuable, :description), + initialDescriptionText: issuable.description + }.to_json + end + private def sidebar_gutter_collapsed? |