From 548a263f0fcca06f47f4dbed1843e691a991f313 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 31 Aug 2016 17:09:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE=E6=96=B0?= =?UTF-8?q?=E9=97=BB=E5=8F=91=E9=80=81=E8=87=B3=E5=85=B6=E4=BB=96=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=90=8E=EF=BC=8C=E4=BD=8D=E4=BA=8E=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E4=B8=8B=E7=9A=84bug=202.=E8=B5=84=E6=96=99=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E2=80=9C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99=E2=80=9D=E5=8F=AF=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=203.=E7=BB=84=E7=BB=87=E6=88=90=E5=91=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=88=E9=85=8D=E7=BD=AE=E6=88=90=E5=91=98=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E4=B8=BA=E5=AE=8C=E6=88=90=EF=BC=89=204.?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=A4=8D=E8=A1=A8=E6=83=85=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 4 ++-- app/controllers/organizations_controller.rb | 4 +++- app/controllers/projects_controller.rb | 1 + app/controllers/users_controller.rb | 3 ++- app/views/forums/index.html.erb | 2 -- .../layouts/_logined_header_show.html.erb | 4 ++-- app/views/memos/show.html.erb | 2 +- .../_org_left_subfield_list.html.erb | 14 ++++++------- .../organizations/_org_member_list.html.erb | 12 ++++++----- app/views/organizations/_org_members.html.erb | 2 +- app/views/organizations/setting.html.erb | 20 +++++++++++-------- .../projects/_project_member_list.html.erb | 5 ++++- app/views/projects/member.html.erb | 2 +- app/views/users/_project_news.html.erb | 2 +- .../users/_share_news_to_course.html.erb | 2 +- public/javascripts/org.js | 1 + 16 files changed, 45 insertions(+), 35 deletions(-) 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 @@