Render "Fetch source data" box html server-side.
Instead of calling /sources.json and rendering the "Fetch source data" box client-side in Javascript, call /sources.js so we can render the html server-side.
This commit is contained in:
11
app/views/sources/show.js.erb
Normal file
11
app/views/sources/show.js.erb
Normal file
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user