%= error_messages_for 'member' %>
<%
roles = Role.givable.all
if @project.project_type == Project::ProjectType_course
if User.current.language == "zh"
roles = ["管理人员","开发者","报告人员"]
else
roles = ["管理人员","开发者","报告人员"]
# roles = roles[3..5]
end
else
roles = roles[0..2]
end
members = @project.member_principals.includes(:roles, :principal).all.sort
%>
<% if @project.applied_projects.any? %>
<%= l(:label_apply_project) %>
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<%= render_principals_for_applied_members_new(@project) %>
- <%= l(:label_role_plural) %>:
<% roles.each do |role| %>
-
<%= check_box_tag 'membership[role_ids][]', role.id %>
<% end %>
<%= l(:label_approve) %>
<%= l(:label_refusal) %>
<% end %>
<% end %>
<%= l(:label_member_new) %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
<%= render_project_members(@project) %>
-
<%= l(:label_role_plural) %>:
<% roles.each do |role| %>
-
<%= check_box_tag 'membership[role_ids][]', role.id %>
<% if User.current.language == "zh" %>
<% if role.id == 3 %>
<% elsif role.id == 4 %>
<% else %>
<% end %>
<% else %>
<% end %>
<% end %>
新增成员
<% end%>
<% end %>