|
|
@ -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;") %>
|
|
|
|