myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3734] branches/packs/app: replaced annotation co


From: noreply
Subject: [myexperiment-hackers] [3734] branches/packs/app: replaced annotation count with file count
Date: Mon, 30 Sep 2013 13:55:58 +0000 (UTC)

Revision
3734
Author
dgc
Date
2013-09-30 13:55:57 +0000 (Mon, 30 Sep 2013)

Log Message

replaced annotation count with file count

Modified Paths

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| %>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]