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

60 lines
3.3 KiB
Plaintext
Raw Normal View History

2016-08-04 15:07:15 +08:00
<div id="create_pull_request_error">
<%= render :partial => "pull_requests/error_message" %>
</div>
2016-08-04 15:07:15 +08:00
<div id="pull_request_show">
<div id="mergeShow" class="f14 fontGrey2 merge-show">
<span class="mr10 open-status"><%= @request.state == "merged" ? "已合并" : "待处理" %></span><span class="mr10">合并请求</span> 由<%= 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) %>提交 · 最后编辑时间<%= time_tag(@request.updated_at) %>
<!--<a href="javascript:void(0);" class="BlueCirBtnMini fr mt5">编辑</a>-->
<div class="cl"></div>
</div>
<div class="new-merge-row b_grey"><strong><%= @request.title %></strong><p class="mt10"><%= @request.description %></p></div>
<div class="mt10 mb15">
请求将 <span class="fontGrey3 fb"><%= @request.source_branch %></span> 合并至 <span class="fontGrey3 fb"><%= @request.target_branch %></span>
<div class="merge-commit-option mt15">
2016-08-04 11:35:04 +08:00
<% if @commits_count == 0 && @changes_count == 0 %>
<span class="fontGrey3 fb" style="font-size:13px;"><img src="/images/warning.png" width="16" class="mr5 mt2 fl"><%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %></span><br />
<p class="fontGrey2 mt5">请将新改动提交至源分支或者切换到其它目标分支</p>
2016-08-04 11:35:04 +08:00
<% else %>
2016-08-04 14:24:32 +08:00
<% if @request.state == "merged" %>
<span class="fontGrey3 fb" style="font-size:13px;"><a href="javascript:void(0);" class="link-blue"> Hjqreturn</a>于两小时前合并</span><br />
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
2016-08-04 14:24:32 +08:00
<% else %>
2016-08-04 15:36:02 +08:00
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
2016-08-04 14:24:32 +08:00
<% end %>
</div>
</div>
2016-08-04 15:07:15 +08:00
<ul class="merge-record" style="border-top:1px solid #ddd;">
<li><%= link_to "提交<span class='project-number-dot'>#{@commits_count}</span>".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => 1), :remote => true, :class => "active" %></li>
<li><%= link_to "改动<span class='project-number-dot'>#{@changes_count}</span>".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => 2), :remote => true %></li>
</ul>
<div class="new-merge-row b_grey fontGrey2"><span class="ml10"> 根据最近提交时间排列</span></div>
<div id="merge_record_0">
<%= render :partial => "pull_requests/pull_request_commits" %>
</div>
<div id="merge_record_1" class="undis">
<%= render :partial => "pull_requests/pull_request_changes" %>
</div>
<% end %>
</div>
<script>
2016-08-04 15:07:15 +08:00
$("#pull_request_show").parent().css("width","730px");
$("#changed-files").toggle(function(){
$("#changed-files-detail").show();
},function(){
$("#changed-files-detail").hide();
});
$(".merge-record li a").click(function(){
$(".merge-record li a").removeClass("active");
$(this).addClass("active");
var index = $(".merge-record li a").index(this);
$("#merge_record_0, #merge_record_1").hide();
$("#merge_record_" + index).show();
});
</script>