From f3402e4fa4a5211ebadd57d45af5622c009a3682 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 14 Jan 2016 15:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86=E6=96=B0?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_project_score_index.html.erb | 12 ++++++------ app/views/projects/_show_projects_score.html.erb | 14 +++++++------- ...0160114022833_add_board_num_to_project_score.rb | 1 - db/migrate/20160114022928_update_project_score.rb | 5 ----- db/schema.rb | 1 - 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/app/views/projects/_project_score_index.html.erb b/app/views/projects/_project_score_index.html.erb index beff3552e..aefac603e 100644 --- a/app/views/projects/_project_score_index.html.erb +++ b/app/views/projects/_project_score_index.html.erb @@ -1,9 +1,9 @@
<%= l(:label_projects_score) %>
= <%= l(:label_code_submit_score) %> + <%= l(:label_issue_score) %> + <%= l(:label_file_attachment_score) %> + <%= l(:label_topic_score) %> + <%= l(:label_news_score) %>
-
= <%= @project.commits_count * 4 %> + - <%= @project.issues_count * 4 + @project.journals_count %> + - <%= @project.attachments_count * 5 %> + - <%= @project.boards_count * 2 + @project.boards_reply_count %> + - <%= @project.news_count %> +
= <%= @project.project_score.changeset_num * 4 %> + + <%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %> + + <%= @project.project_score.attach_num * 5 %> + + <%= @project.project_score.board_num * 2 + @project.project_score.board_message_num %> + + <%= @project.project_score.news_num %>
-
= <%= static_project_score(@project) %>
+
= <%= static_project_score(@project.project_score) %>
diff --git a/app/views/projects/_show_projects_score.html.erb b/app/views/projects/_show_projects_score.html.erb index c188bad98..c18060257 100644 --- a/app/views/projects/_show_projects_score.html.erb +++ b/app/views/projects/_show_projects_score.html.erb @@ -12,7 +12,7 @@ - +
<%= l(:label_projects_score) %>
<%= static_project_score(@project) %>
<%= static_project_score(@project.project_score) %>
@@ -22,22 +22,22 @@
  • - <%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= static_project_score(@project) %> + <%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= static_project_score(@project.project_score) %>
  • - <%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= @project.commits_count * 4 %> + <%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= @project.project_score.changeset_num * 4 %>
  • - <%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.issues_count * 4 + @project.journals_count %> + <%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %>
  • - <%= link_to l(:label_file_attachment_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.attachments_count * 5 %> + <%= link_to l(:label_file_attachment_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.project_score.attach_num * 5 %>
  • - <%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> : <%= @project.boards_count * 2 + @project.boards_reply_count %> + <%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> : <%= @project.project_score.board_num * 2 + @project.project_score.board_message_num %>
  • - <%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= @project.news_count %> + <%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= @project.project_score.news_num %>
diff --git a/db/migrate/20160114022833_add_board_num_to_project_score.rb b/db/migrate/20160114022833_add_board_num_to_project_score.rb index e0360f2c1..4ee56a56b 100644 --- a/db/migrate/20160114022833_add_board_num_to_project_score.rb +++ b/db/migrate/20160114022833_add_board_num_to_project_score.rb @@ -1,7 +1,6 @@ class AddBoardNumToProjectScore < ActiveRecord::Migration def change add_column :project_scores, :board_num, :integer, :default => false - add_column :project_scores, :act_num, :integer, :default => false add_column :project_scores, :attach_num, :integer, :default => false end end diff --git a/db/migrate/20160114022928_update_project_score.rb b/db/migrate/20160114022928_update_project_score.rb index fb48049c6..8a632c2bc 100644 --- a/db/migrate/20160114022928_update_project_score.rb +++ b/db/migrate/20160114022928_update_project_score.rb @@ -34,11 +34,6 @@ class UpdateProjectScore < ActiveRecord::Migration news_count = project.news.count project.project_score.update_attribute(:news_num, news_count) end - # update acts - acts = ForgeActivity.where("project_id = ?", project.id) - unless acts.blank? - project.project_score.update_attribute(:act_num, acts.count) - end # update attach unless project.attachments.nil? attachments_count = project.attachments.count diff --git a/db/schema.rb b/db/schema.rb index d1ad108a5..94db7d8c3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1365,7 +1365,6 @@ ActiveRecord::Schema.define(:version => 20160114022928) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 end