PULL Request部分功能

This commit is contained in:
huang 2016-10-24 14:34:54 +08:00
parent 76a3686f9f
commit d97c559e9c
7 changed files with 88 additions and 103 deletions

View File

@ -1,7 +1,7 @@
<div class="pd15box"> <div class="pd15box">
<div class="clear mb30"> <div class="clear mb30">
<%= 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 %> <%= 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" class="pullreques_reply_textarea"></textarea> <textarea id="pull_request_comment" name="pull_request_comment" class="pullreques_reply_textarea" style="padding-left: 0px;"></textarea>
<span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span> <span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
<a href="javascript:void(0);" class="btn btn-blue fr" onclick="pull_request_commit()">留言</a> <a href="javascript:void(0);" class="btn btn-blue fr" onclick="pull_request_commit()">留言</a>
<% end %> <% end %>

View File

@ -1,81 +1,60 @@
<div class="pullreques_pullbox">
<div class="pullreques_pull_top clear"> <div class="pullreques_pullbox">
<p class="fl c_grey ml15">2016-09-12</p> <div class="pullreques_pull_top clear">
<p class="fr c_green mr15">2个提交</p> <p class="fl c_grey ml15">2016-09-12</p>
</div> <p class="fr c_green mr15">2个提交</p>
<ul class="pullreques_pull_list"> </div>
<li class="clear"> <ul class="pullreques_pull_list">
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫姚虫虫姚虫虫 </a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫姚虫虫姚虫虫 </a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
<li class="clear"> </li>
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫</a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫</a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
<li class="clear"> </li>
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 尹刚 </a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 尹刚 </a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
</ul> </li>
</div> </ul>
<div class="pullreques_pullbox"> </div>
<div class="pullreques_pull_top clear"> <div class="pullreques_pullbox">
<p class="fl c_grey ml15">2016-09-12</p> <div class="pullreques_pull_top clear">
<p class="fr c_green mr15">2个提交</p> <p class="fl c_grey ml15">2016-09-12</p>
</div> <p class="fr c_green mr15">2个提交</p>
<ul class="pullreques_pull_list"> </div>
<li class="clear"> <ul class="pullreques_pull_list">
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫姚虫虫姚虫虫 </a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫姚虫虫姚虫虫 </a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
<li class="clear"> </li>
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫</a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫</a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
<li class="clear"> </li>
<span class="fl c_grey ml15 ">19分钟前</span> <li class="clear">
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 尹刚 </a> <span class="fl c_grey ml15 ">19分钟前</span>
<p class="pullreques_pull_txt ml10 fl">Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop</p> <a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 尹刚 </a>
<span class="fr mr15 c_grey">acbc94af</span> <p class="pullreques_pull_txt ml10 fl">Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop</p>
</li> <span class="fr mr15 c_grey">acbc94af</span>
</ul> </li>
</div> </ul>
<div class="pullreques_pullbox"> </div>
<div class="pullreques_pull_top clear">
<p class="fl c_grey ml15">2016-09-12</p>
<p class="fr c_green mr15">2个提交</p>
</div>
<ul class="pullreques_pull_list">
<li class="clear">
<span class="fl c_grey ml15 ">19分钟前</span>
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫姚虫虫姚虫虫 </a>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
<span class="fr mr15 c_grey">acbc94af</span>
</li>
<li class="clear">
<span class="fl c_grey ml15 ">19分钟前</span>
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 姚虫虫</a>
<p class="pullreques_pull_txt ml10 fl">项目导航栏数字错误</p>
<span class="fr mr15 c_grey">acbc94af</span>
</li>
<li class="clear">
<span class="fl c_grey ml15 ">19分钟前</span>
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> 尹刚 </a>
<p class="pullreques_pull_txt ml10 fl">Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop</p>
<span class="fr mr15 c_grey">acbc94af</span>
</li>
</ul>
</div>

View File

