项目得分弹出分类显示

This commit is contained in:
huang 2016-01-14 17:29:55 +08:00
parent 9841dbeb05
commit a105ed6e00
7 changed files with 44 additions and 15 deletions

View File

@ -1,4 +1,4 @@
<!-- added by bai -->
<div><%= l(:label_code_submit_number) %> * 4 = <%= changesets_num(@project) %> * 4 = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
<div><%= l(:label_code_submit_score) %> = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
<div><%= l(:label_code_submit_number) %> * 4 = <%= project.project_score.changeset_num %> * 4 = <%= project.project_score.changeset_num * 4 %></div>
<div><%= l(:label_code_submit_score) %> = <%= project.project_score.changeset_num * 4 %></div>
<!-- end -->

View File

@ -1,4 +1,2 @@
<!-- added by bai -->
<div><%= l(:label_file_number) %> * 4 = <%= documents_num(@project) %> * 4 = <%= format("%.2f" , documents_score(@project)).to_i %></div>
<div><%= l(:label_file_score) %> = <%= format("%.2f" , documents_score(@project)).to_i %></div>
<!-- end -->
<div><%= l(:lable_file_attachment_number) %> * 5 = <%= project.project_score.attach_num %> * 5 = <%= project.project_score.attach_num * 5 %></div>
<div><%= l(:label_file_attachment_score) %> = <%= project.project_score.attach_num * 5 %></div>

View File

@ -1,4 +1,4 @@
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= format("%.2f" , issue_num(project) * 4).to_i %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(project) %> * 1 = <%= format("%.2f" , issue_journal_num(project)).to_i %></div>
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(project)).to_i %>
= <%= format("%.2f" , issue_score(project)).to_i %></div>
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= project.project_score.issue_num * 4 %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= project.project_score.issue_journal_num %> * 1 = <%= project.project_score.issue_journal_num * 1 %></div>
<div><%= l(:label_issue_score) %> = <%= project.project_score.issue_num * 4 %> + <%= project.project_score.issue_journal_num * 1 %>
= <%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %></div>

View File

@ -1,2 +1,2 @@
<div><%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %></div>
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
<div><%= l(:label_new_number) %> * 1 = <%= project.project_score.news_num %> * 1 = <%= project.project_score.news_num * 1 %></div>
<div><%= l(:label_news_score) %> = <%= project.project_score.news_num * 1 %></div>

View File

@ -1,4 +1,4 @@
<!-- added by bai -->
<div><%= l(:label_topic_number) %> * 2 = <%= board_message_num(@project) %> * 2 = <%= board_message_score(@project) %></div>
<div><%= l(:label_topic_score) %> = <%= format("%.2f" , board_message_score(@project)).to_i %></div>
<div><%= l(:label_topic_number) %> * 2 = <%= project.project_score.board_num %> * 2 = <%= project.project_score.board_num * 2 %></div>
<div><%= l(:label_topic_score) %> = <%= project.project_score.board_num * 2 %></div>
<!-- end -->

View File

@ -19,6 +19,36 @@
</table>
</div>
<script type="text/javascript">
function show_div(url)
{
if(url == 'project_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/project_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'issue_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/issue_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'news_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/news_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'file_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/file_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'code_submit_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/code_submit_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'projects_topic_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/projects_topic_score_index', :locals => {:project => @project}) %>');
}
}
</script>
<div class="tabs_new">
<ul>
<li>
@ -31,7 +61,7 @@
<%= 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 %>
</li>
<li>
<%= 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_file_attachment_score), "javascript:void(0)", :onclick => "show_div('file_score_index')"%> : <%= @project.project_score.attach_num * 5 %>
</li>
<li>
<%= 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 %>

View File

@ -433,6 +433,7 @@ zh:
label_file_score: 文档得分
label_file_number: 文档的数量
lable_file_attachment_number: 资源数
label_file_attachment_score: 资源得分
label_code_submit_score: 代码提交得分