<% if source.try(:available?) %>

<%= link_to "Fetch source data", source_path(:format => "json", :url => source.referer_url(self)), :id => "fetch-data-bookmarklet", :style => "display: none;" %>

<%= content_tag "span", "Loading #{source.site_name} data...", :id => "loading-data" %>

<% else %>

<%= link_to "Fetch source data", source_path(:format => "json"), :id => "fetch-data-manual" %>

<%= content_tag "span", "Loading source data...", :id => "loading-data", :style => "display: none;" %>

<% end %>

<%= content_tag "span", "Gallery. Tags may not apply to all images.", :id => "gallery-warning", :style => "display: none;" %>