From 902cfdcbe9e4b37d26ee1e0ce6f831124e2c162a Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Jan 2016 10:29:55 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E5=88=9B=E5=BB=BA=E5=8A=A8=E6=80=81=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 9 +-------- app/views/organizations/_org_course_create.html.erb | 6 +----- app/views/organizations/_project_create.html.erb | 6 +----- app/views/projects/_project_create.html.erb | 6 +----- app/views/users/_course_create.html.erb | 6 +----- app/views/users/_project_create.html.erb | 6 +----- 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 24e955d15..0194a2a9d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,7 +1,6 @@ require 'elasticsearch/model' class Course < ActiveRecord::Base include Redmine::SafeAttributes - include ApplicationHelper STATUS_ACTIVE = 1 STATUS_CLOSED = 5 @@ -71,7 +70,7 @@ class Course < ActiveRecord::Base validates_length_of :description, :maximum => 10000 before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 - after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity + 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 @@ -429,12 +428,6 @@ class Course < ActiveRecord::Base end end end -#动态的更新 -def update_activity - update_course_activity(self.class, self.id) - update_user_activity(self.class, self.id) - update_org_activity(self.class, self.id) -end # Delete the previous articles index in Elasticsearch # Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil diff --git a/app/views/organizations/_org_course_create.html.erb b/app/views/organizations/_org_course_create.html.erb index a5544ab07..dc1e0ee81 100644 --- a/app/views/organizations/_org_course_create.html.erb +++ b/app/views/organizations/_org_course_create.html.erb @@ -17,13 +17,9 @@
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
-
+
创建时间:<%= format_time(activity.created_at) %>
-
- 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> -
-
- diff --git a/app/views/organizations/_org_course_poll.html.erb b/app/views/organizations/_org_course_poll.html.erb index 49ec66496..7e09e2215 100644 --- a/app/views/organizations/_org_course_poll.html.erb +++ b/app/views/organizations/_org_course_poll.html.erb @@ -56,6 +56,3 @@ <% end %> - diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 2e43c7089..763a76d5e 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -139,6 +139,3 @@ - diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 1e13c4c95..96ed6adff 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -133,6 +133,3 @@ - diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index df43b1af2..baa687107 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -134,6 +134,3 @@ - diff --git a/app/views/projects/_attachment_acts.html.erb b/app/views/projects/_attachment_acts.html.erb index adc21fdcc..de0820bff 100644 --- a/app/views/projects/_attachment_acts.html.erb +++ b/app/views/projects/_attachment_acts.html.erb @@ -22,18 +22,14 @@ 发布时间:<%= format_time(activity.created_on) %>

<%= textAreailizable activity, :description %>

-
+
- - - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 7a797535a..2614462d7 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -120,7 +120,4 @@
- - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 5aeaea20e..651a284e4 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -347,5 +347,4 @@ $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#moreProject_<%=user_activity_id %>").show(); }); - $(description_show_hide(<%=user_activity_id %>)); diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 8b28d13e9..5abd08224 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -177,6 +177,4 @@ <% end %> - + diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 606b9aecd..100a1a1bf 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -120,7 +120,4 @@
- - + \ No newline at end of file diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index 3e29b255b..970fb516e 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -55,6 +55,3 @@ <% end %> - diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index d5806c078..668a26cec 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -1,4 +1,4 @@ -
+
<%= content.to_s.html_safe%>
@@ -8,5 +8,6 @@ var postContent = $("#intro_content_<%= user_activity_id%>").html(); postContent = postContent.replace(/ /g," "); $("#intro_content_<%= user_activity_id%>").html(postContent); + description_show_hide(<%=user_activity_id %>); }); \ No newline at end of file diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e342256d4..009e63404 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -151,6 +151,3 @@
- diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index db65562e6..d4a7a9e60 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -167,6 +167,3 @@ - diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 5b109a56d..581bfb53c 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -144,5 +144,4 @@ $("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap'); $("#moreProject_<%=user_activity_id %>").show(); }); - $(description_show_hide(<%=user_activity_id %>)); diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index ee0c5595b..b3e14d174 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -348,5 +348,4 @@ $("#relatePWrap_<%=homework_common.id %>").toggleClass('relatePWrap'); $("#moreProject_<%=homework_common.id %>").show(); }); - $(homework_description_show_hide(<%=homework_common.id %>)); \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 193b358dc..e94954a10 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -23,23 +23,6 @@ function description_show_hide(id){ }); } -function homework_description_show_hide(id){ - showNormalImage('homework_description_'+id); - if($("#intro_content_"+id).height() > 810) { - $("#intro_content_show_"+id).show(); - } - $("#intro_content_show_"+id).click(function(){ - $("#homework_description_"+id).toggleClass("maxh360"); - $("#intro_content_show_"+id).hide(); - $("#intro_content_hide_"+id).show(); - }); - $("#intro_content_hide_"+id).click(function(){ - $("#homework_description_"+id).toggleClass("maxh360"); - $("#intro_content_hide_"+id).hide(); - $("#intro_content_show_"+id).show(); - }); -} - function cleanArray (actual){ var newArray = new Array(); for (var i = 0; i< actual.length; i++){ diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index de5190290..810cd0fec 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1099,7 +1099,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 88a5757ec..b1f950960 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -841,7 +841,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;display: inline} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 46364eee0..c671f30ec 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1109,7 +1109,7 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} +.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailReply { margin-top:28px; color:#888888; float:right;} From 5672b029feee2b93afa2804e827469dae9247b6c Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 21 Jan 2016 14:50:16 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8A=A0=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 01afbfebe..902e1277f 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -32,7 +32,7 @@
- <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%> + <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业(将于2016年春上线)") unless edit_mode%> <% if edit_mode %> <% end %> From 99cda66d0004d930d28e0bf6563b941e07333476 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 21 Jan 2016 15:02:12 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=EF=BC=9A=E6=AF=8F=E6=AC=A1=E6=8F=90=E4=BA=A4=E4=BA=86=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=9B=86=E5=90=8E=EF=BC=8C=E9=A1=B5=E9=9D=A2=E9=83=BD?= =?UTF-8?q?=E4=BC=9A=E8=B7=B3=E5=88=B0=E4=BD=9C=E4=B8=9A=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E6=9C=80=E5=BA=95=E7=AB=AF=EF=BC=8C=E8=BF=98=E5=BE=97?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E7=BF=BB=E5=88=B0=E9=A1=B5=E9=9D=A2=E6=9C=80?= =?UTF-8?q?=E9=A1=B6=E7=AB=AF=EF=BC=8C=E5=86=8D=E7=82=B9=E2=80=9C=E5=8F=91?= =?UTF-8?q?=E9=80=81=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 1 + app/views/users/_user_programing_attr.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 902e1277f..5c9386f94 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -25,6 +25,7 @@ <% end %>
+

diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index 45f3089a4..3f2e53fe8 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -32,7 +32,7 @@
温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。 - 确  定 + 确  定