socialforge/app/views/projects/member.html.erb

32 lines
821 B
Plaintext
Raw Normal View History

2013-10-22 10:02:49 +08:00
<div class="member_header">
<p>
<%= l(:label_member_list)%>
</p>
</div>
2013-10-22 10:02:49 +08:00
<div class="member_content">
<%= error_messages_for 'member' %>
<% roles = Role.find_all_givable
members = @project.member_principals.includes(:roles, :principal).all.sort %>
<% if @project.project_type == 1 %>
<% else %>
<% users = UserGrade.find_by_sql("select * from user_grades where project_id = #{@project.id}")%>
<% if users %>
<% users.sort {|a,b| a[:grade] <=> b[:grade]} %>
<% temp = [] %>
<% users.each do |user|%>
<% members.each do |member|%>
<% if member[:user_id] == user[:user_id] %>
<% temp << member%>
<% end %>
<% end %>
<% end %>
<% members = temp.reverse %>
<% end %>
<% end %>
<%= render :partial => 'member_list', :locals => {:members => members} %>
2013-10-22 10:02:49 +08:00
</div>