myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3678] branches/packs/app/views/annotations/_anno


From: noreply
Subject: [myexperiment-hackers] [3678] branches/packs/app/views/annotations/_annotation.html.erb: added resilience in annotation display when there are broken links
Date: Thu, 5 Sep 2013 15:07:30 +0000 (UTC)

Revision
3678
Author
dgc
Date
2013-09-05 15:07:30 +0000 (Thu, 05 Sep 2013)

Log Message

added resilience in annotation display when there are broken links

Modified Paths

Diff

Modified: branches/packs/app/views/annotations/_annotation.html.erb (3677 => 3678)


--- branches/packs/app/views/annotations/_annotation.html.erb	2013-09-05 14:55:07 UTC (rev 3677)
+++ branches/packs/app/views/annotations/_annotation.html.erb	2013-09-05 15:07:30 UTC (rev 3678)
@@ -27,7 +27,12 @@
             <td class="label"><%=h label -%></td>
             <td class="value">
             <% if parameter["type"] == "resource" %>
-              <%= resource_link(pack.find_resource_by_path(value)) -%>
+              <% resource = pack.find_resource_by_path(value) -%>
+              <% if resource %>
+                <%= resource_link(pack.find_resource_by_path(value)) -%>
+              <% else %>
+                <%= link_to(h(value), value, :rel => 'nofollow') -%>
+              <% end %>
             <% else %>
               <%=h value -%>
             <% end %>

reply via email to

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