<%# requirements: mode, project, summary %>

<h2>Trends for reports to date and closed reports (this week)</h2>

<!--
  Edit mrtg/test.html and mrtg/test-week.png as necessary.
-->

<a href="mrtg/test.html">
  <img width=530 height=135 src="mrtg/test-week.png" alt="mrtg"  style="border-style: none">
</a>

<p>
  Unresolved reports: <%= summary.last[1].opened %>,
  <span style="color:#00cc00">Resolved reports</span>: <%= summary.last[1].closed %>, 
  <span style="color:#0000ff">Reports to date</span>: <%= project.size %>,
  <span style="color:#ef8f4f">Percentage closed</span>: <%= "%.2f" % (summary.last[1].closed.to_f / project.size.to_f * 100) %>%
</p>


<% 
   etypes = project.report_type.find_all{|etype| 
     etype.kind_of?(SelectElementType)
   }
%>

<% if project.top_page_options['count'] then %>
  <% etypes.each do |etype| %>
    <h2>Report count by <%= etype.name %></h2>
    <p>
      <%= eval_template('topics_count.rhtml', {:mode => mode, :project => project, :etype => etype}) %>
    </p>
  <% end %>
<% end %>
