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

71 lines
4.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">
2016-08-09 10:45:14 +08:00
<span class="mr10 open-status"><%= get_state(@request.state) %></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) %> 前
2016-08-08 15:23:55 +08:00
<% 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 => "BlueCirBtn fr" %>
2016-08-09 14:00:36 +08:00
<% end %>
2016-08-04 15:07:15 +08:00
<div class="cl"></div>
</div>
<div class="new-merge-row b_grey"><strong><%= @request.title %></strong><p class="mt10"><%= @request.description %></p></div>
2016-08-09 14:00:36 +08:00
2016-08-05 18:23:03 +08:00
<div class="mt10 mb15">
<%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>
2016-08-05 18:23:03 +08:00
请求将 <span class="fontGrey3 fb"><%= @request.source_branch %></span> 合并至 <span class="fontGrey3 fb"><%= @request.target_branch %></span>
<% if @commits_count == 0 && @changes_count == 0 %>
<div class="merge-commit-option mt15">
<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>
</div>
</div>
2016-08-04 14:24:32 +08:00
<% else %>
2016-08-05 18:23:03 +08:00
<% if @request.state == "merged" %>
<div class="merge-commit-option mt15">
2016-08-10 16:49:48 +08:00
<% unless accept_user(@request.id).blank? %>
<span class="fontGrey3 fb" style="font-size:13px;"><%= link_to User.find(accept_user(@request.id).user_id), user_path(accept_user(@request.id).user_id), :class => "link-blue" %> 于 <%= time_tag(accept_user(@request.id).created_at) %> 前合并</span><br />
<% end %>
2016-08-05 18:23:03 +08:00
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
</div>
<% else %>
2016-08-05 16:42:06 +08:00
<% if is_project_manager?(User.current.id, @project.id) %>
2016-08-05 18:23:03 +08:00
<div class="merge-commit-option mt15">
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
</div>
2016-08-05 16:42:06 +08:00
<% end %>
2016-08-05 18:23:03 +08:00
<% end %>
</div>
2016-08-09 14:00:36 +08:00
2016-08-05 18:23:03 +08:00
<ul class="merge-record" style="border-top:1px solid #ddd;">
2016-08-09 14:00:36 +08:00
<li><%= link_to "留言<span class='project-number-dot'>#{@comments_count}</span>".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id), :remote => true, :class => "active" %></li>
<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), :remote => true %></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), :remote => true %></li>
2016-08-05 18:23:03 +08:00
</ul>
<div id="merge_record_0">
2016-08-09 14:00:36 +08:00
<%= render :partial => "pull_requests/pull_request_comments" %>
2016-08-05 18:23:03 +08:00
</div>
<div id="merge_record_1" class="undis">
2016-08-09 10:45:14 +08:00
<%= render :partial => "pull_requests/pull_request_commits" %>
</div>
<div id="merge_record_2" class="undis">
2016-08-05 18:23:03 +08:00
<%= render :partial => "pull_requests/pull_request_changes" %>
</div>
<% end %>
2016-08-04 15:07:15 +08:00
</div>
<script>
2016-08-04 15:07:15 +08:00
$("#pull_request_show").parent().css("width","730px");
$(".merge-record li a").click(function(){
$(".merge-record li a").removeClass("active");
$(this).addClass("active");
var index = $(".merge-record li a").index(this);
2016-08-09 10:45:14 +08:00
$("#merge_record_0, #merge_record_1, #merge_record_2").hide();
$("#merge_record_" + index).show();
});
</script>