reverse projects list, add explain to role.
This commit is contained in:
parent
5a234e6fb2
commit
69869a05c9
|
@ -150,9 +150,10 @@ class UsersController < ApplicationController
|
|||
|
||||
# added by fq
|
||||
def user_courses
|
||||
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)).reverse
|
||||
case params[:type]
|
||||
when "2"
|
||||
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
when "2"
|
||||
#@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
@memberships = []
|
||||
@membership.each do |membership|
|
||||
if membership.project.project_type == 1
|
||||
|
@ -162,7 +163,7 @@ class UsersController < ApplicationController
|
|||
@state = 2
|
||||
|
||||
when "1"
|
||||
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
#@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
@memberships = []
|
||||
@membership.each do |membership|
|
||||
if membership.project.project_type == 1
|
||||
|
@ -177,7 +178,7 @@ class UsersController < ApplicationController
|
|||
@state = 1
|
||||
|
||||
else
|
||||
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
#@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
@memberships = []
|
||||
@membership.each do |membership|
|
||||
if membership.project.project_type == 1
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
|
||||
<td align="right" >
|
||||
|
||||
<td align="right" style="font-size: 13px">
|
||||
课程角色:
|
||||
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
老师
|
||||
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
|
||||
<td align="right" >
|
||||
|
||||
<td align="right" style="font-size: 13px">
|
||||
课程角色:
|
||||
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
老师
|
||||
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- added by fq -->
|
||||
<!--huang-->
|
||||
<% if @user.user_extensions.identity == 0 %> <!-- for teacher-->
|
||||
<%= render :partial => 'my_course' %>
|
||||
<%= render :partial => 'my_course' %>
|
||||
<% else %> <!--for student-->
|
||||
<%= render :partial => 'my_joinedcourse' %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue