From f0db3e1b4a606b25f0b1dacbb3666525194c74ef Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 28 Aug 2014 10:20:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B4=9F=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=BA0=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users.html.erb | 27 ----------------------- app/views/users/_score_new_index.html.erb | 6 ++++- config/locales/en.yml | 3 ++- config/locales/zh.yml | 1 + 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index e116a800f..de10036de 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -92,33 +92,6 @@ <% end %> - - <%# messages_count = @user.messages.count %> - <%# messages_score = messages_count * 0.05%> - <%# finall_messages_score = messages_score %> - - <%# journals_count = @user.journals.count %> - <%# journals_score = journals_count * 0.1 %> - <%# user_changesets_count = @user.changesets.count %> - <%# user_changesets_score = user_changesets_count * 0.3 %> - <%# finall_user_project_score = journals_score + user_changesets_score %> - - <%# journals_for_messages_count = @user.journals_messages.count %> - <%# activities_count = @user.activities.count %> - <%# journals_for_messages_score = journals_for_messages_count * 0.05 %> - <%# activities_score = activities_count * 0.2 %> - <%# finall_activity_score = journals_for_messages_score + activities_score %> - - <%# news_count = @user.news.count %> - <%# news_score = news_count * 0.1 %> - <%# wiki_contents_count = @user.wiki_contents.count %> - <%# wiki_contents_score = wiki_contents_count * 0.1 %> - <%# comments_count = @user.comments.count %> - <%# comments_score = comments_count * 0.1 %> - <%# finall_influence_score = news_score + wiki_contents_score + comments_score %> - <%# finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %> - -
<%= render :partial => 'users/user_score', :locals => {:user => @user}%> diff --git a/app/views/users/_score_new_index.html.erb b/app/views/users/_score_new_index.html.erb index 539c55f80..b79a57e71 100644 --- a/app/views/users/_score_new_index.html.erb +++ b/app/views/users/_score_new_index.html.erb @@ -6,5 +6,9 @@
= <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %> + <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %>
-
= <%= format("%.2f" ,option_num.total_score).to_i %>
+ <% if (format("%.2f" ,collaboration(option_num)).to_i + format("%.2f" , influence(option_num) ).to_i + format("%.2f" , skill(option_num)).to_i + format("%.2f" , active(option_num)).to_i) < 0 %> +
<%= l(:lable_score_less_than_zero) %>
+ <% else %> +
= <%= format("%.2f" ,option_num.total_score).to_i %>
+ <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 46c5360f1..ddae72799 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1807,4 +1807,5 @@ en: label_company_name: Company Name notice_account_invalid_creditentials_new: You have not to the mailbox activation - lable_unknow_type: Unknow type \ No newline at end of file + lable_unknow_type: Unknow type + lable_score_less_than_zero: Score less than 0, revised to 0 \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8f1bd21b0..14f57e34f 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2115,4 +2115,5 @@ zh: lable_memos_max_length: 帖子内容最大长度为65535个字符 lable_forums_max_length: 贴吧描述最大长度为65535个字符 lable_unknow_type: 未知类型 + lable_score_less_than_zero: 得分小于0,修正为0 \ No newline at end of file