|
|
|
@ -102,72 +102,73 @@ module UsersHelper
|
|
|
|
|
s = content_tag('span', l(:label_has_watched_project), :class => "current-page")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_project_take), {:controller => 'users', :action => 'user_projects'}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def user_course(state)
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
if @user != User.current
|
|
|
|
|
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")
|
|
|
|
|
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")
|
|
|
|
|
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
|
|
|
|
|
s = content_tag('span', l(:label_teaching_course), :class => "current-page")
|
|
|
|
|
content << content_tag('li', s)
|
|
|
|
|
content << content_tag('li', link_to(l(:label_release_homework), {:controller => 'users', :action => 'user_courses', :type => 1}))
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
when 1
|
|
|
|
|
s = content_tag('span', l(:label_release_homework), :class => "current-page")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_teaching_course), {:controller => 'users', :action => 'user_courses'}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if @user.user_extensions.identity == 0
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
s = content_tag('span', l(:label_teaching_course), :class => "current-page")
|
|
|
|
|
content << content_tag('li', s)
|
|
|
|
|
content << content_tag('li', link_to(l(:label_release_homework), {:controller => 'users', :action => 'user_courses', :type => 1}))
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
when 1
|
|
|
|
|
s = content_tag('span', l(:label_release_homework), :class => "current-page")
|
|
|
|
|
content << content_tag('li', link_to(l(:label_teaching_course), {: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', l(:label_my_course), :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(l(:label_my_course), {:controller => 'users', :action => 'user_courses', :type => 0}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
else
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
|
s = content_tag('span', l(:label_my_course), :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(l(:label_my_course), {:controller => 'users', :action => 'user_courses', :type => 0}))
|
|
|
|
|
content << content_tag('li', s, :class => "current-page")
|
|
|
|
|
content_tag('div', content, :class => "pagination")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# added by huang
|
|
|
|
|
def sort_user(state, project_type)
|
|
|
|
|
# added by huang
|
|
|
|
|
def sort_user(state, project_type)
|
|
|
|
|
content = ''.html_safe
|
|
|
|
|
case state
|
|
|
|
|
when 0
|
|
|
|
@ -205,5 +206,12 @@ def sort_user(state, project_type)
|
|
|
|
|
end
|
|
|
|
|
content = content_tag('ul', content)
|
|
|
|
|
content_tag('div', content, :class => "tabs_enterprise")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def gender_avatar_uri user
|
|
|
|
|
img_uri = '/images/sidebar/female.png'
|
|
|
|
|
return img_uri if user.user_extensions.blank?
|
|
|
|
|
person_gender = user.user_extensions.gender
|
|
|
|
|
img_uri = (person_gender == 1) ? '/images/sidebar/female.png' : '/images/sidebar/male.png'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|