Files
danbooru/app/views/dmails/index.html.erb
evazion 5c913d8ad1 table builder: fix various incorrect css classes.
Change calling convention to explicitly indicate whether the attributes
are for the <th> element or the <td> element. Fixes various cases where
the two were mixed up.

* Fix .col-expand classes not being set correctly on the /post_versions,
  /pool_versions, and /notes pages.

* Fix .updater and .updated-at classes not being set correctly on the
  /forum_topics page.

* Fix the name param being ignored (noticeable in the post count field
  on the /tags page).

* Don't pass empty string when column has no name.
2020-01-07 02:40:59 -06:00

48 lines
1.3 KiB
Plaintext

<div id="c-dmails">
<div id="a-index">
<% if params[:folder] == "sent" %>
<h1>Sent Messages</h1>
<% elsif params[:folder] == "received" %>
<h1>Received Messages</h1>
<% else %>
<h1>Messages</h1>
<% end %>
<%= render "search" %>
<%= table_for @dmails, width: "100%" do |t| %>
<% t.column "Date" do |dmail| %>
<%= compact_time(dmail.created_at) %>
<% end %>
<% t.column "From" do |dmail| %>
<% if dmail.filtered? %>
<%= link_to "[filtered]", user_path(dmail.from) %>
<% else %>
<%= link_to_user dmail.from %>
<% end %>
<% end %>
<% t.column "To" do |dmail| %>
<%= link_to_user dmail.from %>
<% end %>
<% t.column "Subject" do |dmail| %>
<% if dmail.filtered? %>
<%= link_to "[filtered]", dmail_path(dmail) %>
<% else %>
<%= link_to dmail.title, dmail_path(dmail) %>
<% end %>
<% end %>
<% t.column do |dmail| %>
<%= link_to "delete", dmail_path(dmail), :method => :delete, :data => {:confirm => "Are you sure you want to delete this Dmail?"} %>
<% end %>
<% end %>
<%= numbered_paginator(@dmails) %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Messages - <%= Danbooru.config.app_name %>
<% end %>