<% class << project # 状態、重要度別にバグを分類する def collect_article() result = { 'state' => Hash.new([]), 'priority' => Hash.new([]) } priorities.each do |priority| result['priority'][priority] = [] end @articles.each do |article| priorities.each do |priority| result['priority'][priority] << article if article.priority == priority end end states.each do |state| result['state'][state] = [] end @articles.each do |article| states.each do |state| result['state'][state] << article if article.state == state end end result end end collection = project.collect_article() # 未解決/解決済みバグの状態 open_state = %w(提案 受付済み 着手 修正済み) close_state = %w(保留 完了 却下) %>

<%= project.name %>

絞り込み検索

<%= KagemaiUtil::eruby_compile('search_form.rhtml', binding, project.template_dir) %>

トピックス

重要度別インデックス

未解決の '緊急' のバグ報告
<% articles = collection['priority']['緊急'].find_all {|article| open_state.inclue?(article.state) } sortrule, = 'date' puts KagemaiUtil::eruby_compile('article_index.rhtml', binding, project.template_dir); %>
(内訳)
<% project.priorities.each do |p| %> <%= p %> (<%= collection['priority'][p].size.to_s %> 件) <% end %>

状態別インデックス

[ 未解決 ]
<% count = 0; open_state.each{|s| count += collection['state'][s].size} %> <%= count.to_s %> 件
[ 解決済み ]
<% count = 0; close_state.each{|s| count += collection['state'][s].size} %> <%= count.to_s %> 件
(内訳)
<% project.states.each do |s| %> <%= s %> (<%= collection['state'][s].size.to_s %> 件) <% end %>