myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3413] branches/wf4ever/app: changed method for d


From: noreply
Subject: [myexperiment-hackers] [3413] branches/wf4ever/app: changed method for detecting sketches
Date: Mon, 11 Feb 2013 13:32:10 +0000 (UTC)

Revision
3413
Author
dgc
Date
2013-02-11 13:32:10 +0000 (Mon, 11 Feb 2013)

Log Message

changed method for detecting sketches

Modified Paths

Diff

Modified: branches/wf4ever/app/controllers/packs_controller.rb (3412 => 3413)


--- branches/wf4ever/app/controllers/packs_controller.rb	2013-02-11 12:01:38 UTC (rev 3412)
+++ branches/wf4ever/app/controllers/packs_controller.rb	2013-02-11 13:32:10 UTC (rev 3413)
@@ -76,11 +76,14 @@
     # Get all the annotations as a merged graph
 
     @all_annotations = RDF::Graph.new
+    ag_graphs = session.get_annotation_graphs(@pack.ro_uri)
 
-    session.get_annotation_graphs(@pack.ro_uri).each do |ag|
+    ag_graphs.each do |ag|
       @all_annotations << ag[:body]
     end
 
+    @sketch = @all_annotations.query([nil, RDF::type, RDF::URI.parse("http://purl.org/wf4ever/roterms#Sketch")]).map do |s, p, o| s.to_s end
+
     if allow_statistics_logging(@pack)
       @viewing = Viewing.create(:contribution => @pack.contribution, :user => (logged_in? ? current_user : nil), :user_agent => request.env['HTTP_USER_AGENT'], :accessed_from_site => accessed_from_website?())
     end

Modified: branches/wf4ever/app/views/packs/_items.rhtml (3412 => 3413)


--- branches/wf4ever/app/views/packs/_items.rhtml	2013-02-11 12:01:38 UTC (rev 3412)
+++ branches/wf4ever/app/views/packs/_items.rhtml	2013-02-11 13:32:10 UTC (rev 3413)
@@ -102,13 +102,6 @@
           label = label.split("/").last unless label.starts_with?("http:")
           annotations = get_annotations(pack.ro_uri, e.uri)
           types = resource_types_as_labels(annotations, e.uri)
-          if types.include? "Sketch" 
-            # FIXME: Don't find the sketch like this!
-            # a) Should not be done from _items.rhtml as it means
-            #    display depends on ordering of templates!
-            # b) Should test on URI and not label!
-            @sketch << e.uri
-          end          
           %>
           <li>
             <%= link_to(label, pack_resources_path(pack) + '/' + e.ro_local_uri) -%>

Modified: branches/wf4ever/app/views/packs/show.rhtml (3412 => 3413)


--- branches/wf4ever/app/views/packs/show.rhtml	2013-02-11 12:01:38 UTC (rev 3412)
+++ branches/wf4ever/app/views/packs/show.rhtml	2013-02-11 13:32:10 UTC (rev 3413)
@@ -103,8 +103,6 @@
 				Items <span class="count_text">(<%= @pack.items_count -%>)</span>
 			</h4>
 			
-      <% # FIXME: @sketch should not depend on rendering of items! %>
-      <% @sketch = [] %>
       <div id="pack_items">
         <%= render :partial => "items", :locals => { :pack => @pack, :authorised_to_edit => @authorised_to_edit } -%>
       </div>

reply via email to

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