<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>: <%= link_to_ip @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 %>
