修改BUG
This commit is contained in:
parent
f51873d98b
commit
4f9625b265
|
@ -47,6 +47,8 @@ class MembersController < ApplicationController
|
|||
|
||||
def create
|
||||
if params[:refusal_button]
|
||||
members = []
|
||||
applied_members = true
|
||||
if params[:membership]
|
||||
if params[:membership][:user_ids]
|
||||
attrs = params[:membership].dup
|
||||
|
@ -57,6 +59,7 @@ class MembersController < ApplicationController
|
|||
end
|
||||
end
|
||||
else
|
||||
applied_members = false
|
||||
members = []
|
||||
project_info = []
|
||||
user_grades = []
|
||||
|
@ -94,7 +97,7 @@ class MembersController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to_settings_in_projects }
|
||||
format.js { @members = members;@applied_members = members; }
|
||||
format.js { @members = members;@applied_members = applied_members; }
|
||||
format.api {
|
||||
@member = members.first
|
||||
if @member.valid?
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
||||
hideOnLoad();
|
||||
|
||||
<%if !@applied_members%>
|
||||
<% if @members.present? && @members.all? {|m| m.valid? } %>
|
||||
<% @members.each do |member| %>
|
||||
$("#member-<%= member.id %>").effect("highlight");
|
||||
|
@ -9,3 +10,4 @@ hideOnLoad();
|
|||
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
|
||||
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
|
||||
<% end %>
|
||||
<%end%>
|
||||
|
|
Loading…
Reference in New Issue