myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3380] branches/wf4ever/app: changed filter logic


From: noreply
Subject: [myexperiment-hackers] [3380] branches/wf4ever/app: changed filter logic to explicitely exclude RO#Folder resources instead of just including resources with names
Date: Wed, 30 Jan 2013 13:53:42 +0000 (UTC)

Revision
3380
Author
dgc
Date
2013-01-30 13:53:41 +0000 (Wed, 30 Jan 2013)

Log Message

changed filter logic to explicitely exclude RO#Folder resources instead of just including resources with names

Modified Paths

Diff

Modified: branches/wf4ever/app/models/pack.rb (3379 => 3380)


--- branches/wf4ever/app/models/pack.rb	2013-01-30 05:55:06 UTC (rev 3379)
+++ branches/wf4ever/app/models/pack.rb	2013-01-30 13:53:41 UTC (rev 3380)
@@ -75,9 +75,9 @@
         ce.creator  = @manifest.graph.first_object([resource.object, RDF::DC.creator,  nil])
         ce.checksum = @manifest.graph.first_object([resource.object, RDF::RO.checksum, nil])
         ce.size     = @manifest.graph.first_value([resource.object,  RDF::RO.filesize, nil])
-         
-        next unless ce.name
 
+        next if @manifest.graph.query([resource.object, RDF.type, RDF::RO.Folder]).count > 0
+
         @entries << ce
       end
       @entries = @entries.sort_by {|ce| ce.name or ce.uri}

Modified: branches/wf4ever/app/views/packs/_items.rhtml (3379 => 3380)


--- branches/wf4ever/app/views/packs/_items.rhtml	2013-01-30 05:55:06 UTC (rev 3379)
+++ branches/wf4ever/app/views/packs/_items.rhtml	2013-01-30 13:53:41 UTC (rev 3380)
@@ -97,25 +97,23 @@
             </table>
           </li>
         <% else %>
-          <% if e && e.name %>
-             <% 
-            label = e.ro_local_uri
-            annotations = get_annotations(pack.ro_uri, e.uri)
-            types = resource_types_as_labels(annotations, e.uri)           
-            %>
-            <li><%= link_to(label, pack_resources_path(pack) + '/' + e.ro_local_uri) -%>
-            <% if not types.empty? %>
-             (<%= types -%>)
-            <% end %>  
-            <%= link_to_remote("<img src='' />",
-                :update => "pack_items", 
-                :url ="" pack_resources_path(pack) + '/' + e.ro_local_uri,
-                :method => :delete,
-                :complete => "new Effect.Highlight('pack_items', { duration: 1.5 });",
-                :confirm => "Are you sure you want to delete this resource?" )
-            %>
-            </li>
-          <% end %>
+          <% 
+          label = e.ro_local_uri
+          annotations = get_annotations(pack.ro_uri, e.uri)
+          types = resource_types_as_labels(annotations, e.uri)           
+          %>
+          <li><%= link_to(label, pack_resources_path(pack) + '/' + e.ro_local_uri) -%>
+          <% if not types.empty? %>
+           (<%= types -%>)
+          <% end %>  
+          <%= link_to_remote("<img src='' />",
+              :update => "pack_items", 
+              :url ="" pack_resources_path(pack) + '/' + e.ro_local_uri,
+              :method => :delete,
+              :complete => "new Effect.Highlight('pack_items', { duration: 1.5 });",
+              :confirm => "Are you sure you want to delete this resource?" )
+          %>
+          </li>
         <% end %>
 			<% end -%>
 			

reply via email to

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