From e8d4bc0772285d8b4289bc51bc425321f5207f1b Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 5 Aug 2016 16:13:37 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=8F=AF=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index fb6bb6864..c598bda57 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1552,9 +1552,7 @@ function pop_box_new(value, Width, Height){ document.onmousemove = null; } - window.onload = function () { - new Drag("popupWrap"); - } + new Drag("popupWrap"); } // 公共提示弹框样式 From d4f08f6498d5ab96ab60fba4fec9edc32a8b77a2 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 5 Aug 2016 17:30:13 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E8=AF=BE=E7=A8=8Blogo=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=EF=BC=8C=E9=82=80=E8=AF=B7=E7=A0=81=E6=A0=B7=E5=BC=8F=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=8F=AD=E7=BA=A7=E8=B7=AF=E5=BE=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BB=E8=AE=B2=E6=95=99=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_course_base_info.html.erb | 2 ++ public/stylesheets/syllabus.css | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 1c01ecf53..805e708a9 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -3,6 +3,8 @@ <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count %>

+ <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %> +  >  <% if @course.syllabus %> <%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>  >  diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index d0f8d0286..6a214780a 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -323,9 +323,10 @@ a.sy_class_option:hover { height:110px; } .sy_class_id{ - width:110px; - height:80px; - background:#f1f1f1; + width:108px; + height:78px; + border:1px solid #f1f1f1; + background:#fff; text-align:center; padding-top:30px; } From 6c9a4a66201bd5d41fd5f5960d25ec2b6d7d0cca Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 10:38:44 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E9=A1=B9=E7=9B=AE=E6=A0=8F=E6=97=A0=E6=B3=95=E5=B1=95?= =?UTF-8?q?=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 932617671..85a5b66c7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1460,6 +1460,7 @@ class UsersController < ApplicationController def user_projects4show @page = params[:page].to_i + 1 @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10) + @all_count = @user.projects.visible.count end def user_course_activities From 40dc9b761fe9b04a7c744879519ae1ef04a6a4a5 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 10:39:12 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E6=9C=AA=E9=85=8D=E7=BD=AE=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E7=8F=AD=E7=BA=A7=E6=8A=A5404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_course_base_info.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 1c01ecf53..f661571f6 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -17,7 +17,9 @@

From 153e02c4fa15cee43a39d3157774662e400154a7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 10:39:32 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 98ed3d1dc..40f25d429 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -601,7 +601,7 @@

申请班级:<%= Course.find(ma.course_id).name%>

班级描述:
-
<%= Course.find(ma.course_id).description.html_safe %>
+
<%= Course.find(ma.course_id).description.nil? ? "" : Course.find(ma.course_id).description.html_safe %>

申请职位:<%= ma.content == '9' ? "教师" : "教辅"%>

  • <%= time_tag(ma.created_at).html_safe %>
  • From 2951259d23d10547b5f442cc00683e8b7887086b Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 10:40:00 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_projects4show.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/user_projects4show.js.erb b/app/views/users/user_projects4show.js.erb index c19a79c81..f8b1a57df 100644 --- a/app/views/users/user_projects4show.js.erb +++ b/app/views/users/user_projects4show.js.erb @@ -1 +1 @@ -$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page} )%>"); +$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page, :all_count => @all_count} )%>"); From c891a41ef108839103a3ce7833f3b87e0c49d864 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 15:23:21 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E6=89=93=E5=8D=B0log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 2 ++ app/services/courses_service.rb | 2 ++ app/services/syllabuses_service.rb | 3 +++ 3 files changed, 7 insertions(+) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index dcbd1f38b..e6d913ffd 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -62,6 +62,7 @@ class AdminController < ApplicationController course = Course.where("id = #{params[:course_id].to_i}").first unless course.nil? course.update_column('syllabus_id', params[:syllabus_id].to_i) + logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus" @flag = true end end @@ -83,6 +84,7 @@ class AdminController < ApplicationController syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content if syllabus.save course.update_column('syllabus_id', syllabus.id) + logger.error "update_syllabus_id: admin_controller/create_syllabus" @flag = params[:flag].to_i @course = course respond_to do |format| diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index ce3157d5f..d01b89833 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -218,6 +218,7 @@ class CoursesService #@course.password = params[:course][:password] @course.tea_id = current_user.id @course.syllabus_id = params[:syllabus_id].to_i + logger.error "update_syllabus_id: courses_service/create_course" @course.term = params[:term] @course.time = params[:time] @course.end_term = params[:end_term] @@ -277,6 +278,7 @@ class CoursesService #course.safe_attributes = params[:course] #course.password = params[:course][:password] course.syllabus_id = params[:syllabus_id].to_i + logger.error "update_syllabus_id: courses_service/edit_course" course.time = params[:time] course.term = params[:term] course.end_time = params[:end_time] diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index fcb70653b..8911032dd 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -86,12 +86,14 @@ class SyllabusesService courses.each do |course| if ::Course === course course.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/create" course.save! send_wechat_create_class_notice user,course elsif Hash === course c = ::Course.new(course) c.tea_id = user.id c.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/create" c.update_default_value c.is_public = 0 c.save! @@ -136,6 +138,7 @@ class SyllabusesService course.name = c course.tea_id = user.id course.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/edit" course.update_default_value course.is_public = 0 course.save! From 65f6b0fc70fa6e2ae6dd6a33e3a91e12ec0bc599 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 15:50:23 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 4 ++-- app/services/courses_service.rb | 4 ++-- app/services/syllabuses_service.rb | 6 +++--- app/views/layouts/_course_base_info.html.erb | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 98b63f8fe..0463e08e8 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -62,7 +62,7 @@ class AdminController < ApplicationController course = Course.where("id = #{params[:course_id].to_i}").first unless course.nil? course.update_column('syllabus_id', params[:syllabus_id].to_i) - logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus" + Rails.logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus" @flag = true end end @@ -84,7 +84,7 @@ class AdminController < ApplicationController syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content if syllabus.save course.update_column('syllabus_id', syllabus.id) - logger.error "update_syllabus_id: admin_controller/create_syllabus" + Rails.logger.error "update_syllabus_id: admin_controller/create_syllabus" @flag = params[:flag].to_i @course = course respond_to do |format| diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 58b6897ad..e9253ff90 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -353,7 +353,7 @@ class CoursesService #@course.password = params[:course][:password] @course.tea_id = current_user.id @course.syllabus_id = params[:syllabus_id].to_i - logger.error "update_syllabus_id: courses_service/create_course" + Rails.logger.error "update_syllabus_id: courses_service/create_course" @course.term = params[:term] @course.time = params[:time] @course.end_term = params[:end_term] @@ -413,7 +413,7 @@ class CoursesService #course.safe_attributes = params[:course] #course.password = params[:course][:password] course.syllabus_id = params[:syllabus_id].to_i - logger.error "update_syllabus_id: courses_service/edit_course" + Rails.logger.error "update_syllabus_id: courses_service/edit_course" course.time = params[:time] course.term = params[:term] course.end_time = params[:end_time] diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index 8911032dd..4681917fc 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -86,14 +86,14 @@ class SyllabusesService courses.each do |course| if ::Course === course course.syllabus_id = sy.id - logger.error "update_syllabus_id: syllabus_service/create" + Rails.logger.error "update_syllabus_id: syllabus_service/create" course.save! send_wechat_create_class_notice user,course elsif Hash === course c = ::Course.new(course) c.tea_id = user.id c.syllabus_id = sy.id - logger.error "update_syllabus_id: syllabus_service/create" + Rails.logger.error "update_syllabus_id: syllabus_service/create" c.update_default_value c.is_public = 0 c.save! @@ -138,7 +138,7 @@ class SyllabusesService course.name = c course.tea_id = user.id course.syllabus_id = sy.id - logger.error "update_syllabus_id: syllabus_service/edit" + Rails.logger.error "update_syllabus_id: syllabus_service/edit" course.update_default_value course.is_public = 0 course.save! diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 09832b66c..f661571f6 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -3,8 +3,6 @@ <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count %>

    - <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %> -  >  <% if @course.syllabus %> <%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>  >  From 8de803544139a6929740f19db1eabab66a032523 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 16:17:58 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E5=8A=A0=E4=B8=8A=E4=B8=BB=E8=AE=B2=E8=80=81?= =?UTF-8?q?=E5=B8=88=E7=9A=84=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_course_base_info.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index f661571f6..09832b66c 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -3,6 +3,8 @@ <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count %>

    + <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %> +  >  <% if @course.syllabus %> <%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %>  >  From fc3df1c26ffa0c17b1f170b4a9956f8533941ed7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 16:38:17 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=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 --- public/javascripts/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c2152184a..60e5855c2 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1498,7 +1498,7 @@ function pop_box_new(value, Width, Top, Left){ showModal('ajax-modal', Width + 'px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').parent().css({"top": Top+"%","left": Left+"%","transform":"translate(-50%,-50%)","padding":"0","border":"none"}); - $('#ajax-modal').css({"padding":"0"}); + $('#ajax-modal').css({"padding":"0","overflow":"hidden"}); } From a3011c319b8cd32676c32938bf041824bb81fc68 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 16:40:56 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=88=91=E7=9A=84=E6=89=80=E6=9C=89=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 932617671..54d43c891 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -599,7 +599,7 @@ class UsersController < ApplicationController if(params[:type].blank? || params[:type] == "1") #我的题库 courses = @user.courses.where("is_delete = 1") course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}") + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids}").order("#{@order} #{@b_sort}") elsif params[:type] == "2" #公共题库 visible_course = Course.where("is_delete = 0") visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" From 0ed508a887a8df29eb402a564438ac4f6124951b Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 17:09:36 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show_homework_detail.js.erb | 2 +- public/javascripts/application.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/show_homework_detail.js.erb b/app/views/users/show_homework_detail.js.erb index cbb0cf057..b3dff264a 100644 --- a/app/views/users/show_homework_detail.js.erb +++ b/app/views/users/show_homework_detail.js.erb @@ -3,5 +3,5 @@ $("#choose_courses_notice").html(""); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'users/homework_repository_detail') %>"; - pop_box_new(htmlvalue,820,155); + pop_box_new(htmlvalue,820,800); <% end %> \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 460e52e36..632e4ab49 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1495,7 +1495,7 @@ function pop_up_box(value,tWidth,tTop,tLeft){ // 公共弹框样式 function pop_box_new(value, Width, Height){ w = ($(window).width() - Width)/2; - h = ($(window).height() - Height)/2 - 100; + h = ($(window).height() - Height)/2; $("#ajax-modal").html(value); showModal('ajax-modal', Width + 'px'); $('#ajax-modal').siblings().remove(); From fa07f2532fcbb147d589b9f330bf43919246cfc8 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 10 Aug 2016 11:16:04 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E9=A2=98=E5=BA=93=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/sy_public.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css index e1d3eaf38..deeb36c15 100644 --- a/public/stylesheets/sy_public.css +++ b/public/stylesheets/sy_public.css @@ -234,7 +234,7 @@ a.sy_icons_close{ .hw_popup_top a.hw_icons_close{display:block;width:26px; height:26px;background: url(../images/hw/icons_hw.png) 0 -95px no-repeat; transition: all 0s linear;} .hw_popup_top a:hover.hw_icons_close{background: url(../images/hw/icons_hw.png) -41px -95px no-repeat; } .hw_popup_con{ width:770px; max-height:770px; margin:0 auto;} -.hw_popup_txt{width:770px; max-height:700px; margin:15px auto;overflow:auto;} +.hw_popup_txt{width:770px; max-height:680px; margin:15px auto;overflow:auto;} /* 题库发送弹框 */ .hw_sendpopup_box{ width:460px;background:#fff;padding-bottom:15px;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);} .hw_sendpopup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;} From ba7f9ed735788e8897a3dba42988ddc06416c28c Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 10 Aug 2016 17:19:32 +0800 Subject: [PATCH 14/20] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BE=A7=E5=AF=BC=E8=88=AA=E6=96=87=E5=AD=97=E7=BC=A9?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 50e788e2f..6af6bde3c 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -175,17 +175,17 @@ <% if is_current_user %>

  • - <%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank"%> + <%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
  • - <%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank"%> + <%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :target => "_blank", :style => "font-size:14px;" %>
  • - <%= link_to "加入班级",join_private_courses_courses_path,:remote => true, :method => "post"%> + <%= link_to "加入班级",join_private_courses_courses_path,:remote => true, :method => "post", :style => "font-size:14px;" %>
  • <% if @user == User.current %>
  • - <%=link_to '我的作业', my_homeworks_user_path(@user.id), :target => "_blank" %> + <%=link_to '我的作业', my_homeworks_user_path(@user.id), :target => "_blank", :style => "font-size:14px;" %>
  • <% end %> <% end %> @@ -212,10 +212,10 @@ <% if is_current_user %>
  • - <%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank"%> + <%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :style => "font-size:14px;" %>
  • - <%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post"%> + <%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :style => "font-size:14px;" %>
  • From 59a76c3b9a13fd3546c7c3476890c6b3b2364095 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 11 Aug 2016 10:47:22 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E5=BC=B9=E7=AA=97=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/subfield_upload_file.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/subfield_upload_file.js.erb b/app/views/files/subfield_upload_file.js.erb index 340a2890f..96c1659fd 100644 --- a/app/views/files/subfield_upload_file.js.erb +++ b/app/views/files/subfield_upload_file.js.erb @@ -2,5 +2,5 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_su showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().css("top","30%").css("left","40%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file From f4445619d2c41b2087cff8d4fb90f983b0a18bf6 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 11 Aug 2016 11:02:40 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=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/users/_homework_repository_detail.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_homework_repository_detail.html.erb b/app/views/users/_homework_repository_detail.html.erb index f752fbfb3..55779fcea 100644 --- a/app/views/users/_homework_repository_detail.html.erb +++ b/app/views/users/_homework_repository_detail.html.erb @@ -1,4 +1,4 @@ -
    +
    From 322868f063c7c69d2540915fc7afe2fcbac0bed6 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 15:58:49 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E7=A8=8Bid=E5=8F=98=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 ++---- app/models/course.rb | 7 +++++++ app/services/courses_service.rb | 2 -- app/services/syllabuses_service.rb | 3 --- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 0463e08e8..3c012fce7 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -61,8 +61,7 @@ class AdminController < ApplicationController if params[:syllabus_id] && params[:course_id] course = Course.where("id = #{params[:course_id].to_i}").first unless course.nil? - course.update_column('syllabus_id', params[:syllabus_id].to_i) - Rails.logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus" + course.update_attribute(:syllabus_id, params[:syllabus_id].to_i) @flag = true end end @@ -83,8 +82,7 @@ class AdminController < ApplicationController syllabus.update_attributes(:title => params[:title], :eng_name => params[:eng_name], :user_id => @user.id) syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content if syllabus.save - course.update_column('syllabus_id', syllabus.id) - Rails.logger.error "update_syllabus_id: admin_controller/create_syllabus" + course.update_attribute(:syllabus_id, params[:syllabus_id].to_i) @flag = params[:flag].to_i @course = course respond_to do |format| diff --git a/app/models/course.rb b/app/models/course.rb index 561a031ae..93cc6ab26 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -80,6 +80,7 @@ class Course < ActiveRecord::Base after_update :update_files_public,:update_course_ealasticsearch_index after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index + after_save :log_infor safe_attributes 'extra', 'time', @@ -504,6 +505,12 @@ class Course < ActiveRecord::Base ticket end + def log_infor + if self.syllabus_id.nil? + Rails.logger.info "##########################################################course's syllabus_id is null." + end + end + end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index e9253ff90..c6854f3dd 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -353,7 +353,6 @@ class CoursesService #@course.password = params[:course][:password] @course.tea_id = current_user.id @course.syllabus_id = params[:syllabus_id].to_i - Rails.logger.error "update_syllabus_id: courses_service/create_course" @course.term = params[:term] @course.time = params[:time] @course.end_term = params[:end_term] @@ -413,7 +412,6 @@ class CoursesService #course.safe_attributes = params[:course] #course.password = params[:course][:password] course.syllabus_id = params[:syllabus_id].to_i - Rails.logger.error "update_syllabus_id: courses_service/edit_course" course.time = params[:time] course.term = params[:term] course.end_time = params[:end_time] diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index 4681917fc..fcb70653b 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -86,14 +86,12 @@ class SyllabusesService courses.each do |course| if ::Course === course course.syllabus_id = sy.id - Rails.logger.error "update_syllabus_id: syllabus_service/create" course.save! send_wechat_create_class_notice user,course elsif Hash === course c = ::Course.new(course) c.tea_id = user.id c.syllabus_id = sy.id - Rails.logger.error "update_syllabus_id: syllabus_service/create" c.update_default_value c.is_public = 0 c.save! @@ -138,7 +136,6 @@ class SyllabusesService course.name = c course.tea_id = user.id course.syllabus_id = sy.id - Rails.logger.error "update_syllabus_id: syllabus_service/edit" course.update_default_value course.is_public = 0 course.save! From 951390092b63fad5298cc0ecae29f0d9702dfe81 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 15:59:38 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E6=88=91=E7=9A=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c9cea575e..35bd93678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1534,7 +1534,7 @@ class UsersController < ApplicationController stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)} stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")" @receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5) - if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time) + if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.created_at > @receive_homeworks.first.created_at) @manage_pre = true else @manage_pre = false From 4a25b6357bcc029ef5373a855bd8ad418e076826 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 16:12:48 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E6=88=91=E7=9A=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b225c3099..86babf1fb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2841,7 +2841,7 @@ module ApplicationHelper #获取当前作业的提交截止时间/互评截止时间 def cur_homework_end_time homework str = "" - if homework.anonymous_comment == 0 && homework.end_time < Date.today && homework.homework_detail_manual + if homework.anonymous_comment == 0 && homework.end_time && homework.end_time < Date.today && homework.homework_detail_manual str = "互评截止:#{format_date homework.homework_detail_manual.evaluation_end}" else str = "提交截止:#{homework.end_time ? (format_date homework.end_time) : '       --       '}" From 85cd113cf9a413a6717758b54233a4b13ae1d582 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 12 Aug 2016 10:20:58 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 93cc6ab26..659f9fcec 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -506,9 +506,7 @@ class Course < ActiveRecord::Base end def log_infor - if self.syllabus_id.nil? - Rails.logger.info "##########################################################course's syllabus_id is null." - end + Rails.logger.info "##########################################################course's syllabus_id is #{self.syllabus_id}." end end