-
<%= 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;" %>
-
-
<%= content_tag "span", "Gallery. Tags may not apply to all images." %>
+<%# source %>
-
+
+ <%= link_to "Fetch source data", source_path, id: "fetch-data-manual" %>
+
+
+ <% if @source.present? %>
+
+
+
- Artist
+
-
+ <% if @source.artist_name.blank? %>
+ None
+ <% else %>
+ <%= link_to @source.artist_name, @source.profile_url, id: "source-info-artist-profile" %>
+
+ <% if @source.artists.empty? %>
+ (<%= link_to "Create new artist", new_artist_path(artist: { name: @source.unique_id, other_names: @source.artist_name, url_string: [@source.profile_url, @source.normalize_for_artist_finder].uniq.sort.join("\n") }), id: "source-info-create-new-artist" %>)
+ <% else %>
+ (
+ <% @source.artists.each do |artist| %>
+ - <%= link_to artist.name, artist_path(artist), class: "tag-type-#{artist.category_name}" %>
+ <% end %>
+
)
+ <% end %>
+ <% end %>
+
+
+
+
diff --git a/app/views/sources/show.js.erb b/app/views/sources/show.js.erb
new file mode 100644
index 000000000..518fa65ca
--- /dev/null
+++ b/app/views/sources/show.js.erb
@@ -0,0 +1,11 @@
+$("#source-info").replaceWith("<%= j render "info", source: @source %>");
+
+Danbooru.RelatedTag.recent_artists = <%= raw @source.artists.to_json(include: :sorted_urls) %>;
+Danbooru.RelatedTag.translated_tags = <%= raw @source.translated_tags.to_json %>;
+Danbooru.RelatedTag.build_all();
+
+if ($("#c-uploads #a-new").length) {
+ $("#upload_artist_commentary_title").val(<%= raw @source.dtext_artist_commentary_title.to_json %>);
+ $("#upload_artist_commentary_desc").val(<%= raw @source.dtext_artist_commentary_desc.to_json %>);
+ Danbooru.Upload.toggle_commentary();
+}