<% if params[:folder] == "sent" %>
Sent Messages
<% elsif params[:folder] == "received" %>
Received Messages
<% else %>
Messages
<% end %>
<%= render "search" %>
<%= table_for @dmails, class: "striped autofit", width: "100%" do |t| %>
<% t.column "Date" do |dmail| %>
<%= compact_time(dmail.created_at) %>
<% end %>
<% t.column "From" do |dmail| %>
<%= link_to_user dmail.from %>
<% end %>
<% t.column "To" do |dmail| %>
<%= link_to_user dmail.to %>
<% end %>
<% t.column "Subject", td: { class: "col-expand" } do |dmail| %>
<%= link_to dmail.title, dmail_path(dmail) %>
<% 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) %>