diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 669da5502..02dfe9a45 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -30,7 +30,7 @@ class AccountController < ApplicationController user = UserExtensions.where(:user_id => User.current.id).first if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? redirect_to my_account_path(:tip => 1) - elsif user.identity == 3 && user.occupation.nil? + elsif user.identity == 3 && user.school_id.nil? redirect_to my_account_path(:tip => 1) else redirect_to user_path(User.current) @@ -359,7 +359,7 @@ class AccountController < ApplicationController user = UserExtensions.where(:user_id => User.current.id).first if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? redirect_to my_account_path(:tip => 1) - elsif user.identity == 3 && user.occupation.nil? + elsif user.identity == 3 && user.school_id.nil? redirect_to my_account_path(:tip => 1) else redirect_back_or_default User.current diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index b36ef592d..7fcdc0d27 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -421,6 +421,7 @@ class OrganizationsController < ApplicationController @organization = Organization.find(params[:id]) if User.current.admin? || User.current.admin_of_org?(@organization) + @members = OrgMember.where(:organization_id => @organization.id).all.sort else render_403 end @@ -451,10 +452,11 @@ class OrganizationsController < ApplicationController def members if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) - @members = OrgMember.where("organization_id =?", @organization.id) + @members = OrgMember.where(:organization_id => @organization.id).all.sort else render_403 end + @members = paginateHelper @members, 20 end def more_org_projects diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5dcf493ee..8d4c09ded 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -580,6 +580,7 @@ class ProjectsController < ApplicationController end end @members = paginateHelper @members + end def update_message_status(user, project) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e929153ad..642051599 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2628,7 +2628,8 @@ class UsersController < ApplicationController project_ids.each do |project_id| project = Project.find(project_id) if project.news.map(&:id).exclude?(news.id) - message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id) + # message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id) + message = News.create(:project_id => project.id, :title => news.title, :summary => news.summary, :description => news.description, :author_id => User.current.id, :created_on => Time.now ) # record forward to table forwards if new record is valid if message.valid? news.forwards << Forward.new(:to_type => message.class.name, :to_id => message.id) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 889def55e..376ca420a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -74,7 +74,6 @@ }); function check_and_submit(doc){ $("#error").html('').hide(); - check_forum_name(); if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){ $("#error").html("名称不能为空").show(); return; @@ -98,7 +97,6 @@ '<%= check_forum_name_forums_path %>', {"forum_name":encodeURIComponent(name)}, function(data){ - if( data == 'true'){ $("#error").html("贴吧名称已经存在").show(); check_pass = false; diff --git a/app/views/layouts/_logined_header_show.html.erb b/app/views/layouts/_logined_header_show.html.erb index a6721501e..7a2dd6ced 100644 --- a/app/views/layouts/_logined_header_show.html.erb +++ b/app/views/layouts/_logined_header_show.html.erb @@ -36,7 +36,7 @@ <%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %>
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 69e36ca34..435fd0f9e 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -90,7 +90,7 @@