<% if @memberships.empty? %>
<% if @user != User.current %>
<%= l(:label_project_course_un) %>
<% else %>
<% if @user.user_extensions.identity == 0 %>
<%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
<% else %>
<%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'projects',:action=>'course', :course => 1}, :class => 'icon icon-add' %>
<% end %>
<% end %>
<% else %>
<% unless @user != User.current %>
<% if User.current.user_extensions.identity == 0 %>
<%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
<% end %>
<% end %>
<% for membership in @memberships %>
-
<% if @user.roles_for_project(membership.project).first.to_s == 'Reporter' %>
<%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %> |
<%= link_to_project(membership.project) %>
<%= l(:label_homework) %> (<%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %>)
<%= l(:label_course_news)%> (<%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %>)
|
<%= membership.project.description%>
|
<%= format_time(membership.created_on) %> |
课程角色:
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
老师
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
学生
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %>
助教
<% end %>
|
|
<% end %>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>