diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index bb1e359ca..96ea2a84e 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -62,7 +62,7 @@ class IssuesController < ApplicationController def issue_commits begin 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 @type = params[:type] limit = 20 @@ -82,7 +82,7 @@ class IssuesController < ApplicationController # 选择对应的Commit 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 end diff --git a/app/views/issues/_issue_commits.html.erb b/app/views/issues/_issue_commits.html.erb index 5a666ea8e..3190cda41 100644 --- a/app/views/issues/_issue_commits.html.erb +++ b/app/views/issues/_issue_commits.html.erb @@ -1,4 +1,4 @@ -
+

关联Commit

@@ -13,11 +13,11 @@
<%= 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 %> -
    +
    •  分支  :  <%= 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();" %>
    diff --git a/app/views/issues/_issue_commits_list.html.erb b/app/views/issues/_issue_commits_list.html.erb index e61b92eed..10cfe57ca 100644 --- a/app/views/issues/_issue_commits_list.html.erb +++ b/app/views/issues/_issue_commits_list.html.erb @@ -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 %> @@ -22,10 +22,11 @@ <% end %> +
    @@ -38,4 +39,21 @@
    -<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file