<%- content_for :header_tags do %> <%= stylesheet_link_tag 'rb_default/statistics', 'rb_default/jquery-ui', :plugin => 'redmine_backlogs' %> <%= javascript_include_tag_backlogs 'lib/jquery.js', 'lib/jquery-ui.js' %> <%- end %>
<% global = {} %> <% @projects.each do |project| %> <% stats = project.scrum_statistics scores = stats.scores errors = stats.errors('backlogs_') info = stats.info global = stats.merge(global, 'backlogs_') %>

<%= stats.score %> <%= project.name %>

<% if !scores[:velocity_missing] %> <%= l(:label_sprint_velocity, { :velocity => info[:velocity], :sprints => info[:closed_sprints].length, :days => info[:average_days_per_sprint]}) %>
<% end %>

<%= l(:backlogs_product_backlog) %>

<%= link_to(l(:backlogs_product_backlog), { :controller => 'rb_queries', :action => 'show', :project_id => project }) %>
<% if info[:active_sprint] || info[:closed_sprints] %>

<%= l(:backlogs_sprints) %>

<% if info[:active_sprint] %> <%= link_to(info[:active_sprint].name, { :controller => 'rb_queries', :action => 'show', :project_id => project, :sprint_id => info[:active_sprint].id }) %> (<%= l(:backlogs_active) %>)
<% end %> <% if info[:closed_sprints] %> <% info[:closed_sprints].each do |sprint| %> <%= link_to(sprint.name, { :controller => 'rb_queries', :action => 'show', :project_id => project, :sprint_id => sprint.id }) %>
<% end %> <% end %> <% end %> <% errors.each do |e| %> <% end %>
<% end %>
<% if @projects.size > 0 %>

Overall

<% global.each_pair do |e, n| %> <% end %>
<%= l(e) %> <%= (n * 100) / @projects.size %>%   
<% end %>