#1242 点击项目得分在弹出的框中点击各项目得分明细反应慢。原因需要向服务器请求数据。解决:使用js在客户端处理各链接,不在向服务器发送请求
This commit is contained in:
parent
ed81275d17
commit
bce403f624
|
@ -842,7 +842,6 @@ class ProjectsController < ApplicationController
|
|||
@project = nil
|
||||
end
|
||||
|
||||
# added by bai
|
||||
def show_projects_score
|
||||
render :layout => false
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<!-- added by bai -->
|
||||
<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>
|
||||
<!-- end -->
|
||||
<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>
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
<!-- added by bai -->
|
||||
|
||||
<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>
|
||||
<!-- end -->
|
||||
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
|
|
@ -3,8 +3,8 @@
|
|||
<%= l(:label_projects_score) %>
|
||||
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
|
||||
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
|
||||
<div> = <%= format("%.2f" , issue_score(@project)).to_i %> + <%= format("%.2f" , news_score(@project)).to_i %> +
|
||||
<%= format("%.2f" , documents_score(@project)).to_i %> + <%= format("%.2f" , changesets_score(@project)).to_i %> +
|
||||
<%= format("%.2f" , board_message_score(@project)).to_i %></div>
|
||||
<div> = <%= format("%.2f" , project_scores(@project)).to_i %></div>
|
||||
<div> = <%= format("%.2f" , issue_score(project)).to_i %> + <%= format("%.2f" , news_score(project)).to_i %> +
|
||||
<%= format("%.2f" , documents_score(project)).to_i %> + <%= format("%.2f" , changesets_score(project)).to_i %> +
|
||||
<%= format("%.2f" , board_message_score(project)).to_i %></div>
|
||||
<div> = <%= format("%.2f" , project_scores(project)).to_i %></div>
|
||||
<!-- end -->
|
|
@ -21,35 +21,65 @@
|
|||
</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>
|
||||
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
|
||||
<%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> :
|
||||
<%= format("%.2f" , project_scores(@project) ).to_i %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
|
||||
<%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> :
|
||||
<%= format("%.2f" , issue_score(@project)).to_i %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
|
||||
<%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> :
|
||||
<%= format("%.2f" , news_score(@project)).to_i %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
|
||||
<%= link_to l(:label_file_score), "javascript:void(0)", :onclick => "show_div('file_score_index')"%> :
|
||||
<%= format("%.2f" , documents_score(@project)).to_i %>
|
||||
</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), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> :
|
||||
<%= format("%.2f" , changesets_score(@project)).to_i %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
|
||||
<%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> :
|
||||
<%= format("%.2f" , board_message_score(@project)).to_i %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="show_score_detail">
|
||||
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %>
|
||||
<%= render :partial => 'projects/project_score_index', :locals => {:project => @project } %>
|
||||
</div>
|
||||
<!-- end -->
|
|
@ -1,5 +1,3 @@
|
|||
<!-- added by bai -->
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/show_projects_score') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').addClass('new-watcher');
|
||||
<!-- end -->
|
Loading…
Reference in New Issue