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:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-31 19:35:47 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-05-31 19:35:47 +0300
commit882a591dcafd325f90fa3905a9ffee9b1e607676 (patch)
tree7ef7d772709204998f26b6a31fbb0acdf36fbeb0 /app/helpers
parentf9f0424443e4e8b5d39fadc437a8a573bba9e371 (diff)
parent29fd13056b34477abb142bf0380186eff6dd066a (diff)
Merge branch 'issue-edit-inline' into 'master'
Issue inline editing Closes #24873 See merge request !11322
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/issuables_helper.rb21
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?