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 a78fc3c9d..c94763e31 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -423,7 +423,7 @@ module UserScoreHelper #更新分数 def update_score(option_number) - option_number.total_score = collaboration(option_number) + influence(option_number) + skill(option_number) + option_number.total_score = collaboration(option_number) + influence(option_number) + skill(option_number) + active(option_number) if option_number.total_score < 0 option_number.total_score = 0 end @@ -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) @@ -444,9 +444,9 @@ module UserScoreHelper option_number.praise_by_one * 4 + option_number.praise_by_two * 6 + option_number.praise_by_three * 8 - option_number.tread * 2 - option_number.tread_by_one * 2 - option_number.tread_by_two * 4 - option_number.tread_by_three * 6 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 - #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 + end #更新发帖数 def update_memo_number(user,type,project=nil) 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/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 %> 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 %> 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 05825bd5d..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 => 20150829070453) do +ActiveRecord::Schema.define(:version => 20150906025009) 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" 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;