From 27e755a0a9111b2a74823700a5ffb7bc4ad9af1f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 3 Aug 2016 15:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E5=8F=8A?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 1 + .../_pull_request_changes.html.erb | 66 ++++++++++--------- app/views/pull_requests/new.html.erb | 2 +- .../pull_requests/pull_request_changes.js.erb | 1 + app/views/pull_requests/show.html.erb | 8 ++- .../repositories/_commit_details.html.erb | 2 +- 6 files changed, 43 insertions(+), 37 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 9eb870b92..808459665 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -77,6 +77,7 @@ class PullRequestsController < ApplicationController # 获取某次请求的改动 def pull_request_changes + @type = 2 @changes = @g.merge_request_changes(@project.gpid, params[:id]) end diff --git a/app/views/pull_requests/_pull_request_changes.html.erb b/app/views/pull_requests/_pull_request_changes.html.erb index 465e985b9..b1abe1383 100644 --- a/app/views/pull_requests/_pull_request_changes.html.erb +++ b/app/views/pull_requests/_pull_request_changes.html.erb @@ -1,32 +1,34 @@ -
Showing 3 changed files with 3 additions and 3 deletions -
    -
  1. app/views/organizations/_org_course_homework.html.erb
  2. -
  3. app/views/users/_course_homework.html.erb
  4. -
  5. app/views/users/_user_homework_detail.html.erb
  6. -
-
-
app/views/organizations/_org_course_homework.html.erb
-
- - - - - - - - - - - - - - - - - - - - - -
9999<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
100100<div class="mt10">
111- <div class="fl mr5 fontGrey3">
111+ <div class="fl mr20 fontGrey3 w80">
-
\ No newline at end of file +<% @changes.each do |changes| %> +
Showing 3 changed files with 3 additions and 3 deletions +
    +
  1. app/views/organizations/_org_course_homework.html.erb
  2. +
  3. app/views/users/_course_homework.html.erb
  4. +
  5. app/views/users/_user_homework_detail.html.erb
  6. +
+
+
app/views/organizations/_org_course_homework.html.erb
+
+ + + + + + + + + + + + + + + + + + + + + +
9999<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
100100<div class="mt10">
111- <div class="fl mr5 fontGrey3">
111+ <div class="fl mr20 fontGrey3 w80">
+
+<% end %> diff --git a/app/views/pull_requests/new.html.erb b/app/views/pull_requests/new.html.erb index e77c2d364..47ba66f09 100644 --- a/app/views/pull_requests/new.html.erb +++ b/app/views/pull_requests/new.html.erb @@ -1,2 +1,2 @@ <%= render :partial => "pull_requests/pull_request_container" %> -<% render :partial => "pull_requests/new" %> \ No newline at end of file +<%= render :partial => "pull_requests/new" %> \ No newline at end of file diff --git a/app/views/pull_requests/pull_request_changes.js.erb b/app/views/pull_requests/pull_request_changes.js.erb index e69de29bb..10374c213 100644 --- a/app/views/pull_requests/pull_request_changes.js.erb +++ b/app/views/pull_requests/pull_request_changes.js.erb @@ -0,0 +1 @@ +$("#merge_record_1").html('<%= render :partial => "pull_requests/pull_request_changes" %>'); \ No newline at end of file diff --git a/app/views/pull_requests/show.html.erb b/app/views/pull_requests/show.html.erb index e8beb3e0d..c7e52b8d5 100644 --- a/app/views/pull_requests/show.html.erb +++ b/app/views/pull_requests/show.html.erb @@ -19,9 +19,11 @@
<%= render :partial => "pull_requests/pull_request_commits" %>
-
- <%= render :partial => "pull_requests/pull_request_changes" %> -
+<% if @type == 2 %> +
+ <%= render :partial => "pull_requests/pull_request_changes" %> +
+<% end %>