Feature #23212 » 0002-Enable-to-display-subprojects-child-count.patch
| app/views/projects/show.html.erb | ||
|---|---|---|
|
<%=l(:label_subproject_plural)%>
|
||
|
<span class="badge badge-count count"><%= @subprojects.count %></span>
|
||
|
</h3>
|
||
|
<ul class="subprojects">
|
||
|
<% @subprojects.each do |project| %>
|
||
|
<li><%= link_to(project.name, project_path(project), :class => project.css_classes).html_safe %></li>
|
||
|
<% end %>
|
||
|
<ul class="subprojects">
|
||
|
<% @subprojects.each do |project| %>
|
||
|
<li>
|
||
|
<%= link_to(project.name, project_path(project), :class => project.css_classes).html_safe %>
|
||
|
<% if ((child_count = project.children.visible.count) && (child_count > 0)) %>
|
||
|
<span class="badge badge-count count"><%= child_count %></span>
|
||
|
<% end %>
|
||
|
</li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<% end %>
|
||
| test/functional/projects_controller_test.rb | ||
|---|---|---|
|
assert_response :success
|
||
|
assert_select 'div.projects>h3.icon>span.badge', :text => '3'
|
||
|
assert_select 'div.projects>ul.subprojects>li>a', :text => /Private child of eCookbook/, :count => 1
|
||
|
assert_select 'div.projects>ul.subprojects>li>span.badge', :text => '1'
|
||
|
assert_select 'div.projects>ul.subprojects>li>a', :text => /eCookbook Subproject/, :count => 2
|
||
|
end
|
||
- « Previous
- 1
- 2
- 3
- Next »