bigdir/app/views/projects/_member_list.html.erb

40 lines
1.8 KiB
Plaintext

<% if members.any? %>
<% members.each do |member| %>
<div class="well">
<% next if member.new_record? %>
<% unless member.created_on.nil? %>
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<% end %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %>
<%= content_tag "div", link_to(member.user.name, user_path(member.user)), :class => "nomargin avatar_name" %>
<!--teacher's code disapeared moified by huang-->
<% if @project.project_type == 1 %>
<% unless member.user.user_extensions.identity ==0 %>
<!-- added by bai 加学号 -->
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil?) %>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %>
<% end %>
<% end %>
<div class ="clear avatar_name"> &nbsp;
<p>
</p>
</div>
<% else%>
<%= content_tag "div", content_tag("p", rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ')), :class => "clear avatar_name" %>
<div class="clear avatar_user">
<p>
<%= l(:label_user_for_project_grade) %>: <span style="color:#ec6300"><%= UserGrade.find_by_user_id_and_project_id(member[:user_id], @project.id).grade %></span>
</p>
</div>
<% end %>
<%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %>
</div>
<% end; reset_cycle %>
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
<% else %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>