From d1b4e83fee2e5a22de0c6d412444ee941933c27d Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 9 Aug 2016 10:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90pull=20request=20=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 5 ++++- app/views/pull_requests/index.html.erb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index c365a8b37..7233bdfe7 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -14,9 +14,12 @@ class PullRequestsController < ApplicationController @requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"} when "2" @requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"} + when "3" + @requests = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"} end @requests_opened_count = @requests.count - @requests_merged_count = params[:type] ? @requests.count : @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count + @requests_merged_count = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count + @requests_closed_count = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"}.count respond_to do |format| format.html format.js diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb index f9f7fe4db..23ca13178 100644 --- a/app/views/pull_requests/index.html.erb +++ b/app/views/pull_requests/index.html.erb @@ -2,6 +2,7 @@