commit
68dd0a52d2
@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the pull_requests controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,50 @@
|
||||
module PullRequestsHelper
|
||||
|
||||
# 获取diff内容行号
|
||||
def diff_line_num content
|
||||
content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i
|
||||
end
|
||||
|
||||
# 处理内容
|
||||
def diff_content content
|
||||
content.gsub!(/.*@@ -\d+,\d+ \+\d+,\d+ @@\n/m,'')
|
||||
end
|
||||
|
||||
def get_user_name user_id
|
||||
User.find(user_id).try(:login)
|
||||
end
|
||||
|
||||
# 获取接受PullRequest用户的信息
|
||||
def accept_user pull_request_id
|
||||
PullRequest.where(:pull_request_id => pull_request_id).first
|
||||
end
|
||||
|
||||
def get_state state
|
||||
case state
|
||||
when "open","reopened"
|
||||
l(:label_state_open)
|
||||
when "closed"
|
||||
l(:label_state_closed)
|
||||
when "merged"
|
||||
l(:label_state_merged)
|
||||
end
|
||||
end
|
||||
|
||||
def type_count type, requests_opened_count, requests_merged_count, requests_closed_count
|
||||
case type
|
||||
when nil, "1"
|
||||
requests_opened_count
|
||||
when "2"
|
||||
requests_merged_count
|
||||
when "3"
|
||||
requests_closed_count
|
||||
end
|
||||
end
|
||||
|
||||
# 判断是否允许创建Pull Request
|
||||
# 如果分支相同,并且项目相同则提示
|
||||
def judge_pr_allow
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
class PullRequest < ActiveRecord::Base
|
||||
attr_accessible :gpid, :pull_request_id, :user_id
|
||||
validates_uniqueness_of :pull_request_id
|
||||
end
|
@ -1,6 +1,27 @@
|
||||
class UserWechat < ActiveRecord::Base
|
||||
attr_accessible :subscribe, :openid, :nickname, :sex, :language, :city, :province, :country,
|
||||
:headimgurl, :subscribe_time, :unionid, :remark, :groupid, :user, :user_id
|
||||
:headimgurl, :subscribe_time, :unionid, :remark, :groupid, :user, :user_id, :bindtype
|
||||
|
||||
belongs_to :user
|
||||
|
||||
def real?
|
||||
bindtype == 0
|
||||
end
|
||||
|
||||
def migrate_user(u)
|
||||
self.bindtype = 0
|
||||
old_user = user.id
|
||||
self.user = u
|
||||
self.save
|
||||
|
||||
## 主要是将comment 迁移
|
||||
User.delete(old_user)
|
||||
|
||||
JournalsForMessage.where(user_id: old_user).update_all(user_id: u.id)
|
||||
Journal.where(user_id: old_user).update_all(user_id: u.id)
|
||||
Comment.where(author_id: old_user).update_all(author_id: u.id)
|
||||
Message.where(author_id: old_user).update_all(author_id: u.id)
|
||||
BlogComment.where(author_id: old_user).update_all(author_id: u.id)
|
||||
UserActivity.where(user_id: old_user).update_all(user_id: u.id)
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => (@project.nil? ? nil : @project.id)}) %>";
|
||||
pop_box_new(htmlvalue,460,40,50);
|
||||
pop_box_new(htmlvalue,460,190);
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'join_private_course') %>";
|
||||
pop_box_new(htmlvalue,460,40,50);
|
||||
pop_box_new(htmlvalue,460,220);
|
||||
|
@ -1,7 +1,9 @@
|
||||
<% if @course %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% elsif @project %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list', :locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments})%>");
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% elsif @org_subfield %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list', :locals => {org_subfield:@org_subfield, all_attachments:@all_attachments, sort:@sort, order:@order, org_subfield_attachments:@obj_attachments})%>");
|
||||
<%end %>
|
@ -1,6 +1,3 @@
|
||||
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %> //搜索的时候有时候是需要加载下一页,有时候是直接替换当前 #course_list。这个根据 page来判定
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach} )%>");
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @result.count%>")
|
||||
<% end %>
|
||||
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
|
@ -1,7 +1,2 @@
|
||||
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %> //搜索的时候有时候是需要加载下一页,有时候是直接替换当前 #course_list。这个根据 page来判定
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list',
|
||||
:locals => {project: @project, all_attachments:@result, sort:@sort, order:@order, project_attachments:@searched_attach})%>");
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'files/project_list',:locals => {project:@project, all_attachments:@result, sort:@sort, order:@order,project_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @project_attachment_result.count %>")
|
||||
<% end %>
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
|
@ -1,8 +1,7 @@
|
||||
<% if @course %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
|
||||
$("#course_filter_order").html("<%= escape_javascript(render :partial => 'course_file_filter_order', :locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach, tag_name: @tag_name, q: @q})%>");
|
||||
$("#attachment_count").html("<%= @result.count%>")
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'project_list',:locals => {project:@project, all_attachments:@result_search_project, sort:@sort, order:@order, project_attachments:@searched_attach}) %>");
|
||||
$("#attachment_count").html("<%= @result_search_project.count%>")
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% end %>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<% if @flash_message %>
|
||||
alert("<%= @flash_message %>");
|
||||
<% else%>
|
||||
$("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>');
|
||||
$("#applied_project_<%= @applied_message.id %>").html('<%= escape_javascript(render :partial => 'users/applied_project_content', :locals => {:ma => @applied_message}) %>');
|
||||
<% end%>
|
||||
|
@ -1 +1 @@
|
||||
$("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>');
|
||||
$("#applied_project_<%= @applied_message.id %>").html('<%= escape_javascript(render :partial => 'users/applied_project_content', :locals => {:ma => @applied_message}) %>');
|
@ -0,0 +1,88 @@
|
||||
<%= form_tag(url_for(:controller => 'pull_requests', :action => 'create', :project_id => @project.id, :forked_project_id => @forked_project.try(:gpid)), :id => 'pull_request_form', :method => "post", :remote => true) do %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-option-name fl mt8"><span class="c_red">*</span>标题</div><input type="text" id="pr_name" name="title" class="merge-title-input fl ml30" />
|
||||
<p id ="pull_request_title" class="fl ml100 fontGrey2 mt5 c_red" style="display: none">标题不能为空</p>
|
||||
<div class="cl mb10"></div>
|
||||
<div class="merge-option-name fl">描述</div><textarea type="text" name="description" class="merge-description-input fl ml30"></textarea>
|
||||
<!--<p class="fl ml100 f12 mt5"><a href="javascript:void(0);" class="AnnexBtn fl mr10">上传附件</a></p>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-wrap borderBottomNone">
|
||||
<div class="merge-option-name fl" style="padding:5px 0">源分支</div>
|
||||
<%= select_tag :branch, options_for_select(@source_rev), :id => "source_branch", :name => "source_branch", :value => "source_branch", :class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %>
|
||||
<div class="cl mb10"></div>
|
||||
<div class="merge-option-name fl" style="padding:5px 0">目标分支</div>
|
||||
<% if @forked_project.nil? %>
|
||||
<%= select_tag :branch, options_for_select(@source_rev), :id => "pull_request_branch", :name => "target_branch", :value => "target_branch",:class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %>
|
||||
<% else %>
|
||||
<select onchange="choice_branch(this.value, document.getElementById('pull_request_branch'), <%= @source_rev %>, <%= @forked_rev %>);" id="pull_request_project" name="source_project" value="source_project" class="ml30 fontGrey3 fb fl" style = "padding:5px 0 5px 5px;">
|
||||
<option name="<%= @project.id %>" value="source_project_name" ><%= @source_project_name %></option>
|
||||
<option name="<%= @forked_project.id %>" value="forked_project_name" ><%= @forked_project_name %></option>
|
||||
</select>
|
||||
<select name="target_branch" id="pull_request_branch" class = "ml30 fontGrey3 fb fl" style = "width:140px; padding:5px 0 5px 5px;">
|
||||
<% @source_rev.each do |rev| %>
|
||||
<option value="<%= rev %>"><%= rev %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<% end %>
|
||||
<p id="pull_request_project_hidden" style="display: none"><%= @forked_project.nil? ? "" : @project.id %></p>
|
||||
<div class="cl"></div>
|
||||
<p id ="pull_request_branch_error" class="ml100 fontGrey2 mt5 c_red" style="display: none">没有内容可以合并,请切换一个不同的分支</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-row b_grey" style="border-top:1px solid #ddd;">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl ml10" onclick="pull_request_commit()">提交请求</a>
|
||||
<%= link_to "返回", project_pull_requests_path(:project_id => @project.id), :class => "fr linkGrey2 mt5 mr10" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function regex_pr_name()
|
||||
{
|
||||
var name = $.trim($("#pr_name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#pull_request_title").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pull_request_title").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function regex_branch()
|
||||
{
|
||||
var source_branch = $.trim($("#source_branch").val());
|
||||
var target_branch = $.trim($("#pull_request_branch").val());
|
||||
var target_project = $.trim($("#pull_request_project").children().attr("name"));
|
||||
var target_forked_project = $.trim($("#pull_request_project_hidden").text());
|
||||
if(target_project == target_forked_project && source_branch == target_branch)
|
||||
{
|
||||
$("#pull_request_branch_error").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pull_request_branch_error").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//提交pull request
|
||||
function pull_request_commit()
|
||||
{
|
||||
if(regex_pr_name() && regex_branch())
|
||||
{
|
||||
$("#pull_request_form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
//切换项目时,替换分支
|
||||
$("#targetProject").change(function(){
|
||||
var defaultBranch = $("#targetBranch option:first-child").val();
|
||||
$("#targetBranch").val(defaultBranch);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,30 @@
|
||||
<div id="pull_request_new_form">
|
||||
<div id="create_pull_request_error">
|
||||
<%= render :partial => "pull_requests/error_message" %>
|
||||
</div>
|
||||
|
||||
<div class="new-merge-request">
|
||||
<div class="f14 fontGrey3 fb mb10">新的合并请求</div>
|
||||
</div>
|
||||
<%= render :partial => "pull_requests/form" %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("#pull_request_new_form").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>
|
@ -0,0 +1,41 @@
|
||||
<% if !@changes.blank? && @type == "3" %>
|
||||
<% @changes.each do |cd| %>
|
||||
<div class="showing-changes-row fontGrey2" style="width:710px;">
|
||||
<a class="linkGrey3" id="changed-files">
|
||||
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= cd['new_path'] %>
|
||||
</a>
|
||||
</div>
|
||||
<div class="autoscroll">
|
||||
<table class="filecontent syntaxhl" style="width:100%;" >
|
||||
<tbody>
|
||||
<% line_num = diff_line_num(cd['diff']) %>
|
||||
<% diff_content = diff_content(cd['diff']) %>
|
||||
<% syntax_highlight_lines('new_path', Redmine::CodesetUtil.to_utf8_by_setting(diff_content)).each do |line| %>
|
||||
<tr>
|
||||
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;">
|
||||
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a>
|
||||
</th>
|
||||
<% if line[0,1] == "-" %>
|
||||
<td class="line-code diff_out"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% elsif line[0,1] == "+" %>
|
||||
<td class="line-code diff_in"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% else%>
|
||||
<td class="line-code"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -0,0 +1,49 @@
|
||||
<div class="merge-discussion-input">
|
||||
<%= form_tag(url_for(:controller => 'pull_requests', :action => 'create_pull_request_comment', :project_id => @project.id), :id => 'pull_request_comment_form', :method => "post", :remote => true) do %>
|
||||
<textarea id="pull_request_comment" name="pull_request_comment"></textarea>
|
||||
<span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn mt10" onclick="pull_request_commit()">留言</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% @comments.each do |comment| %>
|
||||
<div class="merge-discussion-content merge-discussion-automatic">
|
||||
<%= link_to comment.author.try(:username), user_path(get_user_by_login_and(comment.author.try(:username))), :class => "link-blue mr15 fl" %>
|
||||
<span class="fl fontGrey2"><%= time_tag(comment.created_at) %>前</span>
|
||||
<div class="cl"></div>
|
||||
<div class="merge-discussion-detail"><%= comment.note %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function regex_pr_comment()
|
||||
{
|
||||
var comment = $.trim($("#pull_request_comment").val());
|
||||
if(comment.length == 0)
|
||||
{
|
||||
$("#pr_comment_tip").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pr_comment_tip").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//提交pull request_comment
|
||||
function pull_request_commit()
|
||||
{
|
||||
if(regex_pr_comment())
|
||||
{
|
||||
$("#pull_request_comment_form").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,32 @@
|
||||
<div class="new-merge-row b_grey fontGrey2"><span class="ml10"> 根据最近提交时间排列</span></div>
|
||||
<% if !@commits.blank? && @type == "2" %>
|
||||
<% @commits.each do |commit| %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-commit-time">
|
||||
<img width="16" class="ui-datepicker-trigger mr15" style="cursor:default; margin-top:3px; margin-left:0;" /><span class="fontGrey3"><%= format_date(commit.created_at) %></span>
|
||||
<!--<p class="mt10 fontGrey2">1次提交</p>-->
|
||||
<p class="mt10 fontGrey2"><%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %> 创建于<%= time_tag(commit.created_at) %>前</p>
|
||||
</div>
|
||||
<div class="merge-commit-detail">
|
||||
<span class="fontGrey3 fb"><%= commit.title %></span>
|
||||
|
||||
</div>
|
||||
<div class="merge-commit-code">
|
||||
<span class="fontGrey3">
|
||||
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
<script>
|
||||
$("#RSide").before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
</script>
|
@ -0,0 +1,24 @@
|
||||
<% if @requests.blank? %>
|
||||
<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>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
@ -0,0 +1,79 @@
|
||||
<div id="create_pull_request_error">
|
||||
<%= render :partial => "pull_requests/error_message" %>
|
||||
</div>
|
||||
|
||||
<div id="pull_request_show">
|
||||
<div id="mergeShow" class="f14 fontGrey2 merge-show">
|
||||
<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) %> 前
|
||||
<% 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" %>
|
||||
<% end %>
|
||||
<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">
|
||||
<%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>
|
||||
请求将 <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>
|
||||
<% else %>
|
||||
<% if @request.state == "merged" %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<% if accept_user(@request.id).blank? %>
|
||||
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
|
||||
<% else %>
|
||||
<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 %>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if is_project_manager?(User.current.id, @project.id) %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<% if @request.state == "closed" %>
|
||||
该请求已被关闭
|
||||
<% else %>
|
||||
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<ul class="merge-record" style="border-top:1px solid #ddd;">
|
||||
<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, :type => "1"), :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, :type => "2"), :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, :type => "3"), :remote => true %></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>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$("#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);
|
||||
|
||||
$("#merge_record_0, #merge_record_1, #merge_record_2").hide();
|
||||
$("#merge_record_" + index).show();
|
||||
});
|
||||
</script>
|
@ -0,0 +1,2 @@
|
||||
$("#create_pull_request_error").html('<%= escape_javascript(render :partial => "pull_requests/error_message") %>');
|
||||
|
@ -0,0 +1,3 @@
|
||||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<%= render :partial => "pull_requests/new" %>
|
||||
|
@ -0,0 +1 @@
|
||||
$("#create_pull_request_error").html('<%= escape_javascript(render :partial => "pull_requests/error_message") %>');
|
@ -0,0 +1,24 @@
|
||||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<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><%= 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;" %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
||||
<ul class="project-merge-content" id="pull_requests_list">
|
||||
<%= render "pull_requests/pull_requests_list" %>
|
||||
</ul>
|
||||
|
||||
|
||||
<script>
|
||||
$("#mergeBanner").parent().css("width","730px");
|
||||
|
||||
$(".project-merge-banner li").click(function(){
|
||||
$(".project-merge-banner li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
$("#pull_requests_list").html('<%= escape_javascript( render :partial => "pull_requests/pull_requests_list", :locals => {:type => @type} ) %>');
|
@ -0,0 +1,3 @@
|
||||
<%= render :partial => "pull_requests/pull_request_container" %>
|
||||
<%= render :partial => "pull_requests/new" %>
|
||||
|
@ -0,0 +1 @@
|
||||
$("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');
|
@ -0,0 +1 @@
|
||||
$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_comments") %>');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue