From 61b759b7395233bd9394aaeb4901cfa47b5fd869 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 10:15:36 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 2 +- app/views/users/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 84e2e7d35..a89ae846e 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -200,7 +200,7 @@ class MyController < ApplicationController flash.now[:error] = l(:notice_account_wrong_password) end end - render :template => 'my/account',:layout=>'base_users_new' + #render :template => 'my/account',:layout=>'base_users_new' rescue Exception => e if e.message == 'wrong password' flash.now[:error] = l(:notice_account_wrong_password) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 3bf7d8118..003555158 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -36,7 +36,7 @@

取消 - 发布 + 留言
From a4095adc59575f0eb84c64eeb5238c61230dd293 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 18 Jul 2015 10:30:27 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=AD=E4=B8=8D=E6=98=BE=E7=A4=BA?= 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 47a3b59ae..14a508d40 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2345,6 +2345,6 @@ module ApplicationHelper #将文本内的/n转换为
def text_format text - text.gsub("\n","
").html_safe + text.gsub("<","<").gsub(">",">").gsub("\n","
").html_safe end end From 3ceb1e92bb85dbf583f7e2e83fd05698f9751307 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 18 Jul 2015 10:36:14 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=AD=E7=9A=84=E6=B5=8B=E8=AF=95=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homework_common/_homework_detail_programing_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb index 008f88138..806768954 100644 --- a/app/views/homework_common/_homework_detail_programing_form.html.erb +++ b/app/views/homework_common/_homework_detail_programing_form.html.erb @@ -98,7 +98,7 @@
  • - 测试 +
  • @@ -116,7 +116,7 @@
  • - 测试 +
  • From 94ed3501f8cc5d4f2d1d2085189c33e0ad16463c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 18 Jul 2015 10:39:04 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E8=BD=AC=E4=B9=89=E5=A2=9E=E5=8A=A0&?= =?UTF-8?q?=E7=9A=84=E8=BD=AC=E4=B9=89?= 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 14a508d40..7b3d7bbe2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2345,6 +2345,6 @@ module ApplicationHelper #将文本内的/n转换为
    def text_format text - text.gsub("<","<").gsub(">",">").gsub("\n","
    ").html_safe + text.gsub("&","&").gsub("<","<").gsub(">",">").gsub("\n","
    ").html_safe end end From 42d706a9618570f18f2a748afc701ee4d02c5086 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 18 Jul 2015 10:44:26 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=89=A3=E5=88=86=E8=A7=84=E5=88=99=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 28 +++++++++++++++++++++++++++ app/helpers/homework_common_helper.rb | 27 -------------------------- app/views/student_work/index.html.erb | 9 ++------- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7b3d7bbe2..64a478187 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2347,4 +2347,32 @@ module ApplicationHelper def text_format text text.gsub("&","&").gsub("<","<").gsub(">",">").gsub("\n","
    ").html_safe end + + #评分规则显示 + def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil + if absence_penalty + if late_penalty.to_i == 0 && absence_penalty.to_i == 0 + notice = "尚未设置评分规则" + if is_teacher + notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green") + end + elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0 + notice = "迟交扣#{late_penalty}分,缺评扣分未设置" + elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0 + notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}分" + elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0 + notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}分" + end + else + if late_penalty.to_i == 0 + notice = "尚未设置评分规则" + if is_teacher + notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green") + end + else + notice = "迟交扣#{late_penalty}分" + end + end + notice.html_safe + end end diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb index a2ff6dbab..81f817ee9 100644 --- a/app/helpers/homework_common_helper.rb +++ b/app/helpers/homework_common_helper.rb @@ -53,31 +53,4 @@ module HomeworkCommonHelper link end - #评分规则显示 - def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil - if absence_penalty - if late_penalty.to_i == 0 && absence_penalty.to_i == 0 - notice = "尚未设置评分规则" - if is_teacher - notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green") - end - elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0 - notice = "迟交扣#{late_penalty}分,缺评扣分未设置" - elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0 - notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}分" - elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0 - notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}分" - end - else - if late_penalty.to_i == 0 - notice = "尚未设置评分规则" - if is_teacher - notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green") - end - else - notice = "迟交扣#{late_penalty}分" - end - end - notice.html_safe - end end \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 1eaee54af..7e4a818a9 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -165,15 +165,10 @@
    扣分标准:
    - 迟交扣 - <%= @homework.late_penalty%> - 分 <% if @homework.homework_type == 1%> - ,缺评一个作品扣 - <%= @homework.homework_detail_manual.absence_penalty%> - 分 + <%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%> <% else%> - 。 + <%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%> <% end%>
    From 59c1810d6b7c654fe8670927574389a4f62d20eb Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 10:55:12 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 13 ++++++------- app/views/users/show.html.erb | 4 ++++ app/views/users/user_courses4show.html.erb | 2 +- app/views/users/user_projects4show.html.erb | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cb2821a4b..d6597f3da 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -142,7 +142,7 @@ class UsersController < ApplicationController @obj_count = query.count(); @obj_pages = Paginator.new @obj_count,limit,params['page'] - @list = query.order("#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @list = query.order("#{Project.table_name}.updated_on desc,#{Project.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); @params = params respond_to do |format| @@ -281,7 +281,7 @@ class UsersController < ApplicationController @obj_count = query.count(); @obj_pages = Paginator.new @obj_count,limit,params['page'] - @list = query.order("#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); @params = params render :layout=>'base_users_new' @@ -460,14 +460,13 @@ class UsersController < ApplicationController end if params[:lastid]!=nil && !params[:lastid].empty? - query = query.where("#{Course.table_name}.id < ?",params[:lastid]) + query = query.where("( (#{Course.table_name}.updated_at=? and #{Course.table_name}.id < ?) or #{Course.table_name}.updated_atnil end def user_projects4show - query = Project.joins("join members m on #{Project.table_name}.id=m.project_id") query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project) if User.current == @user #看自己 @@ -477,9 +476,9 @@ class UsersController < ApplicationController end if params[:lastid]!=nil && !params[:lastid].empty? - query = query.where("#{Project.table_name}.id < ?",params[:lastid]) + query = query.where("( (#{Project.table_name}.updated_on=? and #{Project.table_name}.id < ?) or #{Project.table_name}.updated_onnil end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 003555158..ab3bf9f73 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -273,6 +273,10 @@ if($("div[nhname='rec']",p.container).length > 0){ var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id'); url += "?lastid="+lastid; + var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time'); + if(lasttime != undefined){ + url += "&lasttime="+lasttime; + } } $.ajax( {url:url,dataType:'text',success:function(data){ var html = $("
    "+data+"
    "); diff --git a/app/views/users/user_courses4show.html.erb b/app/views/users/user_courses4show.html.erb index d83ba8a8b..7aab1b2a5 100644 --- a/app/views/users/user_courses4show.html.erb +++ b/app/views/users/user_courses4show.html.erb @@ -1,6 +1,6 @@ <% for item in @list %> -
    +
    diff --git a/app/views/users/user_projects4show.html.erb b/app/views/users/user_projects4show.html.erb index 7435a1d14..3c709bd5d 100644 --- a/app/views/users/user_projects4show.html.erb +++ b/app/views/users/user_projects4show.html.erb @@ -1,5 +1,5 @@ <% for item in @list %> -
    +
    From 32ef798b073ab5d6f190816a9afeae6ca7b0b473 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 11:04:03 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users_new.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index 8aca387c6..ef6d82245 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -183,9 +183,9 @@ $(".subNav").click(function(){ <% end %> <% if (@user.user_extensions.identity == 0 || @user.user_extensions.identity == 1) && !@user.user_extensions.school.nil? %> -
  • <%= @user.user_extensions.school.name %>
  • +
  • <%= @user.user_extensions.school.name %>
  • <% elsif @user.user_extensions.identity == 3 && !@user.user_extensions.occupation.nil? && !@user.user_extensions.occupation.empty? %> -
  • <%= @user.user_extensions.occupation %>
  • +
  • <%= @user.user_extensions.occupation %>
  • <% elsif @user.user_extensions.identity == 2 %>
  • <%= @user.show_name %>
  • <% end %> From 8ca744479219ffb30c2e91ffba907fa9937a7fc8 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 11:36:12 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 96e3cf995..f17f0306f 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -145,7 +145,7 @@
  • <%= f.select :language, :Chinese => :zh, :English => :en %>
  • - 确认 + 确认
  • @@ -169,7 +169,7 @@
  • 请输入6-12个字符
  • - 确认 + 确认
  • @@ -528,6 +528,12 @@ <% if( !@act.nil? && @act == 'password') %> $("#users_tb_2").click(); <% end %> + $('#my_account_form_link').click(function(){ + $('#my_account_form_btn').click(); + }); + $('#my_password_form_link').click(function(){ + $('#my_password_form_btn').click(); + }); });