parent
2c77d1b4cf
commit
7907edf168
|
@ -70,3 +70,8 @@ kw:
|
||||||
undefined image_width ÎÊÌâ
|
undefined image_width ÎÊÌâ
|
||||||
bundle exec rake db:migrate:down version=20140725062302
|
bundle exec rake db:migrate:down version=20140725062302
|
||||||
bundle exec rake db:migrate:up version=20140725062302
|
bundle exec rake db:migrate:up version=20140725062302
|
||||||
|
|
||||||
|
=================================[2014-07-19]=====================================
|
||||||
|
kw: Mysql2::Error,存储过程,CALL sp_project_status_cursor();
|
||||||
|
bundle exec rake db:migrate:down version=20130828004955
|
||||||
|
bundle exec rake db:migrate:up version=20130828004955
|
||||||
|
|
|
@ -75,6 +75,7 @@ class ProjectsController < ApplicationController
|
||||||
helper :watchers
|
helper :watchers
|
||||||
# helper :watcherlist
|
# helper :watcherlist
|
||||||
helper :words
|
helper :words
|
||||||
|
helper :project_score
|
||||||
### added by william
|
### added by william
|
||||||
include ActsAsTaggableOn::TagsHelper
|
include ActsAsTaggableOn::TagsHelper
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
include WelcomeHelper
|
include WelcomeHelper
|
||||||
|
helper :project_score
|
||||||
caches_action :robots
|
caches_action :robots
|
||||||
# before_filter :fake, :only => [:index, :course]
|
# before_filter :fake, :only => [:index, :course]
|
||||||
before_filter :entry_select, :only => [:index]
|
before_filter :entry_select, :only => [:index]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
class ProjectScoreHelper
|
module ProjectScoreHelper
|
||||||
#缺陷数量
|
#缺陷数量
|
||||||
def issue_num project
|
def issue_num project
|
||||||
project.issues.count
|
project.issues.count
|
||||||
|
@ -7,7 +7,67 @@ class ProjectScoreHelper
|
||||||
|
|
||||||
#缺陷留言数量
|
#缺陷留言数量
|
||||||
def issue_journal_num project
|
def issue_journal_num project
|
||||||
project
|
project.issue_changes.count
|
||||||
|
end
|
||||||
|
|
||||||
|
#新闻数量
|
||||||
|
def news_num project
|
||||||
|
project.news.count
|
||||||
|
end
|
||||||
|
|
||||||
|
#文档数量
|
||||||
|
def document_num project
|
||||||
|
project.documents.count
|
||||||
|
end
|
||||||
|
|
||||||
|
#代码提交数量
|
||||||
|
def changesets_num project
|
||||||
|
project.changesets.count
|
||||||
|
end
|
||||||
|
|
||||||
|
#讨论区帖子数量
|
||||||
|
def board_message_num project
|
||||||
|
board_message_count = 0
|
||||||
|
project.boards.each do |board|
|
||||||
|
board_message_count += board.messages_count
|
||||||
|
end
|
||||||
|
board_message_count
|
||||||
|
end
|
||||||
|
|
||||||
|
#缺陷得分
|
||||||
|
def issue_score project
|
||||||
|
i_num = issue_num project
|
||||||
|
i_j_num = issue_journal_num project
|
||||||
|
i_num * 4 + i_j_num
|
||||||
|
end
|
||||||
|
|
||||||
|
# 新闻得分
|
||||||
|
def news_score project
|
||||||
|
n_num = news_num project
|
||||||
|
n_num
|
||||||
|
end
|
||||||
|
|
||||||
|
#文档得分
|
||||||
|
def document_score project
|
||||||
|
d_num = document_num project
|
||||||
|
d_num * 4
|
||||||
|
end
|
||||||
|
|
||||||
|
#代码提交得分
|
||||||
|
def changesets_score project
|
||||||
|
c_num = changesets_num project
|
||||||
|
c_num * 4
|
||||||
|
end
|
||||||
|
|
||||||
|
#讨论区帖子得分
|
||||||
|
def board_message_score project
|
||||||
|
b_m_num = board_message_num project
|
||||||
|
b_m_num * 2
|
||||||
|
end
|
||||||
|
|
||||||
|
#项目得分
|
||||||
|
def project_scores project
|
||||||
|
(issue_score project) + (news_score project) + (document_score project) + (changesets_score project) + (board_message_score project)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -96,7 +96,7 @@
|
||||||
<td>
|
<td>
|
||||||
<strong>项目得分:
|
<strong>项目得分:
|
||||||
<span style="color: <%= homework.project.nil? ? "#727272" : "#EC6300"%>;">
|
<span style="color: <%= homework.project.nil? ? "#727272" : "#EC6300"%>;">
|
||||||
<%= homework.project.nil? ? "N/A" : project_score(homework.project) %>
|
<%= homework.project.nil? ? "N/A" : project_scores(homework.project) %>
|
||||||
</span>
|
</span>
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -62,37 +62,10 @@
|
||||||
<%= link_to @project.name, project_path(@project)%>
|
<%= link_to @project.name, project_path(@project)%>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<!-- added by bai 增加项目得分 -->
|
|
||||||
<% issue_count = @project.issues.count %>
|
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
|
||||||
<% issue_score = issue_count * 0.2 %>
|
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
|
||||||
<% finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<% document_count = @project.documents.count %>
|
|
||||||
<% file_score = document_count * 0.1 %>
|
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<% changeset_count = @project.changesets.count %>
|
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
|
||||||
<% @project.boards.each do |board| %>
|
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
|
|
||||||
<% if @project.project_type == 0 %>
|
<% if @project.project_type == 0 %>
|
||||||
<%= l(:label_project_grade)%> :
|
<%= l(:label_project_grade)%> :
|
||||||
<%= link_to(format("%.2f" , finall_project_score ).to_f, {:controller => 'projects',
|
<%= link_to(format("%.2f" , project_scores(@project) ).to_i, {:controller => 'projects',
|
||||||
:action => 'show_projects_score',
|
:action => 'show_projects_score',
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:id => @project.id
|
:id => @project.id
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% changeset_count = @project.changesets.count %>
|
<div><%= l(:label_code_submit_number) %> * 4 = <%= changesets_num(@project) %> * 4 = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
<div><%= l(:label_code_submit_score) %> = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
<div><%= l(:label_code_submit_number) %> * 0.3 = <%= changeset_count %> * 0.3 = <%= format("%.2f" , code_submit_score).to_f %></div>
|
|
||||||
<div><%= l(:label_code_submit_score) %> = <%= format("%.2f" , finall_code_submit_score).to_f %></div>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -1,7 +1,4 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% document_count = @project.documents.count %>
|
<div><%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %></div>
|
||||||
<% file_score = document_count * 0.1 %>
|
<div><%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %></div>
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
<div><%= l(:label_file_number) %> * 0.1 = <%= document_count %> * 0.1 = <%= format("%.2f" , file_score).to_f %></div>
|
|
||||||
<div><%= l(:label_file_score) %> = <%= format("%.2f" , finall_file_score).to_f %></div>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -1,11 +1,6 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% issue_count = @project.issues.count %>
|
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %></div>
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %></div>
|
||||||
<% issue_score = issue_count * 0.2 %>
|
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(@project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(@project)).to_i %>
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
= <%= format("%.2f" , issue_score(@project)).to_i %></div>
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
<div><%= l(:label_issue_number) %> * 0.2 = <%= issue_count %> * 0.2 = <%= format("%.2f" , issue_score).to_f %></div>
|
|
||||||
<div><%= l(:label_issue_journal_number) %> * 0.1 = <%= issue_journal_count %> * 0.1 = <%= format("%.2f" , issue_journal_score).to_f %></div>
|
|
||||||
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_score).to_f %> + <%= format("%.2f" , issue_journal_score).to_f %>
|
|
||||||
= <%= format("%.2f" , finall_issue_score).to_f %></div>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -1,7 +1,5 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
<div><%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %></div>
|
||||||
<% finall_new_score = new_score %>
|
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
|
||||||
<div><%= l(:label_new_number) %> * 0.1 = <%= new_count %> * 0.1 = <%= format("%.2f" , new_score).to_f %></div>
|
|
||||||
<div><%= l(:label_news_score) %> = <%= format("%.2f" , finall_new_score).to_f %></div>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -18,37 +18,37 @@
|
||||||
|
|
||||||
<div class="information">
|
<div class="information">
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<table style="width: 400px;">
|
<table style="width: 280px;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||||
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
|
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 50%;text-align: left">
|
<td style="width: 60%;text-align: left">
|
||||||
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||||
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
|
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 50%;text-align: left">
|
<td style="width: 60%;text-align: left">
|
||||||
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||||
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
|
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 50%;text-align: left">
|
<td style="width: 60%;text-align: left">
|
||||||
<%= content_tag('span', l(:label_since_last_commits)) %>
|
<%= content_tag('span', l(:label_since_last_commits)) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||||
<% #find_project_repository @project %>
|
<% #find_project_repository @project %>
|
||||||
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
|
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 50%;text-align: left">
|
<td style="width: 60%;text-align: left">
|
||||||
<%= content_tag('span', l(:label_commit_on)) %>
|
<%= content_tag('span', l(:label_commit_on)) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -124,37 +124,11 @@
|
||||||
|
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<div class="grade">
|
<div class="grade">
|
||||||
<% issue_count = @project.issues.count %>
|
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
|
||||||
<% issue_score = issue_count * 0.2 %>
|
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
|
||||||
<% finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<% document_count = @project.documents.count %>
|
|
||||||
<% file_score = document_count * 0.1 %>
|
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<% changeset_count = @project.changesets.count %>
|
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
|
||||||
<% @project.boards.each do |board| %>
|
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
|
|
||||||
<% if @project.project_type !=1 %>
|
<% if @project.project_type !=1 %>
|
||||||
<%= l(:label_project_grade)%>:
|
<%= l(:label_project_grade)%>:
|
||||||
<span >
|
<span >
|
||||||
<%= link_to(format("%.2f" , finall_project_score ).to_f,
|
<%= link_to(format("%.2f" , project_scores(@project) ).to_i,
|
||||||
{:controller => 'projects',
|
{:controller => 'projects',
|
||||||
:action => 'show_projects_score',
|
:action => 'show_projects_score',
|
||||||
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
|
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
|
||||||
|
|
|
@ -1,36 +1,10 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% issue_count = @project.issues.count %>
|
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
|
||||||
<% issue_score = issue_count * 0.2 %>
|
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
|
||||||
<% finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<% document_count = @project.documents.count %>
|
|
||||||
<% file_score = document_count * 0.1 %>
|
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<% changeset_count = @project.changesets.count %>
|
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
|
||||||
<% @project.boards.each do |board| %>
|
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
|
|
||||||
<%= l(:label_projects_score) %>
|
<%= l(:label_projects_score) %>
|
||||||
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
|
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
|
||||||
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
|
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
|
||||||
<div> = <%= format("%.2f" , finall_issue_score).to_f %> + <%= format("%.2f" , finall_new_score).to_f %> +
|
<div> = <%= format("%.2f" , issue_score(@project)).to_i %> + <%= format("%.2f" , news_score(@project)).to_i %> +
|
||||||
<%= format("%.2f" , finall_file_score).to_f %> + <%= format("%.2f" , finall_code_submit_score).to_f %> +
|
<%= format("%.2f" , document_score(@project)).to_i %> + <%= format("%.2f" , changesets_score(@project)).to_i %> +
|
||||||
<%= format("%.2f" , topic_score).to_f %></div>
|
<%= format("%.2f" , board_message_score(@project)).to_i %></div>
|
||||||
<div> = <%= format("%.2f" , finall_project_score).to_f %></div>
|
<div> = <%= format("%.2f" , project_scores(@project)).to_i %></div>
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -1,10 +1,4 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% board_message_count = 0 %>
|
<div><%= l(:label_topic_number) %> * 2 = <%= board_message_num(@project) %> * 2 = <%= board_message_score(@project) %></div>
|
||||||
<% @project.boards.each do |board| %>
|
<div><%= l(:label_topic_score) %> = <%= format("%.2f" , board_message_score(@project)).to_i %></div>
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
<div><%= l(:label_topic_number) %> * 0.1 = <%= board_message_count %> * 0.1 = <%= topic_score %></div>
|
|
||||||
<div><%= l(:label_topic_score) %> = <%= format("%.2f" , finall_topic_score).to_f %></div>
|
|
||||||
<!-- end -->
|
<!-- end -->
|
|
@ -1,30 +1,4 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% issue_count = @project.issues.count %>
|
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
|
||||||
<% issue_score = issue_count * 0.2 %>
|
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
|
||||||
<% finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<% document_count = @project.documents.count %>
|
|
||||||
<% file_score = document_count * 0.1 %>
|
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<% changeset_count = @project.changesets.count %>
|
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
|
||||||
<% @project.boards.each do |board| %>
|
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
|
|
||||||
<h3 class="title"><%= l(:label_projects_score) %></h3>
|
<h3 class="title"><%= l(:label_projects_score) %></h3>
|
||||||
<div class="inf_user_image">
|
<div class="inf_user_image">
|
||||||
|
@ -40,7 +14,7 @@
|
||||||
<td width="35%">
|
<td width="35%">
|
||||||
<table>
|
<table>
|
||||||
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
|
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
|
||||||
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , finall_project_score ).to_f %></span></td></tr>
|
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -51,27 +25,27 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
|
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_project_score ).to_f %>
|
<%= format("%.2f" , project_scores(@project) ).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
|
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_issue_score).to_f %>
|
<%= format("%.2f" , issue_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
|
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_new_score).to_f %>
|
<%= format("%.2f" , news_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
|
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_file_score).to_f %>
|
<%= format("%.2f" , document_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
|
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_code_submit_score).to_f %>
|
<%= format("%.2f" , changesets_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
|
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_topic_score).to_f %>
|
<%= format("%.2f" , board_message_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,30 +1,5 @@
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<% issue_count = @project.issues.count %>
|
|
||||||
<% issue_journal_count = @project.issue_changes.count %>
|
|
||||||
<% issue_score = issue_count * 0.2 %>
|
|
||||||
<% issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<% finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<% new_count = @project.news.count %>
|
|
||||||
<% new_score = new_count * 0.1 %>
|
|
||||||
<% finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<% document_count = @project.documents.count %>
|
|
||||||
<% file_score = document_count * 0.1 %>
|
|
||||||
<% finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<% changeset_count = @project.changesets.count %>
|
|
||||||
<% code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<% finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<% board_message_count = 0 %>
|
|
||||||
<% @project.boards.each do |board| %>
|
|
||||||
<% board_message_count += board.messages_count %>
|
|
||||||
<% end %>
|
|
||||||
<% topic_score = board_message_count * 0.1 %>
|
|
||||||
<% finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title><%= h html_title %></title>
|
<title><%= h html_title %></title>
|
||||||
|
@ -56,7 +31,7 @@
|
||||||
<td width="35%">
|
<td width="35%">
|
||||||
<table>
|
<table>
|
||||||
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
|
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
|
||||||
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , finall_project_score ).to_f %></span></td></tr>
|
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -67,27 +42,27 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
|
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_project_score ).to_f %>
|
<%= format("%.2f" , project_scores(@project) ).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
|
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_issue_score).to_f %>
|
<%= format("%.2f" , issue_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
|
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_new_score).to_f %>
|
<%= format("%.2f" , news_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
|
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_file_score).to_f %>
|
<%= format("%.2f" , document_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
|
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_code_submit_score).to_f %>
|
<%= format("%.2f" , changesets_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
|
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
|
||||||
<%= format("%.2f" , finall_topic_score).to_f %>
|
<%= format("%.2f" , board_message_score(@project)).to_i %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -79,33 +79,7 @@
|
||||||
<span class='font_lighter' title ='<%=project.short_description%>'><%=project.description.truncate(100, omission: '...')%></span>
|
<span class='font_lighter' title ='<%=project.short_description%>'><%=project.description.truncate(100, omission: '...')%></span>
|
||||||
</div>
|
</div>
|
||||||
<div >
|
<div >
|
||||||
<%# issue_count = project.issues.count %>
|
<%= content_tag "span", l(:label_project_score)+ ":" + project_scores(project).to_s,
|
||||||
<%# issue_journal_count = project.issue_changes.count %>
|
|
||||||
<%# issue_score = issue_count * 0.2 %>
|
|
||||||
<%# issue_journal_score = issue_journal_count * 0.1 %>
|
|
||||||
<%# finall_issue_score = issue_score + issue_journal_score %>
|
|
||||||
|
|
||||||
<%# new_count = project.news.count %>
|
|
||||||
<%# new_score = new_count * 0.1 %>
|
|
||||||
<%# finall_new_score = new_score %>
|
|
||||||
|
|
||||||
<%# document_count = project.documents.count %>
|
|
||||||
<%# file_score = document_count * 0.1 %>
|
|
||||||
<%# finall_file_score = file_score %>
|
|
||||||
|
|
||||||
<%# changeset_count = project.changesets.count %>
|
|
||||||
<%# code_submit_score = changeset_count * 0.3 %>
|
|
||||||
<%# finall_code_submit_score = code_submit_score %>
|
|
||||||
|
|
||||||
<%# board_message_count = 0 %>
|
|
||||||
<%# project.boards.each do |board| %>
|
|
||||||
<%# board_message_count += board.messages_count %>
|
|
||||||
<%# end %>
|
|
||||||
<%# topic_score = board_message_count * 0.1 %>
|
|
||||||
<%# finall_topic_score = topic_score %>
|
|
||||||
|
|
||||||
<%# finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
|
|
||||||
<%= content_tag "span", l(:label_project_score)+ ":" + project_score(project),
|
|
||||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
||||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||||
:class => "tooltip",
|
:class => "tooltip",
|
||||||
|
|
|
@ -1070,10 +1070,10 @@ overflow: hidden;
|
||||||
|
|
||||||
.information {
|
.information {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 607px;
|
margin-left: 690px;
|
||||||
float: left;
|
float: left;
|
||||||
height: auto;
|
height: auto;
|
||||||
width: 300px;
|
width: 280px;
|
||||||
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
||||||
color: rgb(0, 0, 0);
|
color: rgb(0, 0, 0);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
@ -1232,7 +1232,7 @@ p.stats {
|
||||||
.licences {
|
.licences {
|
||||||
float: left;
|
float: left;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
width: 260px;
|
width: 200px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
|
|
Loading…
Reference in New Issue