From 09b6f1d78792123c56364ba29f2d7fd58ad045d5 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 26 Jun 2015 17:16:03 +0800 Subject: [PATCH 01/68] =?UTF-8?q?=E4=BF=AE=E6=94=B9news=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/news.rb | 6 ++++-- app/services/courses_service.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/api/mobile/entities/news.rb b/app/api/mobile/entities/news.rb index f189771e3..7399ebb4c 100644 --- a/app/api/mobile/entities/news.rb +++ b/app/api/mobile/entities/news.rb @@ -26,13 +26,15 @@ module Mobile news_expose :title expose :author,using: Mobile::Entities::User do |f, opt| - n = f[:news] - n.author if n.respond_to?(:author) + n = f[:author] + #n.author if n.respond_to?(:author) end #作者id news_expose :author_id #作者名 news_expose :author_name + #作者头像url + news_expose :author_img_url #新闻内容 news_expose :description #发布时间 diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 29c4fb1b0..f5ff2670f 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -123,7 +123,7 @@ class CoursesService scope = @course ? @course.news.course_visible(current_user) : News.course_visible(current_user) news = [] scope.each do |n| - news << {:id => n.id,:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count} + news << {:id => n.id,:title => n.title,:author_name => n.author.name,:author_id => n.author.id, :author=>n.author, :description => n.description,:created_on => format_time(n.created_on),:comments_count => n.comments_count} end news end From 7fa45a47bbe8da71923b15df36c0b9ea1758007b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 29 Jun 2015 10:59:39 +0800 Subject: [PATCH 02/68] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=88=AA=E8=87=B3?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E5=90=AF=E5=8A=A8=E5=8C=BF=E8=AF=84=E7=BB=99?= =?UTF-8?q?=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 1 + app/views/homework_common/start_anonymous_comment.js.erb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 5cd55e23b..659d0fa8e 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -135,6 +135,7 @@ class HomeworkCommonController < ApplicationController #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 def start_anonymous_comment @statue =4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course) + @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") > Time.now.strftime("%Y-%m-%d") if @homework_detail_manual.comment_status == 1 student_works = @homework.student_works if student_works && student_works.size >=2 diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb index cd4dafde8..5f27a5b82 100644 --- a/app/views/homework_common/start_anonymous_comment.js.erb +++ b/app/views/homework_common/start_anonymous_comment.js.erb @@ -5,6 +5,8 @@ $("#<%= @homework.id %>_start_anonymous_comment").replaceWith('<%= escape_javasc alert('启动失败\n作业总数大于等于2份时才能启动匿评'); <% elsif @statue == 3%> alert("已开启匿评,请务重复开启"); -<% elsif @statue == 3%> +<% elsif @statue == 4%> alert("您没有权限开启匿评"); +<% elsif @statue == 5%> +alert("作业提交截止之后才能启动匿评"); <% end %> \ No newline at end of file From 3e6ccf3e501a5edee690ea35fc0c2fed05d786d7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 30 Jun 2015 09:47:54 +0800 Subject: [PATCH 03/68] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=88=AA=E8=87=B3?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=B8=8D=E8=83=BD=E5=90=AF=E5=8A=A8=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 2 +- app/helpers/application_helper.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 659d0fa8e..18ee03d2e 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -135,7 +135,7 @@ class HomeworkCommonController < ApplicationController #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 def start_anonymous_comment @statue =4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course) - @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") > Time.now.strftime("%Y-%m-%d") + @statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") if @homework_detail_manual.comment_status == 1 student_works = @homework.student_works if student_works && student_works.size >=2 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5af4e2038..a31bd6189 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2278,7 +2278,9 @@ module ApplicationHelper #获取匿评相关连接代码 def homework_anonymous_comment homework if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业 - if homework.student_works.count >= 2 #作业份数大于2 + if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + link = "启动匿评".html_safe + elsif homework.student_works.count >= 2 #作业份数大于2 case homework.homework_detail_manual.comment_status when 1 link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit' From 59f6ef81cda792d51cd3633c4507c538751495e0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 30 Jun 2015 10:15:04 +0800 Subject: [PATCH 04/68] =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=A1=86=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/course.js | 4 ++-- public/stylesheets/courses.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/course.js b/public/javascripts/course.js index f73ab7bf6..172e630f0 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -802,8 +802,8 @@ $(function(){ $(".zip_download_alert").bind("mouseover",function(e){ //alert($(this).html()); $(this).next("div").show(); - $(this).next("div").css("top",e.pageY); - $(this).next("div").css("left",e.pageX); + //$(this).next("div").css("top",e.pageY); + //$(this).next("div").css("left",e.pageX); }); $(".zip_download_alert").bind("mouseout",function(e){ //alert($(this).html()); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0bd28bea7..056a33752 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -654,7 +654,7 @@ a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} .li_min_search{ float:right; margin-right:-10px;} -.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 110px;margin-top: 10px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} From af97f3bea88e6b692b718fa38cd4260bf79c77e1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 30 Jun 2015 10:18:46 +0800 Subject: [PATCH 05/68] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E9=80=9A=E7=9F=A5=E5=B1=95=E5=BC=80=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=B1=85=E5=8F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 5 +++-- app/views/news/_course_news.html.erb | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 3208bb969..a1aa49c8c 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -41,12 +41,13 @@ <%= homework.description.html_safe %> +
- -