@ -28,32 +28,32 @@
<div class="alert alert-orange mb15 "> <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> 在管理员接受后,将由系统自动合并。<%= link_to "接受", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "linkBlue2", :remote => true %>接受</a>
</div> </div>
<div class="new_roadmap_conbox " > <div class="new_roadmap_conbox mb10" >
<div class=" clear"> <div class=" clear">
<ul class="new_roadmap_nav fl" > <ul class="new_roadmap_nav fl" >
<li class="new_roadmap_nav_hover "> <li class="new_roadmap_nav_hover" id="new_roadmap_nav_1" onclick="HoverLi(1);">
<%= 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" %> <%= link_to "评论<span class='new_roadmap_nav_taghover ml5' id='new_roadmap_num_1'>#{@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", :id => "new_roadmap_type_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>--> <!--<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>
<li> <li id="new_roadmap_nav_2" onclick="HoverLi(2);">
<%= 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> <%= link_to "提交<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_2'>#{@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", :id => "new_roadmap_type_2" %></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>--> <!--<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>
<li> <li id="new_roadmap_nav_3" onclick="HoverLi(3);">
<%= 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> <%= link_to "改动<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_3'>#{@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", :id => "new_roadmap_type_3" %></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>--> <!--<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>
</ul> </ul>
<% if @type == nil || @type == "1" %> <% if @type == nil || @type == "1" %>
<div id="merge_record_0"> <div id="merge_record_1">
<%= render :partial => "pull_requests/pull_request_comments" %> <%= render :partial => "pull_requests/pull_request_comments" %>
</div> </div>
<% end %> <% end %>
<div id="merge_record_1" class="undis"> <div id="merge_record_2" class="undis">
<%= render :partial => "pull_requests/pull_request_commits" %> <%= render :partial => "pull_requests/pull_request_commits" %>
</div> </div>
<div id="merge_record_2" class="undis"> <div id="merge_record_3" class="undis">
<%= render :partial => "pull_requests/pull_request_changes" %> <%= render :partial => "pull_requests/pull_request_changes" %>
</div> </div>
</div> </div>
@ -61,15 +61,21 @@
<!--PullReques结束--> <!--PullReques结束-->
<script> <script>
$(".new_roadmap_nav li").click(function(){ function g(o){
$(".new_roadmap_nav li").removeClass("new_roadmap_nav_hover"); return document.getElementById(o);
$(this).addClass("new_roadmap_nav_hover"); }
function HoverLi(n){
var index = $(".new_roadmap_nav li").index(this); //如果有N个标签,就将i<=N;
for(var i=1;i<=3;i++){
$("#merge_record_0, #merge_record_1, #merge_record_2").hide(); g('new_roadmap_nav_'+i).className='new_roadmap_nav_nomal';
console.log(index); g('new_roadmap_type_'+i).className='new_roadmap_type_nomal';
$("#merge_record_" + index).show(); g('new_roadmap_num_'+i).className='new_roadmap_nav_tagnomal';
}); g('merge_record_'+i).className='undis';
}
g('new_roadmap_nav_'+n).className='new_roadmap_nav_hover';
g('new_roadmap_type_'+n).className='new_roadmap_type_hover';
g('new_roadmap_num_'+n).className='new_roadmap_nav_taghover';
g('merge_record_'+n).className='dis';
}
</script> </script>

View File

@ -1 +1 @@
$("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>'); $("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');

View File

@ -1 +1 @@
$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_comments") %>'); $("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_comments") %>');

View File

@ -1 +1 @@
$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits") %>'); $("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits") %>');

View File

@ -981,7 +981,7 @@ a.sortdownbtn{background: url(/images/sy/liststyle.png) 0 -12px no-repeat; width
.pullreques_blueicon{ background: url(/images/new_project/icons_issue.png) 0 -299px no-repeat; display: inline-block; width: 43px; height: 16px;} .pullreques_blueicon{ background: url(/images/new_project/icons_issue.png) 0 -299px no-repeat; display: inline-block; width: 43px; height: 16px;}
.pullreques_greyicon{ background: url(/images/new_project/icons_issue.png) 0 -322px no-repeat; display: inline-block; width: 43px; height: 16px;} .pullreques_greyicon{ background: url(/images/new_project/icons_issue.png) 0 -322px no-repeat; display: inline-block; width: 43px; height: 16px;}
.pullreques_greyicon02{ background: url(/images/new_project/icons_issue.png) 0 -344px no-repeat; display: inline-block; width:43px; height: 16px;} .pullreques_greyicon02{ background: url(/images/new_project/icons_issue.png) 0 -344px no-repeat; display: inline-block; width:43px; height: 16px;}
.pullreques_reply_textarea{ width: 100%; padding:0; height: 60px; color: #666;} .pullreques_reply_textarea{ width: 100%; padding:2; height: 60px; color: #666;}
.pullreques_reply_list li{ padding:15px 0; border-top: 1px dashed #ddd; } .pullreques_reply_list li{ padding:15px 0; border-top: 1px dashed #ddd; }
.pullreques_reply_user_img{ width:50px;height:50px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} .pullreques_reply_user_img{ width:50px;height:50px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
a.pullreques_reply_name{ font-weight: bold; color: #333;} a.pullreques_reply_name{ font-weight: bold; color: #333;}