2013-11-08 20:54:45 +08:00
|
|
|
|
<div class="content_frame">
|
2013-10-31 15:18:42 +08:00
|
|
|
|
<ul class="user_project_sort">
|
2014-01-24 10:55:25 +08:00
|
|
|
|
<% for membership in memberships %>
|
2013-11-05 20:04:45 +08:00
|
|
|
|
<li>
|
2013-10-31 15:18:42 +08:00
|
|
|
|
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
|
|
|
|
|
<tr>
|
2013-11-01 15:48:23 +08:00
|
|
|
|
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
|
2013-10-31 15:18:42 +08:00
|
|
|
|
<td>
|
|
|
|
|
<table width="580" border="0">
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
|
2013-11-04 09:57:36 +08:00
|
|
|
|
<!--added by huang for: filter by roles-->
|
2013-11-01 16:08:41 +08:00
|
|
|
|
<span style="float: right">
|
2013-11-02 13:00:32 +08:00
|
|
|
|
<% if User.current == @user %>
|
2013-11-04 09:57:36 +08:00
|
|
|
|
<% (membership.roles).each do |role| %>
|
|
|
|
|
<% unless (role == Role.find(9) || role == Role.find(3)) %>
|
2013-11-02 13:00:32 +08:00
|
|
|
|
<%= join_in_course(membership.project, User.current)%>
|
|
|
|
|
<% end %>
|
2013-11-01 16:08:41 +08:00
|
|
|
|
<% end %>
|
2013-11-04 09:57:36 +08:00
|
|
|
|
<% else %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<!--end-->
|
2013-11-01 16:08:41 +08:00
|
|
|
|
<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)
|
2013-10-31 15:18:42 +08:00
|
|
|
|
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
|
|
|
|
|
|
|
|
|
|
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2" width="580" >
|
|
|
|
|
<p class="font_description">
|
|
|
|
|
<%= membership.project.description %>
|
|
|
|
|
</p></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td>
|
2013-11-06 09:25:05 +08:00
|
|
|
|
|
|
|
|
|
<!-- added by bai -->
|
2013-11-02 11:06:22 +08:00
|
|
|
|
<% @course = Course.find_by_extra(membership.project.identifier)%>
|
2014-03-13 22:06:49 +08:00
|
|
|
|
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
|
|
|
|
|
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %></span>
|
2013-11-13 11:03:51 +08:00
|
|
|
|
<span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span>
|
2013-11-05 20:04:45 +08:00
|
|
|
|
<!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> :<%= format_time(membership.created_on) %></span> -->
|
|
|
|
|
<% end %>
|
2013-10-31 15:18:42 +08:00
|
|
|
|
</td></tr>
|
|
|
|
|
</table></td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
2013-11-08 20:54:45 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2013-10-31 15:18:42 +08:00
|
|
|
|
<%= call_hook :view_account_left_bottom, :user => @user %>
|