完成pull request 关闭功能
This commit is contained in:
parent
26c11693fd
commit
d1b4e83fee
|
@ -14,9 +14,12 @@ class PullRequestsController < ApplicationController
|
||||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
|
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
|
||||||
when "2"
|
when "2"
|
||||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}
|
@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
|
end
|
||||||
@requests_opened_count = @requests.count
|
@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|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<ul id="mergeBanner" class="project-merge-banner">
|
<ul id="mergeBanner" class="project-merge-banner">
|
||||||
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||||
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||||
|
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
|
||||||
|
|
||||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
Loading…
Reference in New Issue