From f8c85ccb835fa1c50273b3bef6a6b58e1c958f89 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sun, 6 Sep 2015 09:05:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=20=E5=9B=9E=E5=A4=8D=E6=A1=86=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E9=AB=98=E5=BA=A6=E5=87=8F=E5=B0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_activities.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index f1529ffb8..2d447d739 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -9,7 +9,7 @@ span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} div.ke-toolbar .ke-outline{border:none;} .ke-inline-block{display: none;} - .ke-container{height: 40px !important;} + .ke-container{height: 30px !important;} <% user_activities.each do |user_activity| if user_activities %> From 1bda18afffd942b70ac0082310ef45a7b10bb1f7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sun, 6 Sep 2015 09:31:09 +0800 Subject: [PATCH 2/4] 111 --- db/schema.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 05825bd5d..852e1c2ae 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150829070453) do +ActiveRecord::Schema.define(:version => 20150901004910) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1296,11 +1296,11 @@ ActiveRecord::Schema.define(:version => 20150829070453) do create_table "student_work_tests", :force => true do |t| t.integer "student_work_id" - t.integer "homework_test_id" - t.integer "result" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "error_msg" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" end create_table "student_works", :force => true do |t| @@ -1317,6 +1317,7 @@ ActiveRecord::Schema.define(:version => 20150829070453) do t.datetime "updated_at", :null => false t.integer "late_penalty", :default => 0 t.integer "absence_penalty", :default => 0 + t.integer "system_score" end create_table "student_works_evaluation_distributions", :force => true do |t| @@ -1534,7 +1535,6 @@ ActiveRecord::Schema.define(:version => 20150829070453) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 - t.integer "gid" end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" From d274b675db2ff3418e4b12279e8f4e4cb64099d9 Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 6 Sep 2015 10:07:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E2=80=9C=E7=BC=BA=E9=99=B7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9C=E9=80=9A=E7=9F=A5=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E2=80=9D=E7=AD=89=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 1 - app/views/users/_course_poll.html.erb | 2 +- app/views/users/_project_issue.html.erb | 2 +- app/views/users/_project_message.html.erb | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index f29512b0e..07a2dad39 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -22,7 +22,7 @@
截止时间:<%= activity.end_time.to_s %>
- 作业描述:<%= activity.description.html_safe %> + <%= activity.description.html_safe %>
-
帖子描述: +
<% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 3d2ee18b4..d2213c743 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -19,7 +19,6 @@ 发布时间:<%= format_time(activity.created_on) %>
- 通知描述: <%= activity.description.html_safe %>
diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index 436ae2f46..24adf108e 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -28,7 +28,7 @@
发布时间:<%= format_time(activity.published_at) %>
-
问卷描述:<%=activity.polls_description.html_safe.to_s%>
+
<%=activity.polls_description.html_safe.to_s%>
-
缺陷描述: +
<% if activity.description? %> <%= textAreailizable activity, :description, :attachments => activity.attachments %> <% end %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 18bc49f23..5fc10e48c 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -26,7 +26,7 @@
时间:<%= format_time(activity.created_on) %>
-
帖子描述: +
<% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> From fe91ec1a85bd0af99b4bd75936d07bff2efe2c35 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sun, 6 Sep 2015 11:22:27 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1=E3=80=81=E5=8E=86=E5=8F=B2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E8=87=B4=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=E9=83=A8=E5=88=86=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=88=B0=E8=AF=BE=E7=A8=8B=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=202=E3=80=81=E9=A1=B9=E7=9B=AE=E7=BC=BA=E9=99=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=95=B4=E4=B8=AA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=E7=BC=BA=E9=99=B7=203=E3=80=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=BE=97=E5=88=86=E7=9A=84=E8=BF=98=E5=8E=9F=204?= =?UTF-8?q?=E3=80=81=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 42 +++++++++---------- app/helpers/user_score_helper.rb | 4 +- app/models/news.rb | 2 +- app/models/query.rb | 6 +-- .../20150906025009_forge_activitues_date.rb | 25 +++++++++++ db/schema.rb | 2 +- public/stylesheets/nyan.css | 2 +- 7 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 db/migrate/20150906025009_forge_activitues_date.rb diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 965aacab0..f71103973 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -101,27 +101,27 @@ class MessagesController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE end - # 与我相关动态的记录add start - if(@board && @board.course) #项目的先不管 - teachers = searchTeacherAndAssistant(@board.course) - for teacher in teachers - if(teacher.user_id != User.current.id) - notify = ActivityNotify.new() - if(@board.course) - notify.activity_container_id = @board.course_id - notify.activity_container_type = 'Course' - else - notify.activity_container_id = @board.project_id - notify.activity_container_type = 'Project' - end - notify.activity_id = @message.id - notify.activity_type = 'Message' - notify.notify_to = teacher.user_id - notify.is_read = 0 - notify.save() - end - end - end + # # 与我相关动态的记录add start + # if(@board && @board.course) #项目的先不管 + # teachers = searchTeacherAndAssistant(@board.course) + # for teacher in teachers + # if(teacher.user_id != User.current.id) + # notify = ActivityNotify.new() + # if(@board.course) + # notify.activity_container_id = @board.course_id + # notify.activity_container_type = 'Course' + # else + # notify.activity_container_id = @board.project_id + # notify.activity_container_type = 'Project' + # end + # notify.activity_id = @message.id + # notify.activity_type = 'Message' + # notify.notify_to = teacher.user_id + # notify.is_read = 0 + # notify.save() + # end + # end + # end # 与我相关动态的记录add end call_hook(:controller_messages_new_after_save, { :params => params, :message => @message}) diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 41f76a792..c94763e31 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -433,7 +433,7 @@ module UserScoreHelper #协同得分 def collaboration(option_number) - option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo + option_number.memo * 2 + option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo end #影响力得分 def influence(option_number) @@ -445,7 +445,7 @@ module UserScoreHelper end #项目贡献得分 def active(option_number) - option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 + option_number.memo * 2 + option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 end #更新发帖数 diff --git a/app/models/news.rb b/app/models/news.rb index 6e2725d1c..a9e9d1d18 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -121,7 +121,7 @@ class News < ActiveRecord::Base # Description 公用表中也要记录 def act_as_forge_activity # 如果是project为空,那么是课程相关的,不需要保存 - if !self.project.nil? + if self.project self.forge_acts << ForgeActivity.new(:user_id => self.author_id, :project_id => self.project.id) end diff --git a/app/models/query.rb b/app/models/query.rb index e49147dea..7f51aa53c 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -492,8 +492,8 @@ class Query < ActiveRecord::Base def project_statement project_clauses = [] - unless project.descendants.blank? - if project && !project.descendants.active.empty? + # unless project.descendants.blank? + if project && project.descendants && project.descendants.active && !project.descendants.active.empty? ids = [project.id] if has_filter?("subproject_id") case operator_for("subproject_id") @@ -513,7 +513,7 @@ class Query < ActiveRecord::Base elsif project project_clauses << "#{Project.table_name}.id = %d" % project.id end - end + # end project_clauses.any? ? project_clauses.join(' AND ') : nil end diff --git a/db/migrate/20150906025009_forge_activitues_date.rb b/db/migrate/20150906025009_forge_activitues_date.rb new file mode 100644 index 000000000..b282d1938 --- /dev/null +++ b/db/migrate/20150906025009_forge_activitues_date.rb @@ -0,0 +1,25 @@ +class ForgeActivituesDate < ActiveRecord::Migration + def up + forge_count = ForgeActivity.all.count / 30 + 2 + transaction do + for i in 1 ... forge_count do i + ForgeActivity.page(i).per(30).each do |activity| + unless activity.forge_act_type == "ProjectCreateInfo" + if activity.forge_act + unless activity.forge_act.project + # puts activity.id + activity.destroy + end + else + # puts activity.id.to_s + "----" + activity.destroy + end + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 852e1c2ae..5bf838c25 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150901004910) do +ActiveRecord::Schema.define(:version => 20150906025009) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 6c046d62c..b64e60831 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -210,7 +210,7 @@ span[id^=valid_user] { p.jRatingInfos { position: absolute; z-index: 9999; - background: transparent url('bg_jRatingInfos.png') no-repeat; + /*background: transparent url('bg_jRatingInfos.png') no-repeat;*/ color: #CACACA; display: none; width: 91px;