<% if @members.present? && @members.all? {|m| m.valid? } %>
  $('#principals_for_new_member').html('<%= j(render :partial => 'members/easy_principals_for_new_members', :locals => {:project => @project}) %>');
  $('#principals_for_new_groups').html('<%= j(render :partial => 'members/easy_principals_for_new_groups', :locals => {:project => @project}) %>');
  $('#tab-content-members').html('<%= j(render :partial => 'projects/settings/members', :locals => {:project => @project}) %>');
  hideOnLoad();
  <% if params[:hide_modal] %>
    hideModal();
  <% end %>
<% elsif @members.present? %>
  <% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
  alert('<%= raw(j(l(:notice_failed_to_save_members, :errors => errors))) %>');
<% end %>
