From 586cde6f87c1d89fac58681b2449c7aa07ec73d9 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 26 Oct 2015 09:04:09 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=88=90=E4=B8=BA=E8=AF=BE=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E8=80=81=E5=B8=88=E6=88=96=E6=95=99=E8=BE=85=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7425692c0..2ffc7338e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -918,6 +918,9 @@ class UsersController < ApplicationController end def show + #更新用户申请成为课程老师或教辅消息的状态 + join_course_messages = CourseMessage.where("course_message_type =? and course_message_id =? and viewed =?", 'JoinCourseRequest', @user.id, false) + join_course_messages.update_all(:viewed => true) @page = params[:page] ? params[:page].to_i + 1 : 0 user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" From 2824b564815aab96ec1f8191fc65c280d22a81d2 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Oct 2015 11:54:59 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=95=99=E5=B8=88=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user.html.erb | 24 +++++++++++++++++++++++- public/stylesheets/new_user.css | 5 +++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index f3adb0155..7e7a1adf7 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -103,7 +103,21 @@ 课程 <% if is_current_user%> <% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> - <%=link_to "", new_course_path(:host=> Setting.host_course), :class => "homepageMenuSetting fr", :title => "新建课程"%> +
+
    +
  • +
      +
    • + <%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%> +
    • + +
    • + <%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%> +
    • +
    +
  • +
+
<% else%> <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%> <% end%> @@ -201,5 +215,13 @@
+ diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 3b79af2bb..29d3397c6 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -696,6 +696,11 @@ a:hover.gz_btn{ color:#ff5722;} .lh18 {line-height: 18px;} .maxh360 {max-height: 360px;} +.courseMenu {width:30px; display:block; float:right;height: 50px;} +.courseMenuIcon {display:inline-block; background:url(../images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top: 16px; margin-right: 15px; position: relative;line-height:0;} +.topnav_course_menu{display: none; border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 20px;} +.topnav_course_menu a{color:#269ac9;} + /*课程主页css*/ .homepageCoursesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-65px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;} From d509ef01e83ed4fe03cf53f18556853751ed8007 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 26 Oct 2015 13:26:49 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5=E9=A1=B9=E7=9B=AE=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=8F=8D=E9=A6=88=E7=9A=84=E6=B6=88=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 5 +++++ app/controllers/courses_controller.rb | 4 ++++ app/controllers/users_controller.rb | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 86c220bd2..7632cf591 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -381,6 +381,11 @@ class ApplicationController < ActionController::Base if allowed true else + if params[:action] == 'show' + #更新申请结果反馈消息的状态 + messages = CourseMessage.where("course_message_type =? and course_id =? and user_id =? and viewed =?", 'CourseRequestDealResult', @course.id, User.current.id, false) + messages.update_all(:viewed => true) + end if @course && @course.archived? render_403 :message => :notice_not_authorized_archived_project else diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 56252253a..042311961 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -617,6 +617,10 @@ class CoursesController < ApplicationController create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0) create_course_messages.update_all(:viewed => true) + #更新申请结果反馈消息的状态 + course_request_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @course.id, 'CourseRequestDealResult', false) + course_request_messages.update_all(:viewed => true) + course_activities = @course.course_activities @canShowRealName = User.current.member_of_course? @course @page = params[:page] ? params[:page].to_i + 1 : 0 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2ffc7338e..e2edcb44a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -919,7 +919,8 @@ class UsersController < ApplicationController def show #更新用户申请成为课程老师或教辅消息的状态 - join_course_messages = CourseMessage.where("course_message_type =? and course_message_id =? and viewed =?", 'JoinCourseRequest', @user.id, false) + join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", + params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) join_course_messages.update_all(:viewed => true) @page = params[:page] ? params[:page].to_i + 1 : 0 user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" From 5fb1291bf8b15c84e7fb5ee6a4c96d6039dc3721 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 26 Oct 2015 14:15:23 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- app/views/users/_user_message_course.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e2edcb44a..2a646f5ce 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -919,7 +919,7 @@ class UsersController < ApplicationController def show #更新用户申请成为课程老师或教辅消息的状态 - join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", + join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and u ser_id =? and course_message_id =? and viewed =?", params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) join_course_messages.update_all(:viewed => true) @page = params[:page] ? params[:page].to_i + 1 : 0 diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index d7042b6c2..2398fd8c5 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -442,7 +442,7 @@ ">您有了新的课程成员申请:
  • - <%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id)), + <%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id), :course_id => ma.course_id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :onmouseover => "message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> From 5f5a235e4bc13c61271105104e5fbae007d13e49 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Oct 2015 14:35:42 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=90=8E=E9=A6=96=E9=A1=B5=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/_join_private_course.html.erb | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index 4122a7105..5748d981e 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -4,33 +4,33 @@ 快速进入课程通道