Files
danbooru/app/views/dmails/show.html.erb
evazion af044c45db mod reports: enable reporting for members, add dmail reporting.
* Add ability to report dmails.
* Enable reports for comments, forum posts, and dmails.
* Allow Members to send reports.
* Don't allow users to report the same thing twice.
2020-01-27 17:12:39 -06:00

47 lines
1.8 KiB
Plaintext

<% page_title "Message: #{@dmail.title}" %>
<%= render "secondary_links" %>
<div id="c-dmails">
<div id="a-show">
<div class="dmail">
<h1>Show Message</h1>
<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 %></li>
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
</ul>
<h3>Body</h3>
<div class="prose">
<%= format_text(@dmail.body) %>
<% if @dmail.is_automated? %>
<p class="fineprint">
This is an automated message. Responses will not be seen. If you have any questions either message a moderator or ask in the forum.
</p>
<% end %>
</div>
<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 "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>
<% 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" %>
<% end %>
</p>
</div>
</div>
</div>