From 5f1b4b1b24a53f0f78a07bd554ae96cbed2318e0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 14:16:12 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=90=8E=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E3=80=81=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E7=A1=AE=E5=AE=9A=E6=8C=89=E9=92=AE=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/homework.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index d897ba5e9..ad3ad02fe 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -115,7 +115,7 @@ $(function(){ minWidth: 753 }); - $('a.ProBtn').on('click', function(){ + $('a.ProBtn').live('click', function(){ $("#BluePopupBox").dialog("open"); $(".ui-dialog-titlebar").hide(); $("a.CloseBtn").on('click', function(){ @@ -173,7 +173,7 @@ $(function(){ return valid; } - $("#BluePopupBox a.BlueCirBtn").on('click', function(){ + $("#BluePopupBox a.BlueCirBtn").live('click', function(){ if(saveProgramAnswers()){ if($( "#BluePopupBox" ).dialog( "isOpen" )){ $("#BluePopupBox").dialog( "close" ); From 709e09977068e92bab2b67adb5dfe27e0e16861d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 14:33:33 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=85=B3=E8=81=94=E8=A1=A8=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 6 +++--- app/helpers/api_helper.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/users/_user_homework_list.html.erb | 9 ++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 90a0f3ed6..2d7bf02b1 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -75,7 +75,7 @@ class StudentWorkController < ApplicationController @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] @homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - @is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 + @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 @show_all = false course_group = CourseGroup.find_by_id(@group) if @group @@ -86,7 +86,7 @@ class StudentWorkController < ApplicationController else student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' end - if @is_teacher #老师 || 超级管理员 显示所有列表 + if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表 @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name @show_all = true elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 @@ -106,7 +106,7 @@ class StudentWorkController < ApplicationController @stundet_works = [] end else - if @is_teacher #老师 || 超级管理员 显示所有列表 + if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表 @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name @show_all = true elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index f26f5c19b..f73cc87e6 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -75,7 +75,7 @@ module ApiHelper # 学生获取课程作业的状态 def get_homework_status homework homework_status = "" - if !homework.nil? + if homework if homework.homework_type == 1 && homework.homework_detail_manual case homework.homework_detail_manual.comment_status when 1 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cfb655baa..f0ebf8a82 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2299,7 +2299,7 @@ module ApplicationHelper def homework_anonymous_comment homework if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评" - elsif homework.student_works.count >= 2 #作业份数大于2 + elsif homework.student_works.count >= 2 && homework.homework_detail_manual#作业份数大于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 => 'postOptionLink' diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 89800b768..f7017deab 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -14,12 +14,15 @@ - <% if homework_common.homework_detail_manual.comment_status == 1%> + + <% if homework_common.homework_detail_manual%> + <% if homework_common.homework_detail_manual.comment_status == 1%> 未开启匿评 - <% elsif homework_common.homework_detail_manual.comment_status == 2%> + <% elsif homework_common.homework_detail_manual.comment_status == 2%> 匿评中 - <% elsif homework_common.homework_detail_manual.comment_status == 3%> + <% elsif homework_common.homework_detail_manual.comment_status == 3%> 匿评已结束 + <% end%> <% end%>
From 29fd5b41e212487ab6be934a62f7272ec15e5944 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 14:55:58 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/search.html.erb | 156 ++++++++++++++------------------ 1 file changed, 66 insertions(+), 90 deletions(-) diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb index a8401c406..f5287cbd4 100644 --- a/app/views/users/search.html.erb +++ b/app/views/users/search.html.erb @@ -1,94 +1,70 @@ - + function searchByChange() + { + $("#search_by_input").val($("#search_by").val()); + } + -
- <%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %> - - - - - - - - - - -
- <%= l(:label_software_user ) %> - - <%= l(:label_user_location) %> : - - - - - - - - - - -
- <%=link_to l(:field_homepage), home_path %> > - <%= l(:label_software_user)%> -
-
-<% end %> - - -
- <% if @users.size > 0 %> - <%= render :partial => 'user_show' %> - - - <% else %> - <%= render :partial => "layouts/no_content"%> - <% end %> -
- -<% html_title(l(:label_user_plural)) -%> + <% end %> + + +
+ <% if @users.size > 0 %> + <%= render :partial => 'user_show' %> + <% else %> + <%= render :partial => "layouts/no_content"%> + <% end %> +
+ +
+
+ <% html_title(l(:label_user_plural)) -%> +
+
+ + + + From 4a838611fde69b41f4c06744d5af5b43f3887096 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 15:01:24 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=AF=BE=E7=A8=8B=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E6=8C=89=E6=97=B6=E9=97=B4=E5=80=92=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index b1020d938..4923c629e 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -582,7 +582,7 @@ module UsersHelper option << "请选择发布作业的课程" option << -1 type << option - user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course| + user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course| option = [] option << course.name+"("+course.time.to_s+course.term+")" option << course.id From 33924680b2dbbbbb4e90be6d575a7d1172b1a3fb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 15:02:56 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E6=8F=90=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 f0ebf8a82..41e016562 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2309,7 +2309,7 @@ module ApplicationHelper # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" end else - link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于2时才可以启动匿评" + link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于等于2时才可以启动匿评" end link end From b525f12a321df3c99a4c607a221827b20a9c9a79 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:12:01 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_file_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 030c8ff0e..560afc6d9 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -47,7 +47,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %> - 上传附件 + 上传附件 <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', From 1ee00fcae433bbcf487c4dd8b5953129e9921dc2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:17:14 +0800 Subject: [PATCH 07/28] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_forum_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index fbbe023a0..286219356 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -10,7 +10,7 @@ <%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %> -
<%= textAreailizable forum.description%>
+
<%= textAreailizable forum.description%>
创建者:<%= forum.creator.name %>
创建时间:<%= format_date(forum.created_at) %>
From 66ea9e3052f3a313b2ed7a44bfeda23c2644d4fd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:23:12 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B4=B4=E5=90=A7=20?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B9=9F=E4=BC=9A=E8=A2=AB=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_forum_tag_list.html.erb | 2 +- app/views/layouts/base_forums.html.erb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/forums/_forum_tag_list.html.erb b/app/views/forums/_forum_tag_list.html.erb index 2a0257d63..b074cbca3 100644 --- a/app/views/forums/_forum_tag_list.html.erb +++ b/app/views/forums/_forum_tag_list.html.erb @@ -1,6 +1,6 @@ <% forum.tag_list.each do |tag|%> - <%= tag %> + <%= tag %> <%if forum.creator.id == User.current.id%> × <% end %> diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 7ddfc85ea..6a980cc87 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -122,6 +122,12 @@ } } }); + + function del_confirm(){ + if(confirm('您确定要删除么?')){ + $("#del_link").click(); + } + } @@ -172,7 +178,8 @@ 编辑贴吧 - 删除贴吧 + 删除贴吧 + <% end %> From 0b932267c72fbb6e85761635d87f9081938db9ab Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 25 Sep 2015 15:26:40 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=88=AA=E6=AD=A2?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=BF=AB=E5=88=B0=E4=BA=86=E7=9A=84=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 57541e149..8817dd325 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -555,7 +555,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} .homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageSystenMessageContent {width:291px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; } .homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} a.homepageWhite {color:#ffffff;} From 93542448e2d8c17ebe79b34e773e4e2cf224a219 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:26:48 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E5=A4=9F=E4=BA=86=E5=88=A0=E9=99=A4=E9=94=AE=20=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=A2=AB=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index ef1fbc12b..c212e7b9d 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -14,7 +14,7 @@ n += 1; } } - if(n >= 160) + if(n >= 160 && event.keyCode != 8) event.returnValue = false; } }) From a61e60d1b9d876dc9de5c067361f7bfa5de60a23 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:46:40 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=BC=9A=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 4cafce30d..c15bd9bb8 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -56,7 +56,7 @@ <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
-
+
<%= @memo.content.html_safe%>
From 926bdd81e8916056d01491a20dbe86b2902445ea Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:52:28 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=90=8D=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_forums.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 6a980cc87..366291691 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -149,7 +149,7 @@
-
" style="word-break: break-all; word-wrap:break-word;"><%= @forum.name%>
+
<%= @forum.name%>
吧主:<%= @forum.creator.name%>
回答:<%= @forum.memo_count %> 帖子:<%=@forum.topic_count%>
From c8cbab2d505e7cdd0bd22bc29321c0c7fa48bb2d Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 15:55:29 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E7=81=AB=E7=8B=90=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=20=E5=92=8C=20ie=E6=B5=8F=E8=A7=88=E5=99=A8=E7=9A=84e?= =?UTF-8?q?vent=E8=8E=B7=E5=BE=97=20=E5=92=8C=20=E9=98=BB=E6=AD=A2=20?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=B8=8D=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/edit.html.erb | 43 ++++++++++++++++++++------------- app/views/forums/index.html.erb | 15 +++++++++--- public/javascripts/new_user.js | 15 +++++++++--- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index c212e7b9d..1fcbc6cab 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -1,23 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %> \ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 8f5cb15cc..bb531b85c 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -49,7 +49,7 @@ $("#reorder_popu").removeClass("sortArrowActiveD"); add_class("reorder_time"); }); - document.getElementById('forum_name').onkeydown = function() + $('#forum_name').keypress( function(e) { var n = 0; var str = this.value; @@ -61,9 +61,16 @@ n += 1;//英文,不多说了 } } - if(n >= 160 && event.keyCode != 8) - event.returnValue = false; - } + if(n >= 160 && e.keyCode != 8) + if(document.all) + { + e.returnValue = false; + } + else + { + e.preventDefault(); + } + }) }); function check_and_submit(doc){ $("#error").html('').hide(); diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index d2b67be5e..22c049ecc 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -337,7 +337,7 @@ var autoTextarea = function (elem, extra, maxHeight) { }; function limitStrsize(id,length){ - document.getElementById(id).onkeydown = function() + $('#'+id).keypress(function(e) { var n = 0; var str = this.value; @@ -350,9 +350,16 @@ function limitStrsize(id,length){ } } - if(n >= length && event.keyCode !== 8) - event.returnValue = false; - } + if(n >= length && e.keyCode !== 8) + if(document.all) + { + e.returnValue = false; + } + else + { + e.preventDefault(); + } + }) } /////////////////////////////////////////////////////////////////////////////////////创建项目 From 272bd2730a032b0160cb7b348e2ede5594256e63 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 25 Sep 2015 16:05:19 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E9=97=AE=E9=A2=98=E4=B8=BA=E7=95=99?= =?UTF-8?q?=E8=A8=80=E6=97=B6=EF=BC=8C=E5=8E=BB=E6=8E=89=E2=80=9C=E7=95=99?= =?UTF-8?q?=E8=A8=80=E5=86=85=E5=AE=B9=E2=80=9D=E5=87=A0=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=EF=BC=9B=20=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E4=B8=BB?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 2 +- app/views/users/user_messages.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 4923c629e..f6b083b4d 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -464,7 +464,7 @@ module UsersHelper no_html = "message" arr = details_to_strings(journal.details, no_html) unless journal.notes.blank? - arr << "留言内容:" + journal.notes + arr << journal.notes end str = '' arr.each { |item| str = str+item } diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 550089627..af533fe97 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -542,7 +542,7 @@ 更新了问题状态:
  • - <%= link_to get_issue_des_update(ma.forge_message).html_safe, + <%= link_to ma.forge_message.journalized.subject, issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> From 959d3f1a93bfce658be746e9e422abffb28b4c11 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 16:11:12 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E4=B8=87=E4=B8=80=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E8=BF=87=E5=A4=A7=EF=BC=8C=E9=98=BB=E6=AD=A2=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/edit.html.erb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index 0efa57ccc..4a515ee1f 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -1,11 +1,16 @@ <%= javascript_include_tag 'new_user'%> \ No newline at end of file From fd4a2b19c8cd8dfdeae2383cbc894446ff098522 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Sep 2015 16:11:59 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=80=81=E5=B8=88=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 800f2ff9d..fe0b5ef84 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -1,5 +1,5 @@ <%# course_model %> -<% teacher_num = teacherCount(@course) %> +<% teacher_num = searchTeacherAndAssistant(@course).count %> <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count%> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> From e0c338b497649e67b47c4a7024dd2032838a911f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 25 Sep 2015 16:20:51 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_form_edit_mode.html.erb | 4 ++-- app/views/forums/edit.html.erb | 2 +- app/views/forums/index.html.erb | 8 +++++--- app/views/forums/show.html.erb | 4 ++-- public/javascripts/new_user.js | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/forums/_form_edit_mode.html.erb b/app/views/forums/_form_edit_mode.html.erb index 9c0ec27bd..ade5a24c4 100644 --- a/app/views/forums/_form_edit_mode.html.erb +++ b/app/views/forums/_form_edit_mode.html.erb @@ -9,10 +9,10 @@
    - +
    - +
    diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index 1fcbc6cab..07570b687 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -54,7 +54,7 @@ $('#forum_name').keypress(function(e) { var n = 0; - var str = this.value; + var str = this.val().trim(); for (i = 0; i < str.length; i++) { var leg = str.charCodeAt(i);//ASCII码 if (leg > 255) { diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index bb531b85c..055b83f50 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -51,8 +51,9 @@ }); $('#forum_name').keypress( function(e) { + alert(1) var n = 0; - var str = this.value; + var str = this.val().trim(); for (i = 0; i < str.length; i++) { var leg = str.charCodeAt(i);//ASCII码 if (leg > 255) {//大于255的都是中文 @@ -61,6 +62,7 @@ n += 1;//英文,不多说了 } } + console.log(n) if(n >= 160 && e.keyCode != 8) if(document.all) { @@ -136,14 +138,14 @@ <%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
    - +
    - +
    - +
    - +