From 2051981170f89cf41ac10edb335f452eaa530fea Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 16 Mar 2017 18:02:05 -0500 Subject: [PATCH] When merging artcomms, list source as html page url, not image url. --- app/assets/javascripts/artist_commentaries.js | 4 +++- app/presenters/post_presenter.rb | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/artist_commentaries.js b/app/assets/javascripts/artist_commentaries.js index bd422705f..a2c96a76c 100644 --- a/app/assets/javascripts/artist_commentaries.js +++ b/app/assets/javascripts/artist_commentaries.js @@ -115,10 +115,12 @@ // If the new description conflicts with the current description, merge them // by appending the new description onto the old one. Danbooru.ArtistCommentary.merge_commentaries = function(description, commentary) { + var normalized_source = $("#image-container").data().normalizedSource; + if ((commentary.original_description && description) && (commentary.original_description != description)) { return description - + "\n\n[tn]\nSource: " + $("#post_source").val() + "\n[/tn]" + + "\n\n[tn]\nSource: " + normalized_source + "\n[/tn]" + "\n\nh6. " + (commentary.original_title || "Untitled") + "\n\n" + commentary.original_description + "\n\n[tn]\nSource: " + commentary.source + "\n[/tn]"; diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 9cfa5e712..f305e4eb9 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -88,6 +88,8 @@ class PostPresenter < Presenter data-file-url="#{post.file_url}" data-large-file-url="#{post.large_file_url}" data-preview-file-url="#{post.preview_file_url}" + data-source="#{post.source}" + data-normalized-source="#{post.normalized_source}" }.html_safe end