socialforge/app/views/users/_course_form.html.erb

54 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="content_frame">
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<!--added by huang for: filter by roles-->
<span style="float: right">
<% if User.current == @user %>
<% (membership.roles).each do |role| %>
<% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.project, User.current)%>&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<% end %>
<% else %>
<% end %>
<!--end-->
<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;
<%= 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>
<!-- added by bai -->
<% @course = Course.find_by_extra(membership.project.identifier)%>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.show_name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.show_name, user_path(@course.teacher)) %></span>
<span style="float: right; padding-left: 8px" ><%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %></span>
<!-- <span class="font_lighter" style="float: right"><%= l(:label_create_time) %> <%= format_time(membership.created_on) %></span> -->
<% end %>
</td></tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
</div>
<%= call_hook :view_account_left_bottom, :user => @user %>