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

73 lines
3.2 KiB
Plaintext
Raw Normal View History

2013-09-12 17:19:51 +08:00
<div class="content_frame">
<% if @memberships.empty? %>
<% if @user != User.current %>
<p class="font_description">
<%= l(:label_project_course_un) %>
</p>
<% else %>
2013-10-09 16:14:11 +08:00
<p class="font_description">
<% if @user.user_extensions.identity == 0 %>
<!--teacher could create the course directly-->
2013-10-09 16:14:11 +08:00
<%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
<% else %>
<!--joined the list of the courstlist-->
<%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'projects',:action=>'course', :course => 1}, :class => 'icon icon-add' %>
<% end %>
2013-10-09 16:14:11 +08:00
</p>
<% end %>
<% else %>
<% unless @user != User.current %>
2013-10-09 16:14:11 +08:00
<% if @user.user_extensions.identity == 0 %>
<p><%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %></p>
<% end %>
<% end %>
2013-10-07 22:23:42 +08:00
<ul class="user_project_sort">
2013-09-23 08:44:48 +08:00
<% for membership in @memberships %>
2013-10-07 22:23:42 +08:00
2013-09-23 08:44:48 +08:00
<li>
2013-10-07 22:23:42 +08:00
<% if @user.roles_for_project(membership.project).first.to_s == 'Manager' || @user.roles_for_project(membership.project).first.to_s == 'TA' %>
2013-09-23 08:44:48 +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>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>
<table width="580" border="0">
<tr>
2013-09-23 13:35:29 +08:00
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span style="float: right"><%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;&nbsp;
2013-09-23 08:44:48 +08:00
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
2013-09-23 13:35:29 +08:00
<!-- <%= l(:label_member)%>(<span style="color: #ed8924"><%= link_to (membership.project.members.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>) </span> --></td>
2013-09-23 08:44:48 +08:00
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" >
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
2013-10-12 08:53:45 +08:00
老师
2013-09-23 08:44:48 +08:00
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
2013-10-12 08:53:45 +08:00
学生
2013-09-23 08:44:48 +08:00
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %>
2013-10-12 08:53:45 +08:00
助教
2013-09-23 08:44:48 +08:00
<% end %>
</td>
</tr>
</table></td>
</tr>
2013-10-07 22:23:42 +08:00
</table><% end %>
2013-09-23 08:44:48 +08:00
</li>
2013-10-07 22:23:42 +08:00
2013-09-23 08:44:48 +08:00
<% end %>
2013-10-07 22:23:42 +08:00
2013-09-23 08:44:48 +08:00
</ul>
2013-09-23 08:44:48 +08:00
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
2013-09-12 17:19:51 +08:00
</div>