Diff
Modified: branches/wf4ever/app/views/packs/_items.rhtml (3387 => 3388)
--- branches/wf4ever/app/views/packs/_items.rhtml 2013-01-31 09:54:02 UTC (rev 3387)
+++ branches/wf4ever/app/views/packs/_items.rhtml 2013-01-31 10:26:57 UTC (rev 3388)
@@ -100,7 +100,14 @@
<%
label = e.ro_local_uri
annotations = get_annotations(pack.ro_uri, e.uri)
- types = resource_types_as_labels(annotations, 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) -%>
<% if not types.empty? %>
Modified: branches/wf4ever/app/views/packs/show.rhtml (3387 => 3388)
--- branches/wf4ever/app/views/packs/show.rhtml 2013-01-31 09:54:02 UTC (rev 3387)
+++ branches/wf4ever/app/views/packs/show.rhtml 2013-01-31 10:26:57 UTC (rev 3388)
@@ -88,7 +88,6 @@
<%= render :partial => "research_objects/tags", :locals => { :contributable => @pack } -%>
<% end %>
- <%= render :partial => "research_objects/diagram", :locals => { :contributable => @pack } -%>
<%= render :partial => "research_objects/attribution", :locals => { :contributable => @pack } -%>
@@ -104,9 +103,14 @@
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>
+ <% # FIXME diagram should not have to be rendered after items %>
+ <%= render :partial => "research_objects/diagram", :locals => { :contributable => @pack } -%>
+
<br/><br/>
<h4>
Modified: branches/wf4ever/app/views/research_objects/_diagram.rhtml (3387 => 3388)
--- branches/wf4ever/app/views/research_objects/_diagram.rhtml 2013-01-31 09:54:02 UTC (rev 3387)
+++ branches/wf4ever/app/views/research_objects/_diagram.rhtml 2013-01-31 10:26:57 UTC (rev 3388)
@@ -1,10 +1,14 @@
- <div class="annotation mockup">
+<% if not @sketch.empty? %>
+ <div class="annotation">
<h3 class="type">Research overview</h3>
- <div class="body">
- <img src="" width="450" />
- </div>
- <div class="provenance">
+ <% @sketch.each do |diagram| %>
+ <div class="body">
+ <img src="" diagram -%>" width="450" />
+ </div>
+ <% end %>
+ <div class="provenance mockup">
<span class="authoredBy">Kristina</span> on
<span class="authoredOn">2012-12-24 15:04</span>
</div>
</div>
+<% end %>
\ No newline at end of file