2014-06-12 16:01:38 +08:00
|
|
|
<%if @project%>
|
2013-08-01 10:33:49 +08:00
|
|
|
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
2014-06-12 16:01:38 +08:00
|
|
|
<%elsif @course%>
|
|
|
|
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'courses/settings/members') %>');
|
|
|
|
<%end%>
|
|
|
|
|
2013-08-01 10:33:49 +08:00
|
|
|
hideOnLoad();
|
|
|
|
|
2014-05-22 13:40:41 +08:00
|
|
|
<%if !@applied_members%>
|
2014-05-22 15:33:38 +08:00
|
|
|
<% if @members.present? && @members.all? {|m| m.valid? } %>
|
|
|
|
<% @members.each do |member| %>
|
|
|
|
$("#member-<%= member.id %>").effect("highlight");
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2015-01-30 14:16:32 +08:00
|
|
|
<% if @members %>
|
|
|
|
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')%>
|
|
|
|
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors || ''))) %>');
|
|
|
|
<% else%>
|
|
|
|
// alert('');
|
|
|
|
<% end%>
|
2013-08-01 10:33:49 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|