[#4552] Link the issue counts to filtered Issue lists

This commit is contained in:
Eric Davis committed 2010-09-29 12:06:53 -07:00
1 parent 20f89adf39
commit 15d626b6d8
3 files changed
+39 -10

No files matched your search

+15
View File
@@ -143,4 +143,19 @@ module ContractsHelper
end end
end end
def link_to_issue_list_with_filter(text, options={})
deliverable_id = options[:deliverable_id] || '*'
status_id = options[:status_id] || '*'
link_to(h(text), {
:controller => 'issues',
:action => 'index',
:project_id => @project,
:set_filter => 't',
:status_id => status_id,
:deliverable_id => deliverable_id
})
end
end end
+18 -4
View File
@@ -117,13 +117,27 @@
<tbody> <tbody>
<% deliverable.issues_by_status.each do |status, issues| %> <% deliverable.issues_by_status.each do |status, issues| %>
<tr> <tr>
<td><%= h(status.name) %></td> <td>
<td class="number"><%= h(issues.length) %></td> <%= link_to_issue_list_with_filter(status.name,
:deliverable_id => deliverable.id,
:status_id => status.id) %>
</td>
<td class="number">
<%= link_to_issue_list_with_filter(issues.length,
:deliverable_id => deliverable.id,
:status_id => status.id) %>
</td>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<td><strong><%= l(:label_all).capitalize %></strong></td> <td><strong>
<td class="number"><%= deliverable.issues.count %></td> <%= link_to_issue_list_with_filter(l(:label_all).capitalize,
:deliverable_id => deliverable.id) %>
</strong></td>
<td class="number">
<%= link_to_issue_list_with_filter(deliverable.issues.count,
:deliverable_id => deliverable.id) %>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
+6 -6
View File
@@ -413,16 +413,16 @@ class ContractsShowTest < ActionController::IntegrationTest
visit_contract_page(@contract) visit_contract_page(@contract)
assert_select "table#deliverables" do assert_select "table#deliverables" do
assert_select "tr" do assert_select "tr" do
assert_select "td", :text => /#{@status1}/ assert_select "td a", :text => /#{@status1}/
assert_select "td.number", :text => /3/ assert_select "td.number a", :text => /3/
end end
assert_select "tr" do assert_select "tr" do
assert_select "td", :text => /#{@status2}/ assert_select "td a", :text => /#{@status2}/
assert_select "td.number", :text => /1/ assert_select "td.number a", :text => /1/
end end
assert_select "tr" do assert_select "tr" do
assert_select "td strong", "All" assert_select "td strong a", "All"
assert_select "td.number", :text => /4/ assert_select "td.number a", :text => /4/
end end
end end
end end