socialforge/app/views/pull_requests/_show.html.erb

76 lines
4.3 KiB
Plaintext

<div id="create_pull_request_error">
<%= render :partial => "pull_requests/error_message" %>
</div>
<!--PullReques开始-->
<div class="new_roadmap_conbox mb10" >
<div class="new_roadmap_info_top clear ">
<%= link_to "返回合并请求列表<span class='new_roadmap_icons_back mr5'></span>".html_safe, project_pull_requests_path(@project), :class => "fl linkBlue2 mt3" %>
<span class="ml5 mr5 fl f14">|</span><h4 class="fl new_roadmap_listtitle"><%= @request.title %> </h4><span class="fl <%= pr_status_css(@request.state) %> mt3 ml5"></span>
<% if User.current.login == @request.author.try(:username) || is_project_manager?(User.current.id, @project.id) %>
<% unless @request.state == "merged" %>
<%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "fr c_grey" %>
<% end %>
<% end %>
<a href="javascript:void(0);" class=" fr c_grey mr10" >编辑</a>
</div>
<div class="clear new_roadmap_listbox">
<div class="c_grey02 mb10">
<p><%= @request.description %></p>
</div>
<div class="c_grey clear mt5">
<p class="fl">由 <a href="javascript:void(0);" class="linkBlue2 " ><%= @request.author.try(:username) %></a>于 <%= format_time(@request.created_at) %> 创建</p>
<span class="fl ml10">最近更新:<%= format_time(@request.updated_at) %></span>
<p class="fr"><%= @request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= @request.target_branch %></p>
</div>
</div>
</div>
<div class="alert alert-orange mb15 ">
在管理员接受后,将由系统自动合并。<%= link_to "接受", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "linkBlue2", :remote => true %>接受</a>
</div>
<div class="new_roadmap_conbox " >
<div class=" clear">
<ul class="new_roadmap_nav fl" >
<li class="new_roadmap_nav_hover ">
<%= link_to "评论<span class='new_roadmap_nav_taghover ml5'>#{@comments_count}</span>".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id, :type => "1"), :remote => true, :class => "new_roadmap_type_nomal" %>
<!--<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>
<%= link_to "提交<span class='new_roadmap_nav_tagnomal ml5'>#{@commits_count}</span>".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => "2"), :remote => true, :class => "new_roadmap_type_nomal" %></li>
<!--<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>
<%= link_to "改动<span class='new_roadmap_nav_tagnomal ml5'>#{@changes_count}</span>".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => "3"), :remote => true, :class => "new_roadmap_type_nomal" %></li>
<!--<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>
</ul>
<% if @type == nil || @type == "1" %>
<div id="merge_record_0">
<%= render :partial => "pull_requests/pull_request_comments" %>
</div>
<% end %>
<div id="merge_record_1" class="undis">
<%= render :partial => "pull_requests/pull_request_commits" %>
</div>
<div id="merge_record_2" class="undis">
<%= render :partial => "pull_requests/pull_request_changes" %>
</div>
</div>
</div>
<!--PullReques结束-->
<script>
$(".new_roadmap_nav li").click(function(){
$(".new_roadmap_nav li").removeClass("new_roadmap_nav_hover");
$(this).addClass("new_roadmap_nav_hover");
var index = $(".new_roadmap_nav li").index(this);
$("#merge_record_0, #merge_record_1, #merge_record_2").hide();
console.log(index);
$("#merge_record_" + index).show();
});
</script>