Modified: branches/wf4ever/app/models/pack.rb (3513 => 3514)
--- branches/wf4ever/app/models/pack.rb 2013-04-16 14:08:54 UTC (rev 3513)
+++ branches/wf4ever/app/models/pack.rb 2013-04-16 14:38:01 UTC (rev 3514)
@@ -115,6 +115,13 @@
nil
end
+ def resource_label(uri)
+ label = @manifest.query([RDF::URI.parse(uri), RDF::URI.parse("http://purl.org/wf4ever/ro#name"), nil]).first_value
+
+ return label if label
+
+ uri.split("/").last
+ end
end
class Pack < ActiveRecord::Base
Modified: branches/wf4ever/app/views/packs/show.rhtml (3513 => 3514)
--- branches/wf4ever/app/views/packs/show.rhtml 2013-04-16 14:08:54 UTC (rev 3513)
+++ branches/wf4ever/app/views/packs/show.rhtml 2013-04-16 14:38:01 UTC (rev 3514)
@@ -105,7 +105,7 @@
<h3>Hypothesis</h3>
<ul>
<% @hypothesis.each do |resource| %>
- <li><%= link_to(h(resource), resource) -%></li>
+ <li><%= link_to(h(@pack.contributable_entries.resource_label(resource)), resource) -%></li>
<% end %>
</ul>
<% end %>
@@ -114,7 +114,7 @@
<h3>Conclusions</h3>
<ul>
<% @conclusions.each do |resource| %>
- <li><%= link_to(h(resource), resource) -%></li>
+ <li><%= link_to(h(@pack.contributable_entries.resource_label(resource)), resource) -%></li>
<% end %>
</ul>
<% end %>