pull_request index页面
This commit is contained in:
parent
6b8184ed49
commit
76b2ca1d7c
|
@ -47,4 +47,9 @@ module PullRequestsHelper
|
|||
|
||||
end
|
||||
|
||||
def request_commonts_count request_id, gpid
|
||||
g = Gitlab.client
|
||||
comments_count = g.merge_request_comments(gpid, request_id).count
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,15 +2,21 @@
|
|||
<div class="no-merge-content">没有可显示的请求</div>
|
||||
<% else %>
|
||||
<% @requests.each do |request| %>
|
||||
<li>
|
||||
<% request %>
|
||||
<%=link_to request.title, project_pull_request_path(request.id, :project_id => @project.id), :class => "linkGrey3 fb fl hidden", :style => "width:100%;"%>
|
||||
<!--<a href="javascript:void(0);" class="fr fontGrey2 fb"><img src="/images/comments.png" class="mr5" width="15" />0</a><span class="fr mr15 fb fontGrey2">关闭</span>-->
|
||||
<div class="cl mb5"></div>
|
||||
<span class="fontGrey2">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "link-blue" %> 创建于<%= time_tag(request.created_at) %></span>
|
||||
<span class="fr fontGrey2"><%= time_tag(request.updated_at) %>更新</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<div class="clear new_roadmap_listbox">
|
||||
<div class="clear">
|
||||
<span class="icons_pullreques fl "></span>
|
||||
<h4 class="fl new_roadmap_listtitle"><%=link_to request.title, project_pull_request_path(request.id, :project_id => @project.id) %></h4>
|
||||
<% if request_commonts_count(request.try(:id), @project.gpid) > 0 %>
|
||||
<%= link_to request_commonts_count(request.try(:id), @project.gpid), project_pull_request_path(request.id, :project_id => @project.id), :class => "fr mt2" %>
|
||||
<% end %>
|
||||
<%= link_to "", project_pull_request_path(request.id, :project_id => @project.id), :class => "issues_icons_mes fr mr5 ml5" %>
|
||||
</div>
|
||||
<div class="c_grey clear mt5">
|
||||
<p class="fl">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p>
|
||||
<span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span>
|
||||
<p class="fr"><%= @project.name+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= request.target_branch %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;">
|
||||
|
|
|
@ -3,45 +3,23 @@
|
|||
<div class="new_roadmap_conbox " >
|
||||
<div class="new_roadmap_navbox clear">
|
||||
<ul class="new_roadmap_nav fl" >
|
||||
<li class="new_roadmap_nav_hover"><%= link_to "待处理<span class='new_roadmap_nav_taghover ml5'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||
<li><%= link_to "已处理<span class='new_roadmap_nav_tagnomal ml5'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||
<li><%= link_to "已关闭<span class='new_roadmap_nav_tagnomal ml5'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
|
||||
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "btn btn-green fr mr15 mt10" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<li id="new_roadmap_nav_1" class="new_roadmap_nav_hover " onclick="HoverLi(1);">
|
||||
<a href="javascript:void(0);" id="new_roadmap_type_1" class="new_roadmap_type_nomal" >待处理<span id="new_roadmap_num_1" class="new_roadmap_nav_taghover ml5">210</span></a>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_2" onclick="HoverLi(2);" >
|
||||
<a href="javascript:void(0);" id="new_roadmap_type_2" class="new_roadmap_type_nomal" >已处理<span id="new_roadmap_num_2" class="new_roadmap_nav_tagnomal ml5">25</span></a>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_3" onclick="HoverLi(3);" >
|
||||
<a href="javascript:void(0);" id="new_roadmap_type_3" class="new_roadmap_type_nomal" >关闭<span id="new_roadmap_num_3" class="new_roadmap_nav_tagnomal ml5">5</span></a>
|
||||
</li>
|
||||
<li class="new_roadmap_nav_hover"><%= link_to "待处理<span class='new_roadmap_nav_taghover ml5'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true, :class => "new_roadmap_type_nomal" %></li>
|
||||
<li><%= link_to "已处理<span class='new_roadmap_nav_tagnomal ml5'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true, :class => "new_roadmap_type_nomal" %></li>
|
||||
<li><%= link_to "已关闭<span class='new_roadmap_nav_tagnomal ml5'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true, :class => "new_roadmap_type_nomal" %></li>
|
||||
</ul>
|
||||
<a href="javascript:void(0);" class="btn btn-green fr mr15 mt10"> 新建 </a>
|
||||
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "btn btn-green fr mr15 mt10" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pullreques_category clear ">
|
||||
<a href="javascript:void(0);" class="sortdownbtn mt10 fr mr15"></a>
|
||||
<a href="javascript:void(0);" class="sy_cgrey fr">更新时间</a>
|
||||
<a href="javascript:void(0);" class="sortupbtn mt10 fr"></a>
|
||||
<a href="javascript:void(0);" class="sy_cgrey fr">创建时间 </a>
|
||||
</div>
|
||||
<div id="new_roadmap_content_1">
|
||||
<div class="clear new_roadmap_listbox">
|
||||
<div class="clear">
|
||||
<span class="icons_pullreques fl "></span><h4 class="fl new_roadmap_listtitle"><a href="javascript:void(0);" class="">两个分支作用不是很大</a></h4>
|
||||
<a href="javascript:void(0);" class="fr mt2">3</a>
|
||||
<a href="javascript:void(0);" class="issues_icons_mes fr mr5 ml5 "></a>
|
||||
</div>
|
||||
<div class="c_grey clear mt5">
|
||||
<p class="fl">由 <a href="javascript:void(0);" class="linkBlue2 " >胡莎莎</a> 创建于1个月前</p>
|
||||
<span class="fl ml10">大约1个月前更新</span>
|
||||
<p class="fr">凌彬/Rep_course<span class="c_grey02 ml10 mr10">合并到</span>胡莎莎/Rep_quality</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="pullreques_category clear ">-->
|
||||
<!--<a href="javascript:void(0);" class="sortdownbtn mt10 fr mr15"></a>-->
|
||||
<!--<a href="javascript:void(0);" class="sy_cgrey fr">更新时间</a>-->
|
||||
<!--<a href="javascript:void(0);" class="sortupbtn mt10 fr"></a>-->
|
||||
<!--<a href="javascript:void(0);" class="sy_cgrey fr">创建时间 </a>-->
|
||||
<!--</div>-->
|
||||
<div id="pull_requests_list">
|
||||
<%= render "pull_requests/pull_requests_list" %>
|
||||
|
||||
<div class=" pages ">
|
||||
<a href="javascript:void(0);" class="pages-big" >上一页</a>
|
||||
<a href="javascript:void(0);" class="active " >1</a>
|
||||
|
@ -54,12 +32,6 @@
|
|||
</div><!--翻页 end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--new_roadmap_content_1 end-->
|
||||
<div id="new_roadmap_content_2" class="undis">
|
||||
ddd
|
||||
</div><!--new_roadmap_content_2 end-->
|
||||
<div id="new_roadmap_content_3" class="undis">
|
||||
eee
|
||||
</div><!--new_roadmap_content_3 end-->
|
||||
</div><!--new_roadmap end-->
|
||||
<!--PullReques列表结束-->
|
||||
|
||||
|
@ -102,10 +74,10 @@
|
|||
|
||||
<script>
|
||||
// $("#mergeBanner").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
|
||||
$("#mergeBanner").parent().before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
// $("#mergeBanner").parent().before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
|
||||
$(".project-merge-banner li").click(function(){
|
||||
$(".project-merge-banner li").removeClass("new_roadmap_nav_hover");
|
||||
$(".new_roadmap_nav li").click(function(){
|
||||
$(".new_roadmap_nav li").removeClass("new_roadmap_nav_hover");
|
||||
$(this).addClass("new_roadmap_nav_hover");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -768,9 +768,9 @@ input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
|
|||
a.issues_list_title{ color:#444; max-width:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; }
|
||||
a:hover.issues_list_title{color:#3b94d6;}
|
||||
.issues_list_titlebox span{ font-size: 12px;color: #888; font-weight: normal; }
|
||||
.issues_ciricons_01{ width: 22px; height: 22px; display: inline-block; background: url("../images/project/icons_issue.png") 0 0 no-repeat;}
|
||||
.issues_ciricons_02{ width: 22px; height: 22px; display: inline-block; background: url("../images/project/icons_issue.png") 0 -30px no-repeat;}
|
||||
.issues_icons_mes{width: 17px; height: 17px; display: inline-block; background: url("../images/project/icons_issue.png") 0 -57px no-repeat; }
|
||||
.issues_ciricons_01{ width: 22px; height: 22px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 0 no-repeat;}
|
||||
.issues_ciricons_02{ width: 22px; height: 22px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 -30px no-repeat;}
|
||||
.issues_icons_mes{width: 17px; height: 17px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 -57px no-repeat; }
|
||||
.issues_list_name{ font-size: 12px;}
|
||||
.issues_list_name:hover{ color: #3b94d6;}
|
||||
.issues_list_small{ font-size: 12px; color: #666;}
|
||||
|
|
Loading…
Reference in New Issue