Diff
Modified: branches/packs/app/helpers/packs_helper.rb (3666 => 3667)
--- branches/packs/app/helpers/packs_helper.rb 2013-09-03 14:52:45 UTC (rev 3666)
+++ branches/packs/app/helpers/packs_helper.rb 2013-09-04 09:16:13 UTC (rev 3667)
@@ -136,4 +136,10 @@
link_to(uri, uri)
end
end
+
+ def resource_link(resource)
+ association = find_association(resource)
+ "<img src=''> #{link_to(h(resource.folder_entry.entry_name),
+ pack_items_path(resource.research_object.pack) + "/" + resource.ore_path)}"
+ end
end
Modified: branches/packs/app/models/pack.rb (3666 => 3667)
--- branches/packs/app/models/pack.rb 2013-09-03 14:52:45 UTC (rev 3666)
+++ branches/packs/app/models/pack.rb 2013-09-04 09:16:13 UTC (rev 3667)
@@ -714,6 +714,10 @@
return ""
end
+ def find_resource_by_path(path)
+ research_object.resources.find_by_path(relative_uri(path, research_object.uri))
+ end
+
protected
# produces html string containing the required messaged, enclosed within left-padded P tag, belonging to 'none_text' class
Modified: branches/packs/app/views/packs/_resource_tile.html.erb (3666 => 3667)
--- branches/packs/app/views/packs/_resource_tile.html.erb 2013-09-03 14:52:45 UTC (rev 3666)
+++ branches/packs/app/views/packs/_resource_tile.html.erb 2013-09-04 09:16:13 UTC (rev 3667)
@@ -1,7 +1,7 @@
<% ore_path = resource.ore_path %>
<% association = find_association(resource) %>
<tr>
- <td><img src="" association["image"] -%>"> <%= link_to(h(resource.folder_entry.entry_name), pack_items_path(pack) + "/" + ore_path) -%></td>
+ <td><%= resource_link(resource) -%></td>
<% if resource.is_folder || resource.is_proxy %>
<td></td>
<% else %>
Modified: branches/packs/app/views/packs/item_show.html.erb (3666 => 3667)
--- branches/packs/app/views/packs/item_show.html.erb 2013-09-03 14:52:45 UTC (rev 3666)
+++ branches/packs/app/views/packs/item_show.html.erb 2013-09-04 09:16:13 UTC (rev 3667)
@@ -42,7 +42,7 @@
<h2>Input files</h2>
<ul>
<% @input_files_for_this_workflow.each do |input| %>
- <li><%= link_to(h(input.to_s), input.to_s) -%></li>
+ <li><%= resource_link(@pack.find_resource_by_path(input)) -%></li>
<% end %>
</ul>
<% end %>
Modified: branches/packs/app/views/packs/show.rhtml (3666 => 3667)
--- branches/packs/app/views/packs/show.rhtml 2013-09-03 14:52:45 UTC (rev 3666)
+++ branches/packs/app/views/packs/show.rhtml 2013-09-04 09:16:13 UTC (rev 3667)
@@ -105,7 +105,7 @@
<% if @conclusion %>
<h2>Conclusion</h2>
- <p><%= link_to(h(@conclusion.to_s), @conclusion.to_s) -%></p>
+ <p><%= resource_link(@pack.find_resource_by_path(@conclusion)) -%></p>
<% end %>
<% if @authorised_to_edit -%>