From e47e1f4e4cdf14f88e510206cc4812a12301e9c5 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 14 Sep 2017 13:44:14 -0700 Subject: [PATCH] conditionally hide spam/ham links --- app/views/dmails/ham.js.erb | 3 ++- app/views/dmails/show.html.erb | 12 +++++++----- app/views/dmails/spam.js.erb | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/dmails/ham.js.erb b/app/views/dmails/ham.js.erb index 2912c6f60..6183271ee 100644 --- a/app/views/dmails/ham.js.erb +++ b/app/views/dmails/ham.js.erb @@ -1 +1,2 @@ -Danbooru.notice("Message marked as not spam"); \ No newline at end of file +Danbooru.notice("Message marked as not spam"); +$("#spam-links").hide(); \ No newline at end of file diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb index cc3db5d13..b7451d8a8 100644 --- a/app/views/dmails/show.html.erb +++ b/app/views/dmails/show.html.erb @@ -30,11 +30,13 @@ | <%= link_to "Filter messages like these", edit_maintenance_user_dmail_filter_path(:dmail_id => @dmail.id) %> | <%= link_to "Permalink", dmail_path(@dmail, :key => @dmail.key), :title => "Use this URL to privately share with a moderator" %> <% if CurrentUser.is_gold? %> - <% if @dmail.is_spam? %> - | <%= link_to "Not spam", ham_dmail_path(@dmail) %> - <% else %> - | <%= link_to "Mark as spam", spam_dmail_path(@dmail) %> - <% end %> + + <% if @dmail.is_spam? %> + | <%= link_to "Not spam", ham_dmail_path(@dmail), remote: :true, method: :post %> + <% else %> + | <%= link_to "Mark as spam", spam_dmail_path(@dmail), remote: :true, method: :post %> + <% end %> + <% end %>

diff --git a/app/views/dmails/spam.js.erb b/app/views/dmails/spam.js.erb index b0002deb8..750fcf30c 100644 --- a/app/views/dmails/spam.js.erb +++ b/app/views/dmails/spam.js.erb @@ -1 +1,2 @@ -Danbooru.notice("Message marked as spam"); \ No newline at end of file +Danbooru.notice("Message marked as spam"); +$("#spam-links").hide(); \ No newline at end of file