<% if wu.state_label.in? ["Complete", "Failed", "Cancelled"] %> <% lc = wu.log_collection %> <% if lc and object_readable(lc, Collection) and object_readable(wu.uuid) %> <%= link_to("Log", "#{wu.uri}#Log") %> <% else %> Log unavailable <% end %> <% elsif wu.state_label == "Running" %> <% if object_readable(wu.uuid) %> <%= link_to("Log", "#{wu.uri}#Log") %> <% else %> Log unavailable <% end %> <% end %>