Diff
Modified: branches/packs/app/models/resource.rb (3733 => 3734)
--- branches/packs/app/models/resource.rb 2013-09-27 11:54:30 UTC (rev 3733)
+++ branches/packs/app/models/resource.rb 2013-09-30 13:55:57 UTC (rev 3734)
@@ -328,4 +328,12 @@
end
end
end
+
+ def file_count
+ if is_folder
+ aggregates.map { |aggregate| aggregate.file_count }.sum
+ else
+ 1
+ end
+ end
end
Modified: branches/packs/app/views/items/_resource_tile.html.erb (3733 => 3734)
--- branches/packs/app/views/items/_resource_tile.html.erb 2013-09-27 11:54:30 UTC (rev 3733)
+++ branches/packs/app/views/items/_resource_tile.html.erb 2013-09-30 13:55:57 UTC (rev 3734)
@@ -8,8 +8,12 @@
<td><%=h resource.size -%></td>
<% end %>
<td><%=h association["label"] -%></td>
- <td><%=h resource.annotations.count -%></td>
<td>
+ <% if resource.is_folder %>
+ <%= resource.file_count -%>
+ <% end %>
+ </td>
+ <td>
<% if !resource.is_folder && Authorization.check('destroy', resource, current_user) %>
<%= link_to("<img src='' />",
"#{polymorphic_path([context, :items])}/#{ore_path}",
Modified: branches/packs/app/views/items/_resource_tiles.html.erb (3733 => 3734)
--- branches/packs/app/views/items/_resource_tiles.html.erb 2013-09-27 11:54:30 UTC (rev 3733)
+++ branches/packs/app/views/items/_resource_tiles.html.erb 2013-09-30 13:55:57 UTC (rev 3734)
@@ -3,7 +3,7 @@
<th>Path</th>
<th>Size</th>
<th>Type</th>
- <th>Annotations</th>
+ <th>File count</th>
<th></th>
</tr>
<% resources.each do |resource| %>