From 16bedc3d8f9943638cda04296b09e912a989861b Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 15 Oct 2016 15:47:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E5=BC=B9=E7=AA=97=E4=BD=8D=E7=BD=AE=E5=8F=8A=E6=A0=B7?= =?UTF-8?q?=E5=BC=8Fjs=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/import_resources.js.erb | 1 + app/views/users/search_user_course.js.erb | 2 + app/views/users/search_user_org.js.erb | 50 ++++++++++---------- app/views/users/search_user_project.js.erb | 54 +++++++++++----------- 4 files changed, 57 insertions(+), 50 deletions(-) diff --git a/app/views/users/import_resources.js.erb b/app/views/users/import_resources.js.erb index ead387767..0b51af592 100644 --- a/app/views/users/import_resources.js.erb +++ b/app/views/users/import_resources.js.erb @@ -18,5 +18,6 @@ $('#ajax-modal').parent().addClass("popbox_polls"); //与更新版本弹窗js冲突新增样式代码 $('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"}); $('#ajax-modal').css("padding",""); +$('#ajax-modal').parent().removeClass(" popbox resourceUploadPopup shareDP"); diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb index f30970dc4..1a289e17a 100644 --- a/app/views/users/search_user_course.js.erb +++ b/app/views/users/search_user_course.js.erb @@ -23,6 +23,8 @@ $('#ajax-modal').parent().css("top","50%").css("left","50%"); $('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); + //与更新版本弹窗js冲突新增样式代码 + $('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"}); var val = $("#search_course_input").val(); $("#search_course_input").val("").focus().val(val); <% else %> diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb index f2caf8b41..1eed1a4e5 100644 --- a/app/views/users/search_user_org.js.erb +++ b/app/views/users/search_user_org.js.erb @@ -1,25 +1,27 @@ -<% if params[:is_observe].nil? %> -<% if params[:send_type].present? && params[:send_type] == 'news' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% elsif params[:send_type] == 'file' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids,:type => @type})%>'); -<% elsif params[:send_type] == 'message' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% end %> -showModal('ajax-modal', '452px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","50%").css("left","50%"); -$('#ajax-modal').parent().addClass("popbox").addClass("shareDP"); -$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); -var val = $("#search_org_input").val(); -$("#search_org_input").val("").focus().val(val); -<% else %> - <% if params[:send_type] == 'news' %> - $("#org_news_form").html("<%= escape_javascript(render :partial => 'users/org_news_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); - <% elsif params[:send_type] == 'file' %> - $("#org_file_form").html("<%= escape_javascript(render :partial => 'users/org_file_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); - <% elsif params[:send_type] == 'message' %> - $("#org_message_form").html("<%= escape_javascript(render :partial => 'users/org_message_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); - <% end %> +<% if params[:is_observe].nil? %> +<% if params[:send_type].present? && params[:send_type] == 'news' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% elsif params[:send_type] == 'file' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids,:type => @type})%>'); +<% elsif params[:send_type] == 'message' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% end %> +showModal('ajax-modal', '452px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","50%").css("left","50%"); +$('#ajax-modal').parent().addClass("popbox").addClass("shareDP"); +$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); +//与更新版本弹窗js冲突新增样式代码 +$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"}); +var val = $("#search_org_input").val(); +$("#search_org_input").val("").focus().val(val); +<% else %> + <% if params[:send_type] == 'news' %> + $("#org_news_form").html("<%= escape_javascript(render :partial => 'users/org_news_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); + <% elsif params[:send_type] == 'file' %> + $("#org_file_form").html("<%= escape_javascript(render :partial => 'users/org_file_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); + <% elsif params[:send_type] == 'message' %> + $("#org_message_form").html("<%= escape_javascript(render :partial => 'users/org_message_form', :locals => {:orgs => @orgs,:user=> @user,:send_id => @send_id, :send_ids => @send_ids}) %>"); + <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb index 37d078662..3357f8a7b 100644 --- a/app/views/users/search_user_project.js.erb +++ b/app/views/users/search_user_project.js.erb @@ -1,26 +1,28 @@ -<% if params[:is_observe].nil? %> -<% if params[:send_type].present? && params[:send_type] == 'news' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); -<% elsif params[:send_type] == 'file' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids,:type => @type}) %>'); -<% elsif params[:send_type] == 'message' %> -$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); -<% end %> -showModal('ajax-modal', '452px'); -$('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); -$('#ajax-modal').parent().css("top","50%").css("left","50%"); -$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox") -$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); -//$("#search_project_input").focus(); -var val = $("#search_project_input").val(); -$("#search_project_input").val("").focus().val(val); -<% else %> -<% if params[:send_type] == 'news' %> -$("#project_news_form").html("<%= escape_javascript(render :partial => 'users/project_news_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); -<% elsif params[:send_type] == 'file' %> -$("#project_file_form").html("<%= escape_javascript(render :partial => 'users/project_file_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); -<% elsif params[:send_type] == 'message' %> -$("#project_message_form").html("<%= escape_javascript(render :partial => 'users/project_message_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); -<% end %> -<% end %> +<% if params[:is_observe].nil? %> +<% if params[:send_type].present? && params[:send_type] == 'news' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% elsif params[:send_type] == 'file' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids,:type => @type}) %>'); +<% elsif params[:send_type] == 'message' %> +$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% end %> +showModal('ajax-modal', '452px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","50%").css("left","50%"); +$('#ajax-modal').parent().addClass("resourceUploadPopup").addClass("popbox") +$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); +//与更新版本弹窗js冲突新增样式代码 +$('#ajax-modal').parent().css({"border":"3px solid #269ac9", "padding":"4px"}); +//$("#search_project_input").focus(); +var val = $("#search_project_input").val(); +$("#search_project_input").val("").focus().val(val); +<% else %> +<% if params[:send_type] == 'news' %> +$("#project_news_form").html("<%= escape_javascript(render :partial => 'users/project_news_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); +<% elsif params[:send_type] == 'file' %> +$("#project_file_form").html("<%= escape_javascript(render :partial => 'users/project_file_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); +<% elsif params[:send_type] == 'message' %> +$("#project_message_form").html("<%= escape_javascript(render :partial => 'users/project_message_form', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>"); +<% end %> +<% end %> From 1d7529b8d299d31abfb56ad1a06b65f287729c19 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 15 Oct 2016 16:09:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/exercise_publish.rake | 4 ++++ lib/tasks/homework_evaluation.rake | 5 +++++ lib/tasks/homework_publishtime.rake | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/lib/tasks/exercise_publish.rake b/lib/tasks/exercise_publish.rake index 13ae8c484..de93b3861 100644 --- a/lib/tasks/exercise_publish.rake +++ b/lib/tasks/exercise_publish.rake @@ -3,6 +3,8 @@ namespace :exercise_publish do desc "publish exercise and end exercise" task :publish => :environment do + Rails.logger.info("log--------------------------------exercise_publish start") + puts "--------------------------------exercise_publish start" exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now) exercises.each do |exercise| exercise.update_column('exercise_status', 2) @@ -11,6 +13,8 @@ namespace :exercise_publish do exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2) end end + Rails.logger.info("log--------------------------------exercise_publish end") + puts "--------------------------------exercise_publish end" end task :end => :environment do diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index 448137441..dc0dec270 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -8,6 +8,8 @@ namespace :homework_evaluation do end #自动开启匿评的任务 task :start_evaluation => :environment do + Rails.logger.info("log--------------------------------start_evaluation start") + puts "--------------------------------start_evaluation start" homework_detail_manuals = HomeworkDetailManual.where("evaluation_start = '#{Date.today}'") homework_detail_manuals.each do |homework_detail_manual| homework_common = homework_detail_manual.homework_common @@ -67,6 +69,9 @@ namespace :homework_evaluation do end end end + + Rails.logger.info("log--------------------------------start_evaluation end") + puts "--------------------------------start_evaluation end" end #自动关闭匿评的任务 diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index df996ab9e..dac3c11af 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -42,6 +42,8 @@ namespace :homework_publishtime do end task :end => :environment do + puts "--------------------------------homework_publish_end start" + Rails.logger.info("log--------------------------------homework_publish_end start") homework_commons = HomeworkCommon.where("end_time = '#{Date.today}'") homework_commons.each do |homework| if homework.anonymous_comment == 1 @@ -51,5 +53,7 @@ namespace :homework_publishtime do end end end + Rails.logger.info("log--------------------------------homework_publish_end end") + puts "--------------------------------homework_publish_end end" end end \ No newline at end of file