diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 62f9591ed..ef27bc69f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -78,7 +78,7 @@ class UsersController < ApplicationController ##added by fq def watch_bids @bids = Bid.watched_by(@user) - @bids = Bid.visible.where('reward_type = ?', 1) + @bids = Bid.visible.where('reward_type = ?', 1) # modified by huang @offset, @limit = api_offset_and_limit({:limit => 10}) @bid_count = @bids.count @bid_pages = Paginator.new @bid_count, @limit, params['page'] diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1f1ae692d..eb62f49ce 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -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 @@ -106,20 +135,21 @@ module UsersHelper 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") -end + 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") + end + end end end diff --git a/app/views/projects/_new_join.html.erb b/app/views/projects/_new_join.html.erb index dc55e697d..82cc61b4d 100644 --- a/app/views/projects/_new_join.html.erb +++ b/app/views/projects/_new_join.html.erb @@ -47,9 +47,9 @@
- <%= text_field_tag 'course_password', nil, :size => 27 %> | + - <%= text_field_tag 'course_password', nil, :size => 48%> + <%= text_field_tag 'course_password', nil, :size => 45 %>