From e30006be3974bacd032431f5cf1b59d6c5513ce8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 16 Dec 2016 18:47:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 6 +++--- app/views/mailer/journals_for_message_add.html.erb | 1 - app/views/users/_anonymous_evaluation_list.html.erb | 4 ++-- app/views/users/_unfinished_homework_list.html.erb | 4 ++-- app/views/users/_unfinished_test_list.html.erb | 4 ++-- app/views/users/_unsolved_issues_list.html.erb | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5ddf69a2d..562d133bb 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1872,7 +1872,7 @@ class UsersController < ApplicationController @applied_message_alls << mess end elsif message_all.message_type == "CourseMessage" - if (mess.course_message_type == "JoinCourse" && mess.status == 0) + if mess.course_message_type == "JoinCourseRequest" && mess.status == 0 @applied_message_alls << mess end end @@ -2083,8 +2083,8 @@ class UsersController < ApplicationController @message_alls << mess end elsif message_all.message_type == "CourseMessage" - if (mess.course_message_type == "JoinCourse" && mess.status == 0) - @message_alls << mess + if mess.course_message_type == "JoinCourseRequest" && mess.status == 0 + @message_alls << mess end end end diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb index cfb288d9d..294f27d6a 100644 --- a/app/views/mailer/journals_for_message_add.html.erb +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -1,7 +1,6 @@

- <%= link_to(h("#{@user.login}(#{@user.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> 给你留言了

diff --git a/app/views/users/_anonymous_evaluation_list.html.erb b/app/views/users/_anonymous_evaluation_list.html.erb index 3a6be81ff..67447f50e 100644 --- a/app/views/users/_anonymous_evaluation_list.html.erb +++ b/app/views/users/_anonymous_evaluation_list.html.erb @@ -3,10 +3,10 @@ - + - + diff --git a/app/views/users/_unfinished_homework_list.html.erb b/app/views/users/_unfinished_homework_list.html.erb index 2ed7cc187..50e89da7c 100644 --- a/app/views/users/_unfinished_homework_list.html.erb +++ b/app/views/users/_unfinished_homework_list.html.erb @@ -3,10 +3,10 @@
作业标题
  • 作业标题
  • 来源 类型截止剩余时间截止剩余时间
    - + - + diff --git a/app/views/users/_unfinished_test_list.html.erb b/app/views/users/_unfinished_test_list.html.erb index 0ae28b857..b13018573 100644 --- a/app/views/users/_unfinished_test_list.html.erb +++ b/app/views/users/_unfinished_test_list.html.erb @@ -3,10 +3,10 @@
    作业标题
  • 作业标题
  • 来源 类型截止剩余时间截止剩余时间
    - + - + diff --git a/app/views/users/_unsolved_issues_list.html.erb b/app/views/users/_unsolved_issues_list.html.erb index f08527fda..a27e3536b 100644 --- a/app/views/users/_unsolved_issues_list.html.erb +++ b/app/views/users/_unsolved_issues_list.html.erb @@ -3,7 +3,7 @@
    测验标题
  • 测验标题
  • 来源 测验时长截止剩余时间截止剩余时间
    - + From 7a2856423916ed96b08fa2954b1765f7e2808f90 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Dec 2016 19:09:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE404=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_project_attachment.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/_project_attachment.html.erb b/app/views/projects/_project_attachment.html.erb index 7f5a6a2cf..580e5bee2 100644 --- a/app/views/projects/_project_attachment.html.erb +++ b/app/views/projects/_project_attachment.html.erb @@ -9,10 +9,10 @@
    <%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> TO - <%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %> + <%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
    - <%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %> + <%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
    From 611494ec93b42ecd2f0aa75a820d380d42e9f45c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Dec 2016 19:36:37 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=8F=AA=E6=98=BE=E7=A4=BA30=E5=A4=A9=E5=89=8D=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 6 ++++++ app/views/users/_user_message_system.html.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index cc203ee63..ed504c5db 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -33,6 +33,12 @@ module UsersHelper result = unsolved_issues_count + unfinished_homework_count + unfinished_test_count + unfinished_poll_count + anonymous_evaluation_count + unapproval_homework end + # 判断某个时间再多少天前 + # params[:num] 天数 + def many_days_ago time, num + time > Time.now - 86400 * num + end + def issue_list(issues, &block) ancestors = [] issues.each do |issue| diff --git a/app/views/users/_user_message_system.html.erb b/app/views/users/_user_message_system.html.erb index 3c0f72879..4e4399b74 100644 --- a/app/views/users/_user_message_system.html.erb +++ b/app/views/users/_user_message_system.html.erb @@ -1,4 +1,4 @@ -<% if ma.class == SystemMessage %> +<% if ma.class == SystemMessage && many_days_ago(ma.created_at, 30) %> <%# @user_system_messages.each do |usm| %>
      From 72ff8804242357ab87b4bcb17058b20f52b224e4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 16 Dec 2016 20:19:57 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- app/views/users/course_community.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 562d133bb..0790696cc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1820,7 +1820,7 @@ class UsersController < ApplicationController # 自己的主页显示消息 # 系统消息为管理员发送,我的消息中包含有系统消息 @message_alls = [] - messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc") + messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" , @user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc") messages.each do |message_all| mess = message_all.message unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1) @@ -2079,7 +2079,7 @@ class UsersController < ApplicationController @message_alls << mess end elsif (message_all.message_type == "AppliedMessage" ) - if (mess.applied_type == "AppliedProject" && mess.status == 1) || (mess.applied_type == "ApplyAddSchools" && mess.status == 0) + if (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) @message_alls << mess end elsif message_all.message_type == "CourseMessage" diff --git a/app/views/users/course_community.html.erb b/app/views/users/course_community.html.erb index 2a066c86b..eb82a09ba 100644 --- a/app/views/users/course_community.html.erb +++ b/app/views/users/course_community.html.erb @@ -1,7 +1,7 @@
      -
      消息动态
      +
      最新动态
        • From 0c8774416e02df8d61b24072fa4a89fd4e7b4cb0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 16 Dec 2016 20:50:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user.html.erb | 4 ++-- app/views/projects/_no_data.html.erb | 2 +- app/views/users/_anonymous_evaluation_list.html.erb | 2 +- app/views/users/_no_data.html.erb | 2 +- app/views/users/_no_data.html.erb.BASE.erb | 0 app/views/users/_no_data.html.erb.LOCAL.erb | 4 ---- app/views/users/_no_data.html.erb.REMOTE.erb | 4 ---- app/views/users/_unfinished_homework_list.html.erb | 2 +- app/views/users/_unfinished_poll_list.html.erb | 2 +- app/views/users/project_community.js.erb.BASE.erb | 0 app/views/users/project_community.js.erb.LOCAL.erb | 6 ------ app/views/users/project_community.js.erb.REMOTE.erb | 6 ------ 12 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 app/views/users/_no_data.html.erb.BASE.erb delete mode 100644 app/views/users/_no_data.html.erb.LOCAL.erb delete mode 100644 app/views/users/_no_data.html.erb.REMOTE.erb delete mode 100644 app/views/users/project_community.js.erb.BASE.erb delete mode 100644 app/views/users/project_community.js.erb.LOCAL.erb delete mode 100644 app/views/users/project_community.js.erb.REMOTE.erb diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index c636ea701..bbea03ba1 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -167,7 +167,7 @@
          • <%= link_to user_course_count > 0 ? "课程#{user_course_count}".html_safe : "课程", - {:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %> + {:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :target => "_blank" %>
    标题
  • 标题
  • 来源 发布人 优先度