2015-04-14 15:34:04 +08:00
|
|
|
<%if @project%>
|
|
|
|
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
|
|
|
|
|
|
|
<%if !@applied_members%>
|
|
|
|
<% if @members.present? && @members.all? {|m| m.valid? } %>
|
|
|
|
<% @members.each do |member| %>
|
|
|
|
$("#member-<%= member.id %>").effect("highlight");
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<% 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 || ''))) %>');
|
|
|
|
<% end%>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
<%elsif @course%>
|
|
|
|
<% if @create_member_error_messages%>
|
|
|
|
alert("<%= @create_member_error_messages%>");
|
|
|
|
<% else%>
|
|
|
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
|
|
|
alert("添加成功");
|
|
|
|
<% end%>
|
|
|
|
<%end%>
|
|
|
|
|
|
|
|
hideOnLoad();
|