From 6c093f68cf9460310b00a1bc9cf6ec2371c843cf Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 11:18:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=86=85=E7=9A=84?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=8F=AF=E4=BB=A5=E5=B0=86=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E3=80=81=E9=80=9A=E7=9F=A5=E3=80=81=E8=B5=84=E6=BA=90=E7=AD=89?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=B0=E8=AF=A5=E7=8F=AD=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2a91b75ae..7e9add5e2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2156,11 +2156,9 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) else - @course = @user.courses - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted end @search = params[:search] @type = params[:type] @@ -2178,7 +2176,7 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) + @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) else @projects = @user.projects.visible end From 3f7935bf85088fbcd5aaee3c8a3d2605f9fab0ef Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 14:39:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=8F=AD=E7=BA=A7/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E9=94=81=E5=AE=9A=E5=9B=9E=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=B7=B2=E6=9C=89=E5=9B=9E=E5=A4=8D=E7=9A=84=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=9B=9E=E5=A4=8D=E6=8C=89=E9=92=AE=E6=9C=AA=E5=B1=8F?= =?UTF-8?q?=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_message_replies.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 669aea26c..ce1e70887 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -24,6 +24,8 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <% if type == 'Message' %> + <% topic = comment.root %> + <% if !topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( l(:button_reply), @@ -33,6 +35,7 @@ :title => l(:button_reply)) %> + <% end %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %> <%= link_to( l(:button_delete), From 2c7eddbae601c0454f239327b8bf9c604fea216d Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 14:49:01 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=9A=84at=E5=9B=9E=E5=A4=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/at_message.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 5a175fe76..2212ef07e 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base status = -1 end when 'JournalsForMessage' - if at_message.jour && at_message.jour.course + if at_message.jour && defined? at_message.jour.course #作业回复 shield_type = "Course" container_id = at_message.jour.course.id @@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base else type = "journal_for_message" detail_id = topic.id - detail_title = at_message.subject + detail_title = at_message.notes end else status = -1 From f50663158ae1b75bdff395dfb03b75eb58d6662e Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 15:07:22 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 4c4374a29..f754c4540 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,12 +17,13 @@
  • - +
  • 正确示例:计算机系2016秋季A班
  • 错误示例:软件工程 - 计算机系2016秋季A班
  • +
  • 班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。
  • From 014b43cccd754f9b125bfb0c70ed86ad029e1bea Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 18 Sep 2016 15:09:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?oneapm=E6=B7=BB=E5=8A=A0=E5=88=B0=E5=BF=BD?= =?UTF-8?q?=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8a40f3ca7..a1f5f7e76 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb +/config/oneapm.yml /files/*