summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-04-25 15:25:20 +0100
committerPhil Hughes <me@iamphill.com>2017-04-26 12:23:29 +0100
commit52d59a4e5108d2ffd6f2bc543ee9aef1a87a8f14 (patch)
treef1f9b1b7e46fcd441d3cf860016473ec04baf6de /app/controllers/concerns
parentf00bb1c29ea438be66b3766545a57b468ade37d4 (diff)
downloadgitlab-ce-52d59a4e5108d2ffd6f2bc543ee9aef1a87a8f14.tar.gz
Load milestone tabs asynchronously
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/milestone_actions.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/app/controllers/concerns/milestone_actions.rb b/app/controllers/concerns/milestone_actions.rb
new file mode 100644
index 00000000000..c28d08201e0
--- /dev/null
+++ b/app/controllers/concerns/milestone_actions.rb
@@ -0,0 +1,42 @@
+module MilestoneActions
+ extend ActiveSupport::Concern
+
+ def merge_requests
+ respond_to do |format|
+ format.json do
+ render json: tabs_json("shared/milestones/_merge_requests_tab", {
+ merge_requests: @milestone.merge_requests,
+ show_project_name: true
+ })
+ end
+ end
+ end
+
+ def participants
+ respond_to do |format|
+ format.json do
+ render json: tabs_json("shared/milestones/_participants_tab", {
+ users: @milestone.participants
+ })
+ end
+ end
+ end
+
+ def labels
+ respond_to do |format|
+ format.json do
+ render json: tabs_json("shared/milestones/_labels_tab", {
+ labels: @milestone.labels
+ })
+ end
+ end
+ end
+
+ private
+
+ def tabs_json(partial, data = {})
+ {
+ html: view_to_html_string(partial, data)
+ }
+ end
+end