|
|
|
@ -94,6 +94,35 @@ module UsersHelper
|
|
|
|
|
|
|
|
|
|
def user_course(state)
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
if @user != User.current
|
|
|
|
|
if @user.user_extensions.identity == 0
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
s = content_tag('span', '他执教的课程', :class => "current-page")
|
|
|
|
|
content << content_tag('li', s)
|
|
|
|
|
content << content_tag('li', link_to('他发布的作业', {:controller => 'users', :action => 'user_courses', :type => 1}))
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
when 1
|
|
|
|
|
s = content_tag('span', '他发布的作业', :class => "current-page")
|
|
|
|
|
content << content_tag('li', link_to('他执教的课程', {:controller => 'users', :action => 'user_courses'}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
s = content_tag('span', '他的课程', :class => "current-page")
|
|
|
|
|
content << content_tag('li', s)
|
|
|
|
|
content << content_tag('li', link_to('他的作业', {:controller => 'users', :action => 'user_courses', :type => 1}))
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
when 1
|
|
|
|
|
s = content_tag('span', '他的作业', :class => "current-page")
|
|
|
|
|
content << content_tag('li', link_to('他的课程', {:controller => 'users', :action => 'user_courses', :type => 0}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if @user.user_extensions.identity == 0
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
@ -122,6 +151,7 @@ module UsersHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# added by huang
|
|
|
|
|
def sort_user(state, project_type)
|
|
|
|
|