conditionally hide spam/ham links

This commit is contained in:
r888888888
2017-09-14 13:44:14 -07:00
parent b944b642b8
commit e47e1f4e4c
3 changed files with 11 additions and 7 deletions

View File

@@ -1 +1,2 @@
Danbooru.notice("Message marked as not spam");
Danbooru.notice("Message marked as not spam");
$("#spam-links").hide();

View File

@@ -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 %>
<span id="spam-links">
<% 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 %>
</span>
<% end %>
</p>
</div>

View File

@@ -1 +1,2 @@
Danbooru.notice("Message marked as spam");
Danbooru.notice("Message marked as spam");
$("#spam-links").hide();