dmails: allow marking dmails as unread.
* Add ability to mark dmails as unread. * Fix users.unread_dmail_count to not count deleted dmails. * Fix show action so that API calls don't mark dmails as read. * Don't show the unread dmail notice on the /dmails page itself. * Stop using users.has_mail flag.
This commit is contained in:
@@ -25,11 +25,18 @@
|
||||
<%= link_to dmail.title, dmail_path(dmail) %>
|
||||
<% end %>
|
||||
<% t.column do |dmail| %>
|
||||
<% if dmail.is_read? %>
|
||||
<%= link_to "Unread", dmail_path(dmail, format: :js), remote: true, method: :put, "data-params": "dmail[is_read]=false" %>
|
||||
<% else %>
|
||||
<%= link_to "Read", dmail_path(dmail, format: :js), remote: true, method: :put, "data-params": "dmail[is_read]=true" %>
|
||||
<% end %>
|
||||
|
|
||||
<% if dmail.is_deleted? %>
|
||||
<%= link_to "Undelete", dmail_path(dmail, format: :js), remote: true, method: :put, "data-params": "dmail[is_deleted]=false" %>
|
||||
<% else %>
|
||||
<%= link_to "Delete", dmail_path(dmail, format: :js), remote: true, method: :put, "data-params": "dmail[is_deleted]=true", "data-confirm": "Are you sure you want to delete this dmail?" %>
|
||||
<% 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 %>
|
||||
|
||||
Reference in New Issue
Block a user