issue和commit关联的一些修改和调整
This commit is contained in:
parent
a1a96e4667
commit
0785c71308
|
@ -62,7 +62,7 @@ class IssuesController < ApplicationController
|
||||||
def issue_commits
|
def issue_commits
|
||||||
begin
|
begin
|
||||||
return render_404 if @project.gpid.nil?
|
return render_404 if @project.gpid.nil?
|
||||||
@issue_commit_ids = params[:issue_commit_ids].split(",")
|
@issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil?
|
||||||
search = params[:search].to_s.lstrip.rstrip
|
search = params[:search].to_s.lstrip.rstrip
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
limit = 20
|
limit = 20
|
||||||
|
@ -82,7 +82,7 @@ class IssuesController < ApplicationController
|
||||||
|
|
||||||
# 选择对应的Commit
|
# 选择对应的Commit
|
||||||
def commit_for_issue
|
def commit_for_issue
|
||||||
history_commit_ids = params[:issue_commit_ids]
|
history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil?
|
||||||
@issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq
|
@issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="muban_popup_box" style="width:745px;">
|
<div style="width:745px;">
|
||||||
<div class="muban_popup_top">
|
<div class="muban_popup_top">
|
||||||
<h3 class="fl">关联Commit</h3>
|
<h3 class="fl">关联Commit</h3>
|
||||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
|
@ -13,11 +13,11 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<%= form_tag(url_for(:controller => 'issues', :action => 'issue_commits', :project_id => @project.id, :type => "search"),
|
<%= form_tag(url_for(:controller => 'issues', :action => 'issue_commits', :project_id => @project.id, :type => "search"),
|
||||||
:remote => true, :method => 'get', :id => 'issue_commit_form', :class => "fl") do %>
|
:remote => true, :method => 'get', :id => 'issue_commit_form', :class => "fl") do %>
|
||||||
<ul class="clear lightheight28 fl">
|
<ul class="clear lightheight28 fl mr100">
|
||||||
<li class="mb10 clear fl">
|
<li class="mb10 clear fl">
|
||||||
<span class=" fl"> 分支 : </span>
|
<span class=" fl"> 分支 : </span>
|
||||||
<%= select_tag :branch, options_for_select(["#{@default_branch}"]+ @branch_names, @rev),
|
<%= select_tag :branch, options_for_select(["#{@default_branch}"]+ @branch_names, @rev),
|
||||||
:class => "fl newupload_select", :style => "width:180px;",
|
:class => "fl newupload_select", :style => "width:180px;height:28px;",
|
||||||
:onchange => "$('#issue_commit_form').submit();" %>
|
:onchange => "$('#issue_commit_form').submit();" %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id, :issue_commit_ids => @issue_commit_ids), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %>
|
<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %>
|
||||||
<table class="newupload_table " cellspacing="0" cellpadding="0">
|
<table class="newupload_table " cellspacing="0" cellpadding="0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -22,10 +22,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<input value="" name="issue_for_commit_ids" id="issue_for_commit_ids" type="hidden">
|
||||||
</table>
|
</table>
|
||||||
<div class="clear">
|
<div class="clear">
|
||||||
<div class="clear fl mt10">
|
<div class="clear fl mt10">
|
||||||
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#commit_for_issue').submit();hideModal()">确 定</a>
|
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="search_and_branch_for_commit_ids();">确 定</a>
|
||||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml10" onclick="hideModal()">取 消</a>
|
<a href="javascript:void(0);" class="sy_btn_grey fl ml10" onclick="hideModal()">取 消</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align:center;">
|
<div style="text-align:center;">
|
||||||
|
@ -38,4 +39,21 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function search_and_branch_for_commit_ids(){
|
||||||
|
var issue_commit_ids = $("#issue_commit_ids .commit_id_value");
|
||||||
|
var str = "";
|
||||||
|
for(var i=0; i < issue_commit_ids.length; i++){
|
||||||
|
str += $(issue_commit_ids[i]).html();
|
||||||
|
if(i != issue_commit_ids.length -1){
|
||||||
|
str += ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alert(str);
|
||||||
|
$('#issue_for_commit_ids').val(str);
|
||||||
|
$('#commit_for_issue').submit();
|
||||||
|
hideModal();
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in New Issue