fixes #2418 (includes hiding deleted dmails and allowing filtering on user name)

This commit is contained in:
r888888888
2015-07-07 16:47:23 -07:00
parent 4a24fe5074
commit 67e46f6e5c
9 changed files with 121 additions and 8 deletions

View File

@@ -21,6 +21,7 @@
<p>
<%= link_to "Respond", new_dmail_path(:respond_to_id => @dmail) %>
| <%= link_to "Forward", new_dmail_path(:respond_to_id => @dmail, :forward => true) %>
| <%= link_to "Filter messages like these", edit_maintenance_user_dmail_filter_path(:dmail_id => @dmail.id) %>
</p>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<div id="c-users">
<div id="a-edit">
<h1>Edit Message Filters</h1>
<div>
<h2><%= @dmail.title %></h2>
<ul style="margin-bottom: 1em;">
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to, :raw => true %></li>
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
<% if CurrentUser.user.is_moderator? %>
<li><strong>Sender IP</strong>: <%= @dmail.creator_ip_addr %></li>
<% end %>
</ul>
<h3>Body</h3>
<div class="prose">
<%= format_text(@dmail.body) %>
</div>
</div>
<%= simple_form_for @dmail_filter, :url => maintenance_user_dmail_filter_path(:dmail_id => @dmail.id), :method => :put do |f| %>
<div class="input text optional field_with_hint">
<label class="text" for="dmail_filter_words">Banned Words</label>
<%= text_area_tag "dmail_filter[words]", @dmail_filter.words, :id => "dmail_filter_words", :class => "text", :style => "height: 10em;" %>
<p class="hint">A list of banned words or users (space delimited). Any message you receive with a banned word will automatically be deleted. Make sure user names have no spaces in them (replace with underscores).</p>
</div>
<%= f.button :submit, "Submit" %>
<% end %>
</div>
</div>
<% content_for(:page_title) do %>
Edit Message Filters - <%= Danbooru.config.app_name %>
<% end %>