解决ajax情况下,issue状态选框不显示问题

This commit is contained in:
huang 2016-07-13 12:23:28 +08:00
parent ef931d1491
commit 61bf6604b1
2 changed files with 5 additions and 4 deletions

View File

@ -440,6 +440,7 @@ class IssuesController < ApplicationController
jour.save jour.save
update_user_activity(@issue.class,@issue.id) update_user_activity(@issue.class,@issue.id)
update_forge_activity(@issue.class,@issue.id) update_forge_activity(@issue.class,@issue.id)
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id]
if params[:issue_id] if params[:issue_id]

View File

@ -4,15 +4,15 @@
<ul class="fl"> <ul class="fl">
<li> <li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label> <label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %> <%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }), <%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
{:no_label => true}, {:no_label => true},
# ajax 刷新 # ajax 刷新
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w150" %> :class => "w150" %>
<% else %> <%# else %>
<%= h(@issue.status.name) %> <%#= h(@issue.status.name) %>
<% end %> <%# end %>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>