dmails: allow Members to mark dmails as spam.
* Allow Members to mark dmails as spam or not spam (previously Gold only). * Replace spam and ham endpoints with single update endpoint.
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
Danbooru.notice("Message marked as not spam");
|
||||
$("#spam-links").hide();
|
||||
@@ -28,14 +28,10 @@
|
||||
<%= link_to "Respond", new_dmail_path(:respond_to_id => @dmail) %>
|
||||
| <%= link_to "Forward", new_dmail_path(:respond_to_id => @dmail, :forward => true) %>
|
||||
| <%= link_to "Permalink", dmail_path(@dmail, :key => @dmail.key), :title => "Use this URL to privately share with a moderator" %>
|
||||
<% if CurrentUser.is_gold? %>
|
||||
<span id="spam-links">
|
||||
<% if @dmail.is_spam? %>
|
||||
| <%= link_to "Not spam", ham_dmail_path(@dmail), remote: :true, method: :post %>
|
||||
<% else %>
|
||||
| <%= link_to "Spam", spam_dmail_path(@dmail), remote: :true, method: :post %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% if @dmail.is_spam? %>
|
||||
| <%= link_to "Not spam", dmail_path(@dmail, format: :js), remote: :true, method: :put, "data-params": "dmail[is_spam]=false" %>
|
||||
<% else %>
|
||||
| <%= link_to "Spam", dmail_path(@dmail, format: :js), remote: :true, method: :put, "data-params": "dmail[is_spam]=true" %>
|
||||
<% end %>
|
||||
<% if @dmail.reportable_by?(CurrentUser.user) %>
|
||||
| <%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "Dmail", model_id: @dmail.id }), remote: true, title: "Report this dmail to the moderators" %>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Danbooru.notice("Message marked as spam");
|
||||
$("#spam-links").hide();
|
||||
1
app/views/dmails/update.js.erb
Normal file
1
app/views/dmails/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
location.reload();
|
||||
Reference in New Issue
Block a user