Commit e3464a54 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove .js format for MergeRequest controller

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4e878ad9
...@@ -83,12 +83,12 @@ class MergeRequest ...@@ -83,12 +83,12 @@ class MergeRequest
url: this.$('.nav-tabs .diffs-tab a').attr('href') url: this.$('.nav-tabs .diffs-tab a').attr('href')
beforeSend: => beforeSend: =>
this.$('.status').addClass 'loading' this.$('.status').addClass 'loading'
complete: => complete: =>
@diffs_loaded = true @diffs_loaded = true
this.$('.status').removeClass 'loading' this.$('.status').removeClass 'loading'
success: (data) =>
dataType: 'script' this.$(".diffs").html(data.html)
dataType: 'json'
showAllCommits: -> showAllCommits: ->
this.$('.first-commits').remove() this.$('.first-commits').remove()
......
...@@ -2,8 +2,8 @@ require 'gitlab/satellite/satellite' ...@@ -2,8 +2,8 @@ require 'gitlab/satellite/satellite'
class Projects::MergeRequestsController < Projects::ApplicationController class Projects::MergeRequestsController < Projects::ApplicationController
before_filter :module_enabled before_filter :module_enabled
before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status] before_filter :merge_request, only: [:edit, :update, :show, :diffs, :automerge, :automerge_check, :ci_status]
before_filter :closes_issues, only: [:edit, :update, :show, :commits, :diffs] before_filter :closes_issues, only: [:edit, :update, :show, :diffs]
before_filter :validates_merge_request, only: [:show, :diffs] before_filter :validates_merge_request, only: [:show, :diffs]
before_filter :define_show_vars, only: [:show, :diffs] before_filter :define_show_vars, only: [:show, :diffs]
...@@ -26,8 +26,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -26,8 +26,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def show def show
respond_to do |format| respond_to do |format|
format.html format.html
format.js
format.diff { render text: @merge_request.to_diff(current_user) } format.diff { render text: @merge_request.to_diff(current_user) }
format.patch { render text: @merge_request.to_patch(current_user) } format.patch { render text: @merge_request.to_patch(current_user) }
end end
...@@ -44,6 +42,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -44,6 +42,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
diff_line_count = Commit::diff_line_count(@merge_request.diffs) diff_line_count = Commit::diff_line_count(@merge_request.diffs)
@suppress_diff = Commit::diff_suppress?(@merge_request.diffs, diff_line_count) && !params[:force_show_diff] @suppress_diff = Commit::diff_suppress?(@merge_request.diffs, diff_line_count) && !params[:force_show_diff]
@force_suppress_diff = Commit::diff_force_suppress?(@merge_request.diffs, diff_line_count) @force_suppress_diff = Commit::diff_force_suppress?(@merge_request.diffs, diff_line_count)
respond_to do |format|
format.html
format.json { render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } }
end
end end
def new def new
......
:plain
merge_request.$(".commits").html("#{escape_javascript(render(partial: "commits"))}");
:plain
merge_request.$(".diffs").html("#{escape_javascript(render(partial: "projects/merge_requests/show/diffs"))}");
:plain
merge_request.$(".notes").html("#{escape_javascript(render "notes/notes_with_form")}");
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