2013-10-22 10:02:49 +08:00
|
|
|
<div class="member_header">
|
|
|
|
<p>
|
2013-10-31 10:57:46 +08:00
|
|
|
<%= l(:label_member_list) if params[:role].blank? %>
|
2013-10-22 10:02:49 +08:00
|
|
|
</p>
|
2013-10-21 09:42:09 +08:00
|
|
|
</div>
|
2013-10-22 10:02:49 +08:00
|
|
|
<div class="member_content">
|
|
|
|
<%= error_messages_for 'member' %>
|
2013-10-31 16:52:06 +08:00
|
|
|
<% roles = Role.find_all_givable %>
|
|
|
|
<% members = @project.member_principals.includes(:roles, :principal).all.sort %>
|
|
|
|
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
|
|
|
|
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
|
2013-10-22 10:02:49 +08:00
|
|
|
<% if @project.project_type == 1 %>
|
2013-10-24 09:46:22 +08:00
|
|
|
<%= render :partial => 'member_list', :locals => {:members => members} %>
|
2013-10-22 10:02:49 +08:00
|
|
|
<% else %>
|
|
|
|
<% users = UserGrade.find_by_sql("select * from user_grades where project_id = #{@project.id}")%>
|
|
|
|
<% if users %>
|
2013-10-24 09:46:22 +08:00
|
|
|
<% users = users.sort {|a,b| b[:grade] <=> a[:grade]} %>
|
2013-10-22 10:02:49 +08:00
|
|
|
|
|
|
|
<% temp = [] %>
|
|
|
|
<% users.each do |user|%>
|
|
|
|
<% members.each do |member|%>
|
|
|
|
<% if member[:user_id] == user[:user_id] %>
|
2013-10-24 09:46:22 +08:00
|
|
|
<% temp << member %>
|
2013-10-22 10:02:49 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2013-10-24 09:46:22 +08:00
|
|
|
<% temps = temp %>
|
|
|
|
<%= render :partial => 'member_list', :locals => {:members => temps} %>
|
2013-10-22 10:02:49 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2013-10-24 09:46:22 +08:00
|
|
|
<!-- <%= render :partial => 'member_list', :locals => {:members => members} %> -->
|
2013-10-22 10:02:49 +08:00
|
|
|
|
2013-10-21 09:42:09 +08:00
|
|
|
|
2013-10-22 10:02:49 +08:00
|
|
|
</div>
|
2013-10-21 09:42:09 +08:00
|
|
|
